diff options
author | humphreylin <[email protected]> | 2019-08-22 08:42:33 +0800 |
---|---|---|
committer | humphreylin <[email protected]> | 2019-08-22 08:42:33 +0800 |
commit | 35c9342414f8c4f2baeca77117500a6e7ce38679 (patch) | |
tree | 46c170cdae04cb60a555ead8ed732c1fa024a829 | |
parent | 1b0da2ad9057aeda24db44b22a667c182016f134 (diff) | |
download | dotfiles-35c9342414f8c4f2baeca77117500a6e7ce38679.tar.gz dotfiles-35c9342414f8c4f2baeca77117500a6e7ce38679.tar.bz2 dotfiles-35c9342414f8c4f2baeca77117500a6e7ce38679.zip |
add a lot of config of vim plugs
-rw-r--r-- | .bashrc | 2 | ||||
-rw-r--r-- | .vimrc | 44 |
2 files changed, 45 insertions, 1 deletions
@@ -129,6 +129,8 @@ alias gaa='git add --all' alias gc='git commit -v' alias gp='git push' +alias cd..='cd ..' + # autojump if [ ! -d /usr/share/autojump ]; then sudo apt install autojump @@ -32,6 +32,16 @@ set wildmode=longest:list,full set backspace=indent,eol,start +" change default directory +let s:vim_swapfiles_dir = expand('~/.vim/.swp/') +if !isdirectory(s:vim_swapfiles_dir) + silent! call mkdir(s:vim_swapfiles_dir, 'p') +endif +set directory=~/.vim/.swp// + +" tags +set tags=./.tags;,.tags + " mapping let mapleader=',' " change the key <leader> nnoremap <leader>n :bn<CR> @@ -51,8 +61,11 @@ Plug 'vim-airline/vim-airline' Plug 'vim-airline/vim-airline-themes' Plug 'flazz/vim-colorschemes' Plug 'junegunn/fzf', {'dir': '~/.fzf', 'do': './install --all'} -Plug 'scrooloose/nerdtree' +Plug 'scrooloose/nerdtree', {'on': 'NERDTreeToggle'} Plug 'rdnetto/YCM-Generator', {'branch': 'stable'} +Plug 'ludovicchabant/vim-gutentags' +Plug 'junegunn/vim-easy-align' +Plug 'skywind3000/asyncrun.vim' call plug#end() " Plugin config @@ -61,3 +74,32 @@ colorscheme molokai let g:airline='molokai' let g:airline#extensions#tabline#enabled = 1 map <C-n> :NERDTreeToggle<CR> +" YouCompleteMe +let g:ycm_add_preview_to_completeopt = 0 +let g:ycm_show_dignostics_ui = 0 +let g:ycm_server_log_level = 'info' +let g:ycm_min_num_identifier_candidate_chars = 2 +let g:ycm_collect_identifier_from_comments_and_strings = 1 +let g:ycm_complete_in_strings = 1 +let g:ycm_key_invoke_completion = '<c-z>' +let g:ycm_semantic_triggers = { + \ 'c,cpp,python,java,go,erlang,perl': ['re!\w{2}'], + \ 'cs,lua,javascript': ['re!\w{2}'], + \ } +" vim-gutentags +let g:gutentags_project_root = ['.root', '.svn', '.git', '.hg', '.project'] +let g:gutentags_ctags_tagfile = '.tags' +let s:vim_tags = expand('~/.cache/tags') +let g:gutentags_cache_dir = s:vim_tags +let g:gutentags_ctags_extra_args = ['--fields=+niazS', '--extra=+q'] +let g:gutentags_ctags_extra_args = ['--c++-kinds=+px'] +let g:gutentags_ctags_extra_args = ['--c-kinds=+px'] +if !isdirectory(s:vim_tags) + silent! call mkdir(s:vim_tags, 'p') +endif +" asyncrun.vim +let g:asyncrun_open = 6 " the number of lines of quickfix window +let g:asyncrun_bell = 1 " the bell rings when the task is done +" use f10 to open/close asyncrun quickfix window +nnoremap <F10> :call asyncrun#quickfix_toggle(6)<cr> + |