diff --git a/vim/.vimrc b/vim/.vimrc index 775fb75..a59508f 100755 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -49,6 +49,11 @@ colorscheme happy_hacking " Turn on the Wild menu set wildmenu +set wildmode=list:longest + + +" +set updatetime=300 " Ignore compiled files set wildignore=*.o,*~,*.pyc @@ -76,3 +81,8 @@ source ~/.vim/config/filetypes.vim " Transparency hi Normal guibg=NONE ctermbg=NONE + +" Prevent accidental writes to buffers that shouldn't be edited +autocmd BufRead *.orig set readonly +autocmd BufRead *.pacnew set readonly +set nofoldenable diff --git a/vim/config/keybindings.vim b/vim/config/keybindings.vim index c72dc14..269ee6e 100644 --- a/vim/config/keybindings.vim +++ b/vim/config/keybindings.vim @@ -55,3 +55,6 @@ nmap :TagbarToggle " Rmarkdown autocmd Filetype rmd nmap :w\|:!echo"require(rmarkdown);render('%')"\|R--vanilla autocmd Filetype rmd imap :w\|:!echo"require(rmarkdown);render('%')"\|R--vanilla + +map +imap diff --git a/vim/config/pluginconfig.vim b/vim/config/pluginconfig.vim index 5ea58ad..00e7dfd 100644 --- a/vim/config/pluginconfig.vim +++ b/vim/config/pluginconfig.vim @@ -151,6 +151,9 @@ augroup end xmap a (coc-codeaction-selected) nmap a (coc-codeaction-selected) +" Implement methods for trait +nnoremap i :call CocActionAsync('codeAction', '', 'Implement missing members') + " Remap for do codeAction of current line nmap ac (coc-codeaction) " Fix autofix problem of current line @@ -198,3 +201,9 @@ nnoremap p :CocListResume " Open Tagbar autocmd VimEnter * nested :call tagbar#autoopen(1) +" Open NerdTREE +autocmd VimEnter * NERDTree | wincmd p + +" If another buffer tries to replace NERDTree, put it in the other window, and bring back NERDTree. +autocmd BufEnter * if bufname('#') =~ 'NERD_tree_\d\+' && bufname('%') !~ 'NERD_tree_\d\+' && winnr('$') > 1 | + \ let buf=bufnr() | buffer# | execute "normal! \w" | execute 'buffer'.buf | endif diff --git a/vim/config/plugins.vim b/vim/config/plugins.vim index 882d925..5f271c8 100644 --- a/vim/config/plugins.vim +++ b/vim/config/plugins.vim @@ -4,34 +4,47 @@ call plug#begin('~/.vim/plugged') Plug 'roxma/vim-hug-neovim-rpc' Plug 'roxma/nvim-yarp' +Plug 'andymass/vim-matchup' + +" Accept .editorconfig +Plug 'editorconfig/editorconfig-vim' + " Miscellaneous Plugins -" Deoplete Source -Plug 'Shougo/neco-vim' -" Multiuse- tab key -" Plug 'ervandew/supertab' + " Airline style status bar Plug 'vim-airline/vim-airline' Plug 'vim-airline/vim-airline-themes' + " Highlight and fix trailing whitespace Plug 'ntpeters/vim-better-whitespace' + " Yank History Cycling on meta-[shift]-p Plug 'maxbrunsfeld/vim-yankstack' + " Auto indent Plug 'yggdroot/indentline' + " Python folding Plug 'tmhedberg/simpylfold' + " Update folding less often Plug 'Konfekt/fastfold' + " Use FZF for browsing vim buffers Plug 'junegunn/fzf.vim' + " Markdown support Plug 'plasticboy/vim-markdown' + " Window resizing c-w [<>-+=_|] Plug 'roxma/vim-window-resize-easy' + " Regex highlighting and in buffer live replacement Plug 'markonm/traces.vim' + " Better comments Plug 'scrooloose/nerdcommenter' + " Work on brackets in pairs Plug 'jiangmiao/auto-pairs' @@ -41,15 +54,13 @@ Plug 'jistr/vim-nerdtree-tabs' Plug 'Xuyuanp/nerdtree-git-plugin' Plug 'ryanoasis/vim-devicons' -Plug 'junegunn/goyo.vim' - " Compilers Plug 'xuhdev/singlecompile' " Autocomplete -" Plug 'Shougo/deoplete.nvim' -" Plug 'zchee/deoplete-jedi' Plug 'neoclide/coc.nvim', {'tag': '*', 'branch': 'release'} +Plug 'neoclide/coc-snippets' +Plug 'honza/vim-snippets' " Coc extensions Plug 'Maxattax97/coc-ccls' @@ -70,7 +81,12 @@ Plug 'udalov/kotlin-vim' Plug 'xuhdev/vim-latex-live-preview' Plug 'pearofducks/ansible-vim' Plug 'justinmk/vim-syntax-extra' -" Plug 'rhysd/vim-clang-format' +" Rust +Plug 'timonv/vim-cargo' +Plug 'rust-lang/rust.vim' + +Plug 'cespare/vim-toml' + " Git integration Plug 'airblade/vim-gitgutter' @@ -83,6 +99,5 @@ Plug 'godlygeek/tabular' Plug 'plasticboy/vim-markdown' Plug 'majutsushi/tagbar' -Plug 'rust-lang/rust.vim' call plug#end()