From 06929ba11c0ef83da2462f60ee8c6dc07a2aa9a4 Mon Sep 17 00:00:00 2001 From: gxlin Date: Tue, 16 Mar 2021 10:42:48 +0800 Subject: Split .vimrc to multiple vimscript files --- .vimrc | 108 ++--------------------------------------------------------------- 1 file changed, 2 insertions(+), 106 deletions(-) (limited to '.vimrc') diff --git a/.vimrc b/.vimrc index 21f9983..092ea6b 100644 --- a/.vimrc +++ b/.vimrc @@ -77,111 +77,7 @@ nnoremap n :bn nnoremap p :bp nnoremap d :bd -" Plugin -if empty(glob('~/.vim/autoload/plug.vim')) - silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs - \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim - autocmd VimEnter * PlugInstall --sync | source $MYVIMRC +if filereadable(expand('~/.dotfiles/.vim/init.vim')) + exec "source " . '~/.dotfiles/.vim/init.vim' endif -call plug#begin('~/.vim/plugged') -Plug 'Valloric/YouCompleteMe', {'do': 'python3 ./install.py --clangd-completer'} -Plug 'vim-airline/vim-airline' -Plug 'vim-airline/vim-airline-themes' -Plug 'scrooloose/nerdtree', {'on': 'NERDTreeToggle'} -Plug 'ludovicchabant/vim-gutentags' -Plug 'skywind3000/asyncrun.vim' -Plug 'Yggdroot/LeaderF', {'do': './install.sh'} -Plug 'dense-analysis/ale' -Plug 'mhinz/vim-signify' -Plug 'tpope/vim-unimpaired' -Plug 'godlygeek/tabular' -Plug 'ledger/vim-ledger', {'for': 'ledger'} -Plug 'puremourning/vimspector' -Plug 'mileszs/ack.vim' -call plug#end() - -" Plugin config - -let g:airline#extensions#tabline#enabled = 1 -map :NERDTreeToggle - -" YouCompleteMe -let g:ycm_server_log_level = 'info' -let g:ycm_add_preview_to_completeopt = 0 -let g:ycm_show_diagnostics_ui = 0 -let g:ycm_collect_identifiers_from_comments_and_strings = 1 -let g:ycm_complete_in_strings = 1 - -let g:ycm_filetype_whilelist = { - \ "c": 1, "cpp": 1, "sh": 1, "zsh": 1, - \ "python": 1, - \ } - -" vim-gutentags -let g:gutentags_project_root = ['.root', '.svn', '.git', '.hg', '.project'] -let g:gutentags_ctags_tagfile = '.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'] - -" 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) - -" vim-easy-align -xmap ga (EasyAlign) -nmap ga (EasyAlign) - -" LeaderF -" " Show icons, icons are shown by default -let g:Lf_ShowDevIcons = 1 -" For GUI vim, the icon font can be specify like this, for example -let g:Lf_DevIconsFont = "DejaVuSansMono Nerd Font Mono" -let g:Lf_WindowPosition = 'popup' -let g:Lf_ShortcutF = "ff" -noremap fb :=printf("Leaderf buffer %s", "") -noremap fm :=printf("Leaderf mru %s", "") -noremap ft :=printf("Leaderf bufTag %s", "") -noremap fl :=printf("Leaderf line %s", "") -noremap :=printf("Leaderf! rg --current-buffer -e %s ", expand("")) -noremap :=printf("Leaderf! rg -e %s ", expand("")) -" search visually selected text literally -xnoremap gf :=printf("Leaderf! rg -F -e %s ", leaderf#Rg#visual()) -noremap go :Leaderf! rg --recall -let g:Lf_RootMarkers = ['.project', '.root', '.svn', '.git'] - -" ALE -let g:ale_linters_explicit = 1 -let g:ale_completion_delay = 500 -let g:ale_echo_delay = 20 -let g:ale_lint_delay = 500 -let g:ale_echo_msg_format = '[%linter%] %code: %%s' -let g:ale_lint_on_text_changed = 'normal' -let g:ale_lint_on_insert_leave = 1 -let g:airline#extensions#ale#enabled = 1 - -let g:ale_c_gcc_options = '-Wall -O2 -std=c99' -let g:ale_cpp_gcc_options = '-Wall -O2 -std=c++14' -let g:ale_c_cppcheck_options = '' -let g:ale_cpp_cppcheck_options = '' - -let g:ale_sign_error = "\ue009\ue009" -hi! clear SpellBad -hi! clear SpellCap -hi! clear SpellRare -hi! SpellBad gui=undercurl guisp=red -hi! SpellCap gui=undercurl guisp=blue -hi! SpellRare gui=undercurl guisp=magenta - -" Vimspector -let g:vimspector_enable_mappings = 'HUMAN' - -" Ack.vim -if executable('ag') - let g:ackprg = 'ag --vimgrep' -endif -cnoreabbrev Ack Ack! -nnoremap a :Ack! -- cgit v1.2.3