From a5b3d206b2cf78693b4ea48de5be0b31c63a48ca Mon Sep 17 00:00:00 2001 From: elkowar <5300871+elkowar@users.noreply.github.com> Date: Tue, 25 Aug 2020 19:45:43 +0200 Subject: [PATCH] Add stuff --- .netrwhist | 12 ++++++++++++ init.vim | 32 ++++++++++++++++++++++++-------- lsp.vim | 24 ++++++++++++++++++++++++ plugins.vim | 13 ++++++++----- whichkeyConfig.vim | 3 ++- 5 files changed, 70 insertions(+), 14 deletions(-) create mode 100644 .netrwhist diff --git a/.netrwhist b/.netrwhist new file mode 100644 index 0000000..06d4c94 --- /dev/null +++ b/.netrwhist @@ -0,0 +1,12 @@ +let g:netrw_dirhistmax =10 +let g:netrw_dirhistcnt =2 +let g:netrw_dirhist_2='/home/leon/dotfiles/.vim/plugged/vim-airline-themes/plugin' +let g:netrw_dirhist_1='/home/leon/dotfiles/.vim/plugged/vim-airline-themes' +let g:netrw_dirhist_0='/home/leon/dotfiles/.vim/plugged' +let g:netrw_dirhist_9='/home/leon/coding/projects/rnix-lsp' +let g:netrw_dirhist_8='/home/leon/coding/projects/rnix-lsp/src' +let g:netrw_dirhist_7='/home/leon/coding/projects/rnix-lsp' +let g:netrw_dirhist_6='/home/leon/tmp/nixpkgs/pkgs' +let g:netrw_dirhist_5='/home/leon/tmp/nixpkgs/pkgs/tools/misc/fet-sh' +let g:netrw_dirhist_4='/home/leon/tmp/nixpkgs/pkgs/tools/misc/fet.sh' +let g:netrw_dirhist_3='/home/leon/tmp/nixpkgs/pkgs/tools/misc/pfetch' diff --git a/init.vim b/init.vim index 6777ed4..8102f95 100644 --- a/init.vim +++ b/init.vim @@ -18,6 +18,7 @@ endif let mapleader ="\" + " Vanilla VIM configuration ------------------------------------ {{{ filetype plugin indent on @@ -32,6 +33,9 @@ set encoding=utf-8 set nonumber norelativenumber set nocompatible set cursorline +set incsearch +set hlsearch +set inccommand=nosplit " May cause problems! if (has("termguicolors")) @@ -62,6 +66,15 @@ let &t_ut='' " hide empty line ~'s highlight EndOfBuffer ctermfg=black ctermbg=black + + +hi NormalFloat ctermbg=black guibg='#1d2021' +hi Pmenu ctermbg=black guibg='#1d2021' +hi SignColumn ctermbg=black guibg='#282828' +hi WhichKeyFloating ctermbg=black guibg='#282828' +hi link Function GruvboxGreen + + if !has("nvim") set term=xterm-256color endif @@ -129,13 +142,15 @@ vnoremap K " Plugin configuration --------------------------------------------------- {{{ -" Misc configuration ----------------------------------------------------- {{{ +let g:VM_leader = 'm' autocmd BufReadPost * :DetectIndent let g:detectindent_preferred_expandtab = 1 let g:detectindent_preferred_indent = 2 +autocmd BufReadPost *.hs :set shiftwidth=2 + let g:sneak#label = 1 nmap Sneak_s @@ -166,9 +181,6 @@ map f (easymotion-bd-f) map s (easymotion-overwin-f2) let g:EasyMotion_smartcase = 1 -nmap / (incsearch-forward) -nmap ? (incsearch-backward) - let g:signify_sign_delete = '-' " Airline {{{ @@ -176,25 +188,29 @@ let g:signify_sign_delete = '-' let g:airline#extensions#tabline#enabled = 1 let g:airline_powerline_fonts = 0 -let g:airline_section_a = '%#__accent_bold#%{airline#util#wrap(airline#parts#mode(),0)}%#__restore__#%{airline#util#append(airline#parts#iminsert(),0)}' +let g:airline_section_a = '%#__accent#%{airline#util#wrap(airline#parts#mode(),0)}%#__restore__#%{airline#util#append(airline#parts#iminsert(),0)}' let g:airline_section_b = '' let g:airline_section_c = '%<%<%#__accent_red#%{airline#util#wrap(airline#parts#readonly(),0)}%#__restore__#%#__accent_bold#%{airline#util#wrap(airline#extensions#coc#get_status(),0)}%#__restore__#' let g:airline_section_y = '' let g:airline_section_z = '%4l% %3v' let g:airline_section_warning = '%{airline#extensions#whitespace#check()}%{airline#util#wrap(airline#extensions#coc#get_warning(),0)}' - let airline#extensions#coc#error_symbol = '' let airline#extensions#coc#warning_symbol = '' let airline#extensions#coc#stl_format_err = '%E{[%e(#%fe)]}' let airline#extensions#coc#stl_format_warn = '%W{[%w(#%fw)]}' - let g:airline_theme='elkowars_gruvbox' -" }}} + +hi airline_tabfill ctermbg=NONE guibg=NONE +hi airline_b_to_airline_c ctermbg=NONE guibg='#ff0000' +hi airline_tablabel_right ctermbg=NONE guibg=NONE ctermfg=NONE guifg=NONE + " }}} + source $VIM_ROOT/whichkeyConfig.vim source $VIM_ROOT/lsp.vim " }}} + diff --git a/lsp.vim b/lsp.vim index b2fa364..fd2f5d3 100644 --- a/lsp.vim +++ b/lsp.vim @@ -1,3 +1,19 @@ +hi link haskellOperators GruvboxAqua +hi link haskellImportKeywords GruvboxPurple + + +au VimEnter * RainbowParenthesesToggle +au Syntax * RainbowParenthesesLoadRound +au Syntax * RainbowParenthesesLoadSquare +au Syntax * RainbowParenthesesLoadBraces + +let g:coc_global_extensions = [ + \ 'coc-yank', 'coc-vimlsp', 'coc-prettier', 'coc-eslint', + \ 'coc-diagnostic', 'coc-yaml', 'coc-tsserver', 'coc-rust-analyzer', + \ 'coc-json', 'coc-go', 'coc-html', 'coc-css', 'coc-clangd' + \ ] + + " vim-jsx autocmd! BufRead,BufNewFile *.tsx setlocal syntax=javascript.jsx @@ -8,6 +24,14 @@ let g:user_emmet_mode='n' + +" Use to trigger completion. +if has('nvim') + inoremap coc#refresh() +else + inoremap coc#refresh() +endif + " ? idk inoremap pumvisible() ? "\" : check_back_space() ? "\" : coc#refresh() inoremap pumvisible() ? "\" : "\" diff --git a/plugins.vim b/plugins.vim index 0fea84c..0bbe2ab 100644 --- a/plugins.vim +++ b/plugins.vim @@ -10,7 +10,7 @@ call plug#begin('~/.vim/plugged') Plug 'tpope/vim-repeat' Plug 'junegunn/goyo.vim', {'on': 'Goyo'} - Plug 'osyo-manga/vim-over', {'on': 'OverCommandLine'} " Substitute preview + "Plug 'osyo-manga/vim-over', {'on': 'OverCommandLine'} " Substitute preview Plug 'liuchengxu/vim-which-key' @@ -27,7 +27,8 @@ call plug#begin('~/.vim/plugged') Plug 'vim-airline/vim-airline-themes' Plug 'vim-airline/vim-airline' - Plug 'morhetz/gruvbox' + "Plug 'morhetz/gruvbox' + Plug 'gruvbox-community/gruvbox' Plug 'godlygeek/tabular' " :Tab /regex can align code on occurrences of the given regex. I.e. :Tab /= aligns all = signs in a block. Plug 'tpope/vim-surround' @@ -38,10 +39,11 @@ call plug#begin('~/.vim/plugged') " to select current word. to select next occurrence. " with multiple lines selected in Visual mode, to insert cursor in each line. I not i to insert in Visual-mode. - Plug 'terryma/vim-multiple-cursors' + "Plug 'terryma/vim-multiple-cursors' + Plug 'mg979/vim-visual-multi' Plug 'hauleth/sad.vim' " Use siw instead of ciw. when using . afterwards, will find the next occurrence of the changed word and change it too Plug 'wellle/targets.vim' " more text objects. IE: cin) (change in next parens). generally better handling of surrounding objects. - Plug 'haya14busa/incsearch.vim' " Show search result-highlights whilst typing the query + "Plug 'haya14busa/incsearch.vim' " Show search result-highlights whilst typing the query Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } " Fuzzy file opener, use: :FZF or :FZF! for fullscreen Plug 'junegunn/fzf.vim' @@ -63,6 +65,8 @@ call plug#begin('~/.vim/plugged') Plug 'LnL7/vim-nix' + Plug 'kien/rainbow_parentheses.vim' + Plug 'ap/vim-css-color' Plug 'pangloss/vim-javascript' " syntax highlighting JS @@ -87,7 +91,6 @@ call plug#begin('~/.vim/plugged') Plug 'mattn/webapi-vim' - Plug 'neoclide/coc.nvim', {'branch': 'release'} " }}} call plug#end() diff --git a/whichkeyConfig.vim b/whichkeyConfig.vim index 2a13139..1f04ff1 100644 --- a/whichkeyConfig.vim +++ b/whichkeyConfig.vim @@ -80,7 +80,8 @@ let g:which_key_map['x'] = { "nnoremap m :WhichKey 'm' autocmd! VimEnter * :unmap ig autocmd! FileType which_key - autocmd! FileType which_key set laststatus=0 noshowmode noruler + autocmd! FileType which_key set laststatus=2 noshowmode noruler \| autocmd! BufLeave set laststatus=2 showmode ruler + set timeoutlen=200