""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Important: " This requries that you install https://github.com/amix/vimrc ! " """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""" " => Load pathogen paths """""""""""""""""""""""""""""" let s:vim_runtime = expand(':p:h')."/.." call pathogen#infect(s:vim_runtime.'/sources_forked/{}') call pathogen#infect(s:vim_runtime.'/sources_non_forked/{}') call pathogen#infect(s:vim_runtime.'/my_plugins/{}') call pathogen#helptags() """""""""""""""""""""""""""""" " => bufExplorer plugin """""""""""""""""""""""""""""" let g:bufExplorerDefaultHelp=0 let g:bufExplorerShowRelativePath=1 let g:bufExplorerFindActive=1 let g:bufExplorerSortBy='name' map o :BufExplorer """""""""""""""""""""""""""""" " => MRU plugin """""""""""""""""""""""""""""" let MRU_Max_Entries = 400 map f :MRU """""""""""""""""""""""""""""" " => YankStack """""""""""""""""""""""""""""" let g:yankstack_yank_keys = ['y', 'd'] nmap yankstack_substitute_older_paste nmap yankstack_substitute_newer_paste """""""""""""""""""""""""""""" " => CTRL-P """""""""""""""""""""""""""""" let g:ctrlp_working_path_mode = 0 let g:ctrlp_map = '' map j :CtrlP map :CtrlPBuffer let g:ctrlp_max_height = 20 let g:ctrlp_custom_ignore = 'node_modules\|^\.DS_Store\|^\.git\|^\.coffee' """""""""""""""""""""""""""""" " => ZenCoding """""""""""""""""""""""""""""" " Enable all functions in all modes let g:user_zen_mode='a' """""""""""""""""""""""""""""" " => snipMate (beside support ) """""""""""""""""""""""""""""" ino =snipMate#TriggerSnippet() snor i=snipMate#TriggerSnippet() """""""""""""""""""""""""""""" " => Vim grep """""""""""""""""""""""""""""" let Grep_Skip_Dirs = 'RCS CVS SCCS .svn generated' set grepprg=/bin/grep\ -nH """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Nerd Tree """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " let g:NERDTreeWinPos = "right" let g:NERDTreeWinPos = "left" let NERDTreeShowHidden=1 let NERDTreeIgnore = ['\.pyc$', '__pycache__'] let g:NERDTreeWinSize=40 map nn :NERDTreeToggle map nb :NERDTreeFromBookmark map nf :NERDTreeFind """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => vim-multiple-cursors """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" let g:multi_cursor_use_default_mapping=0 " Default mapping let g:multi_cursor_start_word_key = '' let g:multi_cursor_select_all_word_key = '' let g:multi_cursor_start_key = 'g' let g:multi_cursor_select_all_key = 'g' let g:multi_cursor_next_key = '' let g:multi_cursor_prev_key = '' let g:multi_cursor_skip_key = '' let g:multi_cursor_quit_key = '' """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => surround.vim config " Annotate strings with gettext """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" vmap Si S(i_f) au FileType mako vmap Si S"i${ _(2f"a) } """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => lightline """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" let g:lightline = { \ 'colorscheme': 'wombat', \ } let g:lightline = { \ 'colorscheme': 'wombat', \ 'active': { \ 'left': [ ['mode', 'paste'], \ ['fugitive', 'readonly', 'filename', 'modified'] ], \ 'right': [ [ 'lineinfo' ], ['percent'] ] \ }, \ 'component': { \ 'readonly': '%{&filetype=="help"?"":&readonly?"🔒":""}', \ 'modified': '%{&filetype=="help"?"":&modified?"+":&modifiable?"":"-"}', \ 'fugitive': '%{exists("*fugitive#head")?fugitive#head():""}' \ }, \ 'component_visible_condition': { \ 'readonly': '(&filetype!="help"&& &readonly)', \ 'modified': '(&filetype!="help"&&(&modified||!&modifiable))', \ 'fugitive': '(exists("*fugitive#head") && ""!=fugitive#head())' \ }, \ 'separator': { 'left': ' ', 'right': ' ' }, \ 'subseparator': { 'left': ' ', 'right': ' ' } \ } """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Vimroom """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" let g:goyo_width=100 let g:goyo_margin_top = 2 let g:goyo_margin_bottom = 2 nnoremap z :Goyo """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Vim-go """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" let g:go_fmt_command = "goimports" let g:go_highlight_types = 1 let g:go_highlight_functions = 1 let g:go_highlight_function_calls = 1 let g:go_highlight_operators = 1 let g:go_highlight_extra_types = 1 let g:go_highlight_build_constraints = 1 let g:go_highlight_generate_tags = 1 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Syntastic (syntax checker) """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" ""始终开启标志列 let g:ale_set_highlights = 1 let g:ale_set_signs = 1 let g:ale_sign_column_always = 1 " let g:ale_sign_column_always = 1 " let g:ale_set_highlights = 0 "自定义error和warning图标 let g:ale_sign_error = '✗' let g:ale_sign_warning = '⚡ ' ""在vim自带的状态栏中整合ale let g:ale_statusline_format = ['✗ %d', '⚡ %d', '✔ OK'] "显示Linter名称,出错或警告等相关信息 let g:ale_echo_msg_error_str = 'E' let g:ale_echo_msg_warning_str = 'W' let g:ale_echo_msg_format = '[%linter%] [%severity%] %s %code: %%s' ""普通模式下,sp前往上一个错误或警告,sn前往下一个错误或警告 nmap sp (ale_previous_wrap) nmap sn (ale_next_wrap) "s触发/关闭语法检查 "nmap s :ALEToggle ""d查看错误或警告的详细信息 nmap d :ALEDetail " Set this. Airline will handle the rest. let g:airline#extensions#ale#enabled = 1 let g:airline#extensions#tabline#formatter = 'default' let g:airline#extensions#tabline#left_sep = ' ' let g:airline#extensions#tabline#left_alt_sep = '|' let g:airline_theme='dark' " Enable completion where available. " let g:ale_completion_enabled = 1 let g:ale_completion_delay = 500 let g:ale_echo_delay = 20 let g:ale_lint_delay = 500 let g:ale_c_parse_compile_commands=1 " 离开 insert 模式的时候运行 linter let g:ale_lint_on_insert_leave = 1 let g:ale_c_cppcheck_options = '--enable=all' let g:ale_cpp_cppcheck_options = '--enable=all' let g:ale_linters_explicit = 1 let g:ale_lint_on_insert_leave = 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_linters = { \ 'make': ['make', 'checkmake'], \ 'cmake': ['cmake', 'cmakelint'], \ 'c': ['c', "gcc", "clangd", "cppcheck", "clang"], \ 'cpp': ['cpp', "gcc", "clangd", "clang", "cppcheck", "cpplint"], \ 'javascript': ['jshint'], \ 'python': ['flake8'], \ 'go': ['go', 'golangserver', 'go vet', 'golint', 'errcheck'] \} nmap a (ale_next_wrap) " Disabling highlighting let g:ale_set_highlights = 0 " Only run linting when saving the file let g:ale_lint_on_text_changed = 'never' let g:ale_lint_on_enter = 0 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Git gutter (Git diff) """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" let g:gitgutter_enabled=1 nnoremap d :GitGutterToggle """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Tagbar (TagbarToggle) """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" nmap :TagbarToggle nnoremap tt :TagbarToggle """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => gotests-vim """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" let g:gotests_bin = s:vim_runtime.'/bin/gotests'