forked from rafi/vim-config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
all.vim
343 lines (292 loc) · 10.6 KB
/
all.vim
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
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
" Plugin Settings
"---------------------------------------------------------
if dein#tap('denite.nvim')
nnoremap <silent><LocalLeader>r :<C-u>Denite -resume -refresh<CR>
nnoremap <silent><LocalLeader>f :<C-u>Denite file_rec<CR>
nnoremap <silent><LocalLeader>b :<C-u>Denite buffer file_old -default-action=switch<CR>
nnoremap <silent><LocalLeader>d :<C-u>Denite directory_rec -default-action=cd<CR>
nnoremap <silent><LocalLeader>v :<C-u>Denite register -buffer-name=register<CR>
xnoremap <silent><LocalLeader>v :<C-u>Denite register -buffer-name=register -default-action=replace<CR>
nnoremap <silent><LocalLeader>l :<C-u>Denite location_list -buffer-name=list<CR>
nnoremap <silent><LocalLeader>q :<C-u>Denite quickfix -buffer-name=list<CR>
nnoremap <silent><LocalLeader>n :<C-u>Denite dein<CR>
nnoremap <silent><LocalLeader>g :<C-u>Denite grep<CR>
nnoremap <silent><LocalLeader>j :<C-u>Denite jump change file_point<CR>
nnoremap <silent><LocalLeader>o :<C-u>Denite outline<CR>
nnoremap <silent><LocalLeader>s :<C-u>Denite session -buffer-name=list<CR>
nnoremap <silent><expr> <LocalLeader>t &filetype == 'help' ? "g\<C-]>" :
\ ":\<C-u>DeniteCursorWord -buffer-name=tag
\ tag:include\<CR>"
nnoremap <silent><expr> <LocalLeader>p &filetype == 'help' ?
\ ":\<C-u>pop\<CR>" : ":\<C-u>Denite -mode=normal jump\<CR>"
nnoremap <silent><LocalLeader>h :<C-u>Denite help<CR>
nnoremap <silent><LocalLeader>m :<C-u>Denite mpc -buffer-name=mpc<CR>
nnoremap <silent><LocalLeader>/ :<C-u>Denite line<CR>
nnoremap <silent><LocalLeader>* :<C-u>DeniteCursorWord line<CR>
nnoremap <silent><LocalLeader>z :<C-u>Denite z<CR>
nnoremap <silent><LocalLeader>; :<C-u>Denite command command_history<CR>
" chemzqm/denite-git
nnoremap <silent> <Leader>gl :<C-u>Denite gitlog:all<CR>
nnoremap <silent> <Leader>gs :<C-u>Denite gitstatus<CR>
nnoremap <silent> <Leader>gc :<C-u>Denite gitbranch<CR>
" Open Denite with word under cursor or selection
nnoremap <silent> <Leader>gf :DeniteCursorWord file_rec<CR>
nnoremap <silent> <Leader>gg :DeniteCursorWord grep<CR>
vnoremap <silent> <Leader>gg
\ :<C-u>call <SID>get_selection('/')<CR>
\ :execute 'Denite grep:::'.@/<CR><CR>
function! s:get_selection(cmdtype)
let temp = @s
normal! gv"sy
let @/ = substitute(escape(@s, '\'.a:cmdtype), '\n', '\\n', 'g')
let @s = temp
endfunction "}}}
endif
if dein#tap('vim-denite-z')
command! -nargs=+ -complete=file Z
\ call denite#start([{'name': 'z', 'args': [<q-args>], {'immediately': 1}}])
endif
if dein#tap('tagbar')
nnoremap <silent> <Leader>o :<C-u>TagbarOpenAutoClose<CR>
" Also use h/l to open/close folds
let g:tagbar_map_closefold = ['h', '-', 'zc']
let g:tagbar_map_openfold = ['l', '+', 'zo']
endif
if dein#tap('nerdtree')
let g:NERDTreeMapOpenSplit = 'sv'
let g:NERDTreeMapOpenVSplit = 'sg'
let g:NERDTreeMapOpenInTab = 'st'
let g:NERDTreeMapOpenInTabSilent = 'sT'
let g:NERDTreeMapUpdirKeepOpen = '<BS>'
let g:NERDTreeMapOpenRecursively = 't'
let g:NERDTreeMapCloseChildren = 'T'
let g:NERDTreeMapToggleHidden = '.'
nnoremap <silent> <LocalLeader>e :<C-u>NERDTreeToggle<CR>
nnoremap <silent> <LocalLeader>a :<C-u>NERDTreeFind<CR>
endif
if dein#tap('neosnippet.vim')
imap <expr><C-o> neosnippet#expandable_or_jumpable()
\ ? "\<Plug>(neosnippet_expand_or_jump)" : "\<ESC>o"
xmap <silent><C-s> <Plug>(neosnippet_register_oneshot_snippet)
smap <silent>L <Plug>(neosnippet_jump_or_expand)
xmap <silent>L <Plug>(neosnippet_expand_target)
endif
if dein#tap('emmet-vim')
autocmd MyAutoCmd FileType html,css,jsx,javascript,javascript.jsx
\ EmmetInstall
\ | imap <buffer> <C-Return> <Plug>(emmet-expand-abbr)
endif
if dein#tap('vim-operator-surround')
map <silent>sa <Plug>(operator-surround-append)
map <silent>sd <Plug>(operator-surround-delete)
map <silent>sr <Plug>(operator-surround-replace)
nmap <silent>saa <Plug>(operator-surround-append)<Plug>(textobj-multiblock-i)
nmap <silent>sdd <Plug>(operator-surround-delete)<Plug>(textobj-multiblock-a)
nmap <silent>srr <Plug>(operator-surround-replace)<Plug>(textobj-multiblock-a)
endif
if dein#tap('vim-operator-replace')
xmap p <Plug>(operator-replace)
endif
if dein#tap('vim-operator-flashy')
map y <Plug>(operator-flashy)
nmap Y <Plug>(operator-flashy)$
endif
if dein#tap('vim-niceblock')
xmap I <Plug>(niceblock-I)
xmap A <Plug>(niceblock-A)
endif
if dein#tap('accelerated-jk')
nmap <silent>j <Plug>(accelerated_jk_gj)
nmap <silent>k <Plug>(accelerated_jk_gk)
endif
if dein#tap('vim-edgemotion')
map gj <Plug>(edgemotion-j)
map gk <Plug>(edgemotion-k)
xmap gj <Plug>(edgemotion-j)
xmap gk <Plug>(edgemotion-k)
endif
if dein#tap('vim-quickhl')
nmap <Leader>, <Plug>(quickhl-manual-this)
xmap <Leader>, <Plug>(quickhl-manual-this)
endif
if dein#tap('vim-sidemenu')
nmap <Leader>l <Plug>(sidemenu)
xmap <Leader>l <Plug>(sidemenu-visual)
endif
if dein#tap('vim-indent-guides')
nmap <silent><Leader>ti :<C-u>IndentGuidesToggle<CR>
endif
if dein#tap('vim-bookmarks')
nmap ma :<C-u>cgetexpr bm#location_list()<CR>
\ :<C-u>Denite quickfix -buffer-name=list<CR>
nmap mn <Plug>BookmarkNext
nmap mp <Plug>BookmarkPrev
nmap mm <Plug>BookmarkToggle
nmap mi <Plug>BookmarkAnnotate
endif
if dein#tap('committia.vim')
let g:committia_hooks = {}
function! g:committia_hooks.edit_open(info)
imap <buffer><C-d> <Plug>(committia-scroll-diff-down-half)
imap <buffer><C-u> <Plug>(committia-scroll-diff-up-half)
setlocal winminheight=1 winheight=1
resize 10
startinsert
endfunction
endif
if dein#tap('python_match.vim')
nmap <buffer> {{ [%
nmap <buffer> }} ]%
endif
if dein#tap('goyo.vim')
nnoremap <Leader>G :Goyo<CR>
endif
if dein#tap('vim-peekaboo')
nnoremap <buffer> <silent> " :<c-u>call peekaboo#peek(v:count1, 'quote', 0)<cr>
xnoremap <buffer> <silent> " :<c-u>call peekaboo#peek(v:count1, 'quote', 1)<cr>
nnoremap <buffer> <silent> @ :<c-u>call peekaboo#peek(v:count1, 'replay', 0)<cr>
inoremap <buffer> <silent> <c-r> <c-o>:call peekaboo#peek(1, 'ctrl-r', 0)<cr>
endif
if dein#tap('vimwiki')
nnoremap <silent> <Leader>W :<C-u>VimwikiIndex<CR>
endif
if dein#tap('vim-choosewin')
nmap - <Plug>(choosewin)
nmap <Leader>- :<C-u>ChooseWinSwapStay<CR>
endif
if dein#tap('jedi-vim')
let g:jedi#completions_command = ''
let g:jedi#documentation_command = 'K'
let g:jedi#goto_command = '<C-]>'
let g:jedi#goto_assignments_command = '<leader>g'
let g:jedi#rename_command = '<Leader>r'
let g:jedi#usages_command = '<Leader>n'
endif
if dein#tap('tern_for_vim')
autocmd MyAutoCmd FileType javascript,jsx,javascript.jsx
\ nnoremap <silent><buffer> K :<C-u>TernDoc<CR>
\| nnoremap <silent><buffer> <C-]> :<C-u>TernDef<CR>
\| nnoremap <silent><buffer> <leader>g :<C-u>TernType<CR>
\| nnoremap <silent><buffer> <leader>n :<C-u>TernRefs<CR>
\| nnoremap <silent><buffer> <leader>r :<C-u>TernRename<CR>
endif
if dein#tap('vim-gitgutter')
nmap <Leader>hj <Plug>GitGutterNextHunk
nmap <Leader>hk <Plug>GitGutterPrevHunk
nmap <Leader>hs <Plug>GitGutterStageHunk
nmap <Leader>hr <Plug>GitGutterUndoHunk
nmap <Leader>hp <Plug>GitGutterPreviewHunk
endif
if dein#tap('vim-go')
autocmd MyAutoCmd FileType go
\ nmap <C-]> <Plug>(go-def)
\ | nmap <Leader>god <Plug>(go-describe)
\ | nmap <Leader>goc <Plug>(go-callees)
\ | nmap <Leader>goC <Plug>(go-callers)
\ | nmap <Leader>goi <Plug>(go-info)
\ | nmap <Leader>gom <Plug>(go-implements)
\ | nmap <Leader>gos <Plug>(go-callstack)
\ | nmap <Leader>goe <Plug>(go-referrers)
\ | nmap <Leader>gor <Plug>(go-run)
\ | nmap <Leader>gov <Plug>(go-vet)
endif
if dein#tap('phpcomplete-extended')
autocmd MyAutoCmd FileType php
\ nmap <silent> <unique> K <Plug>(phpcomplete-extended-doc)
\ | nmap <silent> <unique> <C-]> <Plug>(phpcomplete-extended-goto)
\ | nmap <silent> <unique> <Leader>a <Plug>(phpcomplete-extended-add-use)
endif
if dein#tap('vimagit')
nnoremap <silent> mg :Magit<CR>
" autocmd MyAutoCmd FileType magit
" \ nnoremap <silent><buffer> <CR> za
endif
if dein#tap('vim-easygit')
nnoremap <silent> <leader>gd :Gdiff<CR>
nnoremap <silent> <leader>gD :Gdiffoff<CR>
nnoremap <silent> <leader>gc :Gcommit<CR>
nnoremap <silent> <leader>gb :Gblame<CR>
nnoremap <silent> <leader>gB :Gbrowse<CR>
nnoremap <silent> <leader>gS :Gstatus<CR>
nnoremap <silent> <leader>gp :Gpush<CR>
endif
if dein#tap('undotree')
nnoremap <Leader>gu :UndotreeToggle<CR>
endif
if dein#tap('vim-online-thesaurus')
nnoremap <silent> <Leader>K :<C-u>OnlineThesaurusCurrentWord<CR>
endif
if dein#tap('vim-asterisk')
map * <Plug>(asterisk-g*)
map g* <Plug>(asterisk-*)
map # <Plug>(asterisk-g#)
map g# <Plug>(asterisk-#)
map z* <Plug>(asterisk-z*)
map gz* <Plug>(asterisk-gz*)
map z# <Plug>(asterisk-z#)
map gz# <Plug>(asterisk-gz#)
endif
if dein#tap('vim-expand-region')
xmap v <Plug>(expand_region_expand)
xmap V <Plug>(expand_region_shrink)
endif
if dein#tap('sideways.vim')
nnoremap <silent> m" :SidewaysJumpLeft<CR>
nnoremap <silent> m' :SidewaysJumpRight<CR>
omap <silent> a, <Plug>SidewaysArgumentTextobjA
xmap <silent> a, <Plug>SidewaysArgumentTextobjA
omap <silent> i, <Plug>SidewaysArgumentTextobjI
xmap <silent> i, <Plug>SidewaysArgumentTextobjI
endif
if dein#tap('splitjoin.vim')
let g:splitjoin_join_mapping = ''
let g:splitjoin_split_mapping = ''
nmap sj :SplitjoinJoin<CR>
nmap sk :SplitjoinSplit<CR>
endif
if dein#tap('linediff.vim')
vnoremap ,df :Linediff<CR>
vnoremap ,da :LinediffAdd<CR>
nnoremap ,ds :<C-u>LinediffShow<CR>
nnoremap ,dr :<C-u>LinediffReset<CR>
endif
if dein#tap('dsf.vim')
nmap dsf <Plug>DsfDelete
nmap csf <Plug>DsfChange
endif
if dein#tap('vim-commentary')
xmap <Leader>v <Plug>Commentary
nmap <Leader>v <Plug>CommentaryLine
xmap gc <Plug>Commentary
nmap gc <Plug>Commentary
omap gc <Plug>Commentary
nmap gcc <Plug>CommentaryLine
nmap cgc <Plug>ChangeCommentary
nmap gcu <Plug>Commentary<Plug>Commentary
endif
if dein#tap('vim-easymotion')
nmap ss <Plug>(easymotion-s2)
nmap sd <Plug>(easymotion-s)
nmap sf <Plug>(easymotion-overwin-f)
map sh <Plug>(easymotion-linebackward)
map sl <Plug>(easymotion-lineforward)
" map sj <Plug>(easymotion-j)
" map sk <Plug>(easymotion-k)
map s/ <Plug>(easymotion-sn)
omap s/ <Plug>(easymotion-tn)
map sn <Plug>(easymotion-next)
map sp <Plug>(easymotion-prev)
endif
if dein#tap('vim-textobj-multiblock')
omap <silent> ab <Plug>(textobj-multiblock-a)
omap <silent> ib <Plug>(textobj-multiblock-i)
xmap <silent> ab <Plug>(textobj-multiblock-a)
xmap <silent> ib <Plug>(textobj-multiblock-i)
endif
if dein#tap('vim-textobj-function')
omap <silent> af <Plug>(textobj-function-a)
omap <silent> if <Plug>(textobj-function-i)
xmap <silent> af <Plug>(textobj-function-a)
xmap <silent> if <Plug>(textobj-function-i)
endif
" vim: set ts=2 sw=2 tw=80 noet :