From 35c9342414f8c4f2baeca77117500a6e7ce38679 Mon Sep 17 00:00:00 2001 From: humphreylin Date: Thu, 22 Aug 2019 08:42:33 +0800 Subject: add a lot of config of vim plugs --- .bashrc | 2 ++ .vimrc | 44 +++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/.bashrc b/.bashrc index 88507f9..b65626c 100644 --- a/.bashrc +++ b/.bashrc @@ -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 diff --git a/.vimrc b/.vimrc index 5b8fafc..a1cc85f 100644 --- a/.vimrc +++ b/.vimrc @@ -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 nnoremap n :bn @@ -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 :NERDTreeToggle +" 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 = '' +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 :call asyncrun#quickfix_toggle(6) + -- cgit v1.2.3