-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc.bundles
206 lines (187 loc) · 7 KB
/
vimrc.bundles
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
" =======================
" Vundle插件管理及配置列表
" =======================
"==========初始化==========
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
if g:isunix
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin('~/.vim/bundle')
else
set rtp+=~/vimfiles/bundle/Vundle.vim
call vundle#begin('~/vimfiles/bundle')
endif
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
"==========语言支持==========
" 多语言语法检查
Plugin 'vim-syntastic/syntastic'
" Syntastic uses Location-List rather than QuickFix
" Usage: lop[en], lcl[ose]
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_loc_list_height = 5
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
let g:syntastic_python_checkers = ['flake8']
" Select alternative linters:
":help syntastic-checkers-python
" Syntastic flag embedded in lightline.vim
" Python-format
Plugin 'psf/black'
" Editor integration:
" https://black.readthedocs.io/en/stable/integrations/editors.html
if g:isunix
let g:black_virtualenv = '~/.vim/black'
else
let g:black_virtualenv = '~/vimfiles/black'
endif
augroup black_on_save
autocmd!
autocmd BufWritePre *.py Black
augroup end
" LaTeX-format
Plugin 'lervag/vimtex'
" Vimtex uses QuickFix rather than Location-List
" QuickFix is generated only after :VimtexCompile
" Usage: cope[n], ccl[ose]
let g:vimtex_quickfix_mode = 0
let g:vimtex_compiler_method = 'latexmk'
if g:isunix
let g:vimtex_view_general_viewer = 'okular'
let g:vimtex_view_general_options = '--unique file:@pdf\#src:@line@tex'
" if has('autoservername'), inverse-search can be easily activated.
" see help: vimtex-synctex-inverse-search
else
" Note: There is a known issue with VimTeX + SumatraPDF when you use `xelatex`,
"where the pdf file in SumatraPDF is not refreshed after compilation.
" Reason: latexmk uses xelatex to make an .xdv rather than .pdf file,
"with the .pdf file being created in a separate step.
" default: $xelatex = "xelatex %O %S"
" If %O is part of the command for invoking xelatex,
"then latexmk will insert the [-no-pdf] option automatically,
" Solution: expand %O in rc-file and replace [-no-pdf] option. [Not Recommended!]
let view_exe_path = 'SumatraPDF.exe'
let g:vimtex_view_general_viewer = view_exe_path
let g:vimtex_view_general_options
\ = ' -reuse-instance -forward-search @tex @line @pdf'
\ .. ' -inverse-search "' .. 'cmd /c start /min \"\" '
\ .. '\"' .. exepath(v:progpath) .. '\"'
\ .. ' -v --not-a-term -T dumb -c \"VimtexInverseSearch %l ''%f''\"'
endif
"==========自动补全==========
" 快速注释: [count]<Leader>cc | [count]<Leader>cu
Plugin 'preservim/nerdcommenter'
" 等号或冒号对齐,用于公式排版
Plugin 'godlygeek/tabular'
nmap <Leader>a= :Tabularize /=<CR>
vmap <Leader>a= :Tabularize /=<CR>
nmap <Leader>a: :Tabularize /:<CR>
vmap <Leader>a: :Tabularize /:<CR>
" Using UltiSnips to create snippets
Plugin 'SirVer/ultisnips'
Plugin 'honza/vim-snippets'
let g:UltiSnipsExpandOrJumpTrigger = '<Tab>'
let g:UltiSnipsJumpBackwardTrigger = '<S-Tab>'
" YouCompleteMe
Plugin 'ycm-core/YouCompleteMe'
" (absolute-path)/python3 ./install.py --clangd-completer
let g:ycm_key_list_select_completion = ['<C-n>', '<Down>']
let g:ycm_key_list_previous_completion = ['<C-p>', '<Up>']
let g:ycm_key_list_stop_completion = ['<C-y>', '<CR>', '<Esc>']
"==========功能相关==========
" 更高效的移动 [<Leader><Leader> + w/f]
Plugin 'easymotion/vim-easymotion'
" 文件搜索
Plugin 'ctrlpvim/ctrlp.vim'
let g:ctrlp_map = '<Leader>p'
let g:ctrlp_cmd = 'CtrlP'
map <Leader>f :CtrlPMRU<CR>
let g:ctrlp_custom_ignore = {
\ 'dir': '\v[\/]\.(git|hg|svn|rvm)$',
\ 'file': '\v\.(exe|so|dll|zip|tar|tar.gz)$',
\ }
if g:isunix
set wildignore+=*/tmp/*,*.so,*.swp,*.zip " MacOSX/Linux
else
set wildignore+=*\\tmp\\*,*.swp,*.zip,*.exe " Windows
endif
let g:ctrlp_working_path_mode = 0
let g:ctrlp_match_window = 'bottom,order:ttb,min:1,max:10,results:10'
let g:ctrlp_mruf_max = 250
let g:ctrlp_follow_symlinks = 1
" ctrlp插件 - 不用ctag进行函数快速跳转
Plugin 'tacahiroy/ctrlp-funky'
nnoremap <Leader>fu :CtrlPFunky<Cr>
" narrow the list down with a word under cursor
nnoremap <Leader>fU :execute 'CtrlPFunky ' .. expand('<cword>')<Cr>
let g:ctrlp_funky_syntax_highlight = 1
" Git wrapper
Plugin 'tpope/vim-fugitive'
" Indicator flag embedded in lightline.vim
"==========显示增强==========
" 括号显示增强
Plugin 'kien/rainbow_parentheses.vim'
let g:rbpt_colorpairs = [
\ ['brown', 'RoyalBlue3'],
\ ['Darkblue', 'SeaGreen3'],
\ ['darkgray', 'DarkOrchid3'],
\ ['darkgreen', 'firebrick3'],
\ ['darkcyan', 'RoyalBlue3'],
\ ['darkred', 'SeaGreen3'],
\ ['darkmagenta', 'DarkOrchid3'],
\ ['brown', 'firebrick3'],
\ ['gray', 'RoyalBlue3'],
\ ['black', 'SeaGreen3'],
\ ['darkmagenta', 'DarkOrchid3'],
\ ['Darkblue', 'firebrick3'],
\ ['darkgreen', 'RoyalBlue3'],
\ ['darkcyan', 'SeaGreen3'],
\ ['darkred', 'DarkOrchid3'],
\ ['red', 'firebrick3'],
\ ]
let g:rbpt_max = 40
let g:rbpt_loadcmd_toggle = 0
au VimEnter * RainbowParenthesesToggle
au Syntax * RainbowParenthesesLoadRound
au Syntax * RainbowParenthesesLoadSquare
au Syntax * RainbowParenthesesLoadBraces
" 状态栏插件
Plugin 'itchyny/lightline.vim'
set laststatus=2
let g:lightline = {
\ 'colorscheme': 'wombat',
\ }
let g:lightline.active = {
\ 'left': [ [ 'mode', 'paste' ],
\ [ 'readonly', 'filename', 'modified' ],
\ [ 'syntastic' ],
\ [ 'gitbranch' ] ],
\ }
let g:lightline.component = {
\ 'syntastic': '%#warningmsg#%{SyntasticStatuslineFlag()}',
\ 'gitbranch': '%{FugitiveStatusline()}'
\ }
set noshowmode
" 增加缩进虚线
Plugin 'Yggdroot/indentLine'
let g:indentLine_fileType = ['c', 'cpp', 'python']
"==========完成配置==========
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList - lists configured plugins
" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line
"END