-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc.plug
276 lines (197 loc) · 6.75 KB
/
vimrc.plug
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
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
call plug#begin('~/.vim/plugged')
Plug 'tpope/vim-repeat'
" Enhanced terminal integration
Plug 'wincent/terminus'
" toggle, display and navigate marks
Plug 'kshenoy/vim-signature'
" toggle the display of the quickfix list and the location-list
" Plug 'Valloric/ListToggle'
" Change code right in the quickfix window
Plug 'stefandtw/quickfix-reflector.vim'
" read man page
Plug 'bruno-/vim-man'
" work better for neovim {{{1
if has("nvim")
Plug 'benekastah/neomake'
Plug 'critiqjo/lldb.nvim', { 'do': 'nvim +UpdateRemotePlugins' }
endif
" }}}
" Edit assistant {{{1
" pay attention on motion in gc{motion}, e.g. gcw, gcap
Plug 'tomtom/tcomment_vim'
Plug 'bkad/CamelCaseMotion'
omap <silent> iw <Plug>CamelCaseMotion_iw
xmap <silent> iw <Plug>CamelCaseMotion_iw
" provides mappings to easily delete, change and add such surroundings in pairs
Plug 'tpope/vim-surround'
" Easy text exchange operator
Plug 'tommcdo/vim-exchange'
" provides insert mode auto-completion for quotes, parens, brackets, etc.
Plug 'Raimondi/delimitMate'
" https://github.com/terryma/vim-multiple-cursors
" see example gif and keystrokes
Plug 'terryma/vim-multiple-cursors'
" }}}
" code {{{1
" Syntax checking hacks
Plug 'scrooloose/syntastic'
" displaying thin vertical lines at each indentation level for code indented
" with spaces. patching font to get better visual
Plug 'Yggdroot/indentLine'
" JSON manipulation and pretty printing
Plug 'tpope/vim-jdaddy', { 'for': 'json' }
" Golang {{{2
"
" :GoInstallBinaries/GoUpdateBinaries to install/update godef, gocode etc
Plug 'fatih/vim-go', { 'do': 'vim +GoInstallBinaries +qall' }
" workable for vim and mvim
let g:go_bin_path=expand("~/.gocode/bin")
" Show type info for the word under your cursor
let g:go_auto_type_info=1
" Enable goimports to automatically insert import paths instead of gofmt
let g:go_fmt_command = "goimports"
" Disable auto fmt on save:
" let g:go_fmt_autosave = 0
" }}}
" Javascript and HTML {{{2
" javascript auto-completition based on Tern
" Tern uses .tern-project files to configure loading libraries and plugins for
" a project. See the Tern docs for details
Plug 'marijnh/tern_for_vim', { 'do': 'npm install' }
" JavaScript Parameter Complete
Plug 'othree/jspc.vim'
" Vastly improved Javascript indentation and syntax
Plug 'pangloss/vim-javascript'
" ultisnips is alternative
" Plug 'mattn/emmet-vim'
" Browserlink is a live browser editing plugin for Vim
" Plug 'jaxbot/brolink.vim'
" }}}
" YCM and Ultisnips {{{2
"
Plug 'Valloric/YouCompleteMe', { 'do': './install.py --clang-completer --gocode-completer' }
let g:ycm_confirm_extra_conf = 0
" autocmd FileType c nnoremap <buffer> <silent> <C-]> :YcmCompleter GoTo<cr>
" read identifiers from tags file
let g:ycm_collect_identifiers_from_tags_files=1
let g:ycm_add_preview_to_completeopt = 1
" let g:ycm_autoclose_preview_window_after_insertion = 1
let g:ycm_key_list_select_completion = ['<Tab>']
" vim-snippets depends on ultisnips
Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets'
let g:UltiSnipsListSnippets= "<c-u>" "work under insermode
let g:UltiSnipsExpandTrigger = '<c-j>'
let g:UltiSnipsJumpForwardTrigger = '<c-j>'
let g:UltiSnipsJumpBackwardTrigger = '<c-k>'
let g:snips_author="Michael Zhu <[email protected]>"
let g:snips_author_email="[email protected]"
"}}}
" tagbar {{{2
Plug 'majutsushi/tagbar'
let g:tagbar_left=1
let g:tagbar_autofocus=1
nmap <leader>t :TagbarOpenAutoClose<CR>
" }}}
" }}}
" Tmux & Airline {{{1
Plug 'bling/vim-airline'
let g:airline_powerline_fonts = 1
Plug 'christoomey/vim-tmux-navigator'
" Just start vim inside of tmux. airline's colors will be applied to tmux's
" statusline
Plug 'edkolev/tmuxline.vim'
" }}}
" easy-align {{{1
Plug 'junegunn/vim-easy-align'
" Start interactive EasyAlign in visual mode (e.g. vip<Enter>)
" wildfire also use Enter by default
vmap <Enter> <Plug>(EasyAlign)
" Start interactive EasyAlign for a motion/text object (e.g. <Leader>aip)
nmap <Leader>a <Plug>(EasyAlign)
"}}}
" Git {{{1
" airline depents on it optionaly
" Gbrowser depens on instaweb settings, on MAC, it recommneds:
" git config --global instaweb.httpd webrick
" git config --global instaweb.browser open
Plug 'tpope/vim-fugitive'
" shows a git diff in the gutter (sign column) and stages/reverts hunks.
Plug 'airblade/vim-gitgutter'
" }}}
" CtrlP {{{1
" Fast CtrlP matcher based on python
Plug 'FelikZ/ctrlp-py-matcher'
let g:ctrlp_match_func = { 'match': 'pymatcher#PyMatch' }
Plug 'tacahiroy/ctrlp-funky'
nnoremap <Leader>ff :CtrlPFunky<Cr>
Plug 'kien/ctrlp.vim'
"'r' - the nearest ancestor that contains one of these directories or files:
" .git .hg .svn .bzr _darcs
" a' - like c, but only if the current working directory outside of CtrlP is not
" a direct ancestor of the directory of the current file.
let g:ctrlp_working_path_mode = 'ra'
if executable('ag') " The Silver Searcher
let s:ctrlp_fallback = 'ag %s --nocolor -l -g ""'
" ag is fast enough that CtrlP doesn't need to cache
let g:ctrlp_use_caching = 0
elseif executable('find')
let s:ctrlp_fallback = 'find %s -type f'
else " Window OS
let s:ctrlp_fallback = 'dir %s /-n /b /s /a-d'
endif
"Use %s in place of the target directory
let g:ctrlp_user_command = {
\ 'types': {
\ 1: ['.git', 'cd %s && git ls-files . --cached --exclude-standard --others'],
\ 2: ['.hg', 'hg --cwd %s locate -i .'],
\ },
\ 'fallback': s:ctrlp_fallback
\ }
" Exclude files and directories using Vim's wildignore and g:ctrlp_custom_ignore
let g:ctrlp_custom_ignore = {
\ 'dir': '\v[\/]\.(git|hg|svn)$',
\ 'file': '\v\.(exe|so|dll)$',
\ }
nmap <leader><space> :CtrlPBuffer<cr>
" }}}
" Undotree {{{1
Plug 'mbbill/undotree'
nnoremap <leader>u :UndotreeToggle<CR>
let g:undotree_SetFocusWhenToggle=1
" }}}
" color scheme and highlight {{{1
" colorscheme
Plug 'morhetz/gruvbox'
Plug 'fatih/molokai'
Plug 'ap/vim-css-color'
" all trailing whitespace characters (spaces and tabs)
" :StripWhitespace --- clean whitespace painless
Plug 'ntpeters/vim-better-whitespace'
" showing different levels of parentheses in different colors
Plug 'luochen1990/rainbow'
let g:rainbow_active = 1
" }}}
" search {{{1
"
Plug 'haya14busa/incsearch.vim'
" automatically tuner off highlight
let g:incsearch#auto_nohlsearch = 1
map / <Plug>(incsearch-forward)
map ? <Plug>(incsearch-backward)
map n <Plug>(incsearch-nohl-n)
map N <Plug>(incsearch-nohl-N)
map * <Plug>(incsearch-nohl-*)
map # <Plug>(incsearch-nohl-#)
map g* <Plug>(incsearch-nohl-g*)
map g# <Plug>(incsearch-nohl-g#)
Plug 'dyng/ctrlsf.vim'
map <leader>/ :CtrlSF<Space>
noremap K :CtrlSF "\b<C-R><C-W>\b"<CR>
" }}}
" autoload .vimrc.plug
au! bufwritepost .vimrc.plug source ~/.vimrc.plug
if filereadable(expand("~/.vimrc.plug.local"))
source ~/.vimrc.plug.local
endif
call plug#end()
" vim: set foldlevel=0 foldmethod=marker: