aboutsummaryrefslogtreecommitdiff
path: root/.vimrc
diff options
context:
space:
mode:
Diffstat (limited to '.vimrc')
-rw-r--r--.vimrc44
1 files changed, 43 insertions, 1 deletions
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 <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>
+