forked from rafi/vim-config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
all.vim
302 lines (258 loc) · 9.27 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
" Plugin Keyboard-Mappings
" ---
if dein#tap('fern.vim')
nnoremap <LocalLeader>e <cmd>Fern -toggle -drawer .<CR>
nnoremap <LocalLeader>a <cmd>Fern -reveal=% -drawer .<CR>
endif
if dein#tap('symbols-outline.nvim')
nnoremap <Leader>o <cmd>SymbolsOutline<CR>
endif
if dein#tap('vim-vsnip')
imap <expr><C-l> vsnip#available(1) ? '<Plug>(vsnip-expand-or-jump)' : '<C-l>'
smap <expr><C-l> vsnip#available(1) ? '<Plug>(vsnip-expand-or-jump)' : '<C-l>'
endif
if dein#tap('emmet-vim')
autocmd user_events FileType html,css,vue,javascript,javascriptreact,svelte
\ EmmetInstall
" \ | imap <silent><buffer> <C-y> <Plug>(emmet-expand-abbr)
endif
if dein#tap('vim-sandwich')
nmap <silent> sa <Plug>(operator-sandwich-add)
xmap <silent> sa <Plug>(operator-sandwich-add)
omap <silent> sa <Plug>(operator-sandwich-g@)
nmap <silent> sd <Plug>(operator-sandwich-delete)<Plug>(operator-sandwich-release-count)<Plug>(textobj-sandwich-query-a)
xmap <silent> sd <Plug>(operator-sandwich-delete)
nmap <silent> sr <Plug>(operator-sandwich-replace)<Plug>(operator-sandwich-release-count)<Plug>(textobj-sandwich-query-a)
xmap <silent> sr <Plug>(operator-sandwich-replace)
nmap <silent> sdb <Plug>(operator-sandwich-delete)<Plug>(operator-sandwich-release-count)<Plug>(textobj-sandwich-auto-a)
nmap <silent> srb <Plug>(operator-sandwich-replace)<Plug>(operator-sandwich-release-count)<Plug>(textobj-sandwich-auto-a)
omap ir <Plug>(textobj-sandwich-auto-i)
xmap ir <Plug>(textobj-sandwich-auto-i)
omap ab <Plug>(textobj-sandwich-auto-a)
xmap ab <Plug>(textobj-sandwich-auto-a)
omap is <Plug>(textobj-sandwich-query-i)
xmap is <Plug>(textobj-sandwich-query-i)
omap as <Plug>(textobj-sandwich-query-a)
xmap as <Plug>(textobj-sandwich-query-a)
endif
if dein#tap('vim-niceblock')
silent! xmap I <Plug>(niceblock-I)
silent! xmap gI <Plug>(niceblock-gI)
silent! 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')
nmap gj <Plug>(edgemotion-j)
nmap gk <Plug>(edgemotion-k)
xmap gj <Plug>(edgemotion-j)
xmap gk <Plug>(edgemotion-k)
endif
if dein#tap('vim-quickhl')
nmap <Leader>mt <Plug>(quickhl-manual-this)
xmap <Leader>mt <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 <Leader>ti <cmd>IndentGuidesToggle<CR>
endif
if dein#tap('nvim-bqf')
nmap <Leader>q <cmd>lua require('user').qflist.toggle()<CR>
endif
if dein#tap('goto-preview')
nnoremap gpd <cmd>lua require('goto-preview').goto_preview_definition()<CR>
nnoremap gpi <cmd>lua require('goto-preview').goto_preview_implementation()<CR>
nnoremap gpc <cmd>lua require('goto-preview').close_all_win()<CR>
nnoremap gpr <cmd>lua require('goto-preview').goto_preview_references()<CR>
endif
if dein#tap('committia.vim')
let g:committia_hooks = {}
function! g:committia_hooks.edit_open(info)
resize 10
imap <buffer><C-d> <Plug>(committia-scroll-diff-down-half)
imap <buffer><C-u> <Plug>(committia-scroll-diff-up-half)
imap <buffer><C-f> <Plug>(committia-scroll-diff-down-page)
imap <buffer><C-b> <Plug>(committia-scroll-diff-up-page)
imap <buffer><C-j> <Plug>(committia-scroll-diff-down)
imap <buffer><C-k> <Plug>(committia-scroll-diff-up)
endfunction
endif
if dein#tap('vim-shot-f')
nmap f <Plug>(shot-f-f)
nmap F <Plug>(shot-f-F)
nmap t <Plug>(shot-f-t)
nmap T <Plug>(shot-f-T)
xmap f <Plug>(shot-f-f)
xmap F <Plug>(shot-f-F)
xmap t <Plug>(shot-f-t)
xmap T <Plug>(shot-f-T)
omap f <Plug>(shot-f-f)
omap F <Plug>(shot-f-F)
omap t <Plug>(shot-f-t)
omap T <Plug>(shot-f-T)
endif
if dein#tap('todo-comments.nvim')
nnoremap <LocalLeader>dt <cmd>TodoTelescope<CR>
endif
if dein#tap('trouble.nvim')
nnoremap <leader>e <cmd>TroubleToggle document_diagnostics<CR>
nnoremap <leader>r <cmd>TroubleToggle workspace_diagnostics<CR>
nnoremap <leader>xq <cmd>TroubleToggle quickfix<CR>
nnoremap <leader>xl <cmd>TroubleToggle loclist<CR>
nnoremap ]t <cmd>lua require("trouble").next({skip_groups = true, jump = true})<CR>
nnoremap [t <cmd>lua require("trouble").previous({skip_groups = true, jump = true})<CR>
nnoremap gR <cmd>TroubleToggle lsp_references<CR>
endif
if dein#tap('diffview.nvim')
nnoremap <Leader>gv <cmd>DiffviewOpen<CR>
endif
if dein#tap('vimwiki')
nnoremap <Leader>W <cmd>VimwikiIndex<CR>
endif
if dein#tap('vim-choosewin')
nmap - <Plug>(choosewin)
nmap <Leader>- <cmd>ChooseWinSwapStay<CR>
endif
if dein#tap('neogit')
nnoremap <Leader>mg <cmd>Neogit<CR>
endif
if dein#tap('gina.vim')
nnoremap <silent> <leader>ga <cmd>Gina add %:p<CR>
nnoremap <silent> <leader>gd <cmd>Gina compare<CR>
nnoremap <silent> <leader>gc <cmd>Gina commit<CR>
nnoremap <silent> <leader>gb <cmd>Gina blame --width=40<CR>
nnoremap <silent> <leader>gs <cmd>Gina status -s<CR>
nnoremap <silent> <leader>gl <cmd>Gina log --graph --all<CR>
nnoremap <silent> <leader>gF <cmd>Gina! fetch<CR>
nnoremap <silent> <leader>gp <cmd>Gina! push<CR>
nnoremap <silent> <leader>go <cmd>,Gina browse :<CR>
xnoremap <silent> <leader>go :Gina browse :<CR>
endif
if dein#tap('zen-mode.nvim')
nnoremap <silent> <Leader>z <cmd>ZenMode<CR>
endif
if dein#tap('rest.nvim')
nmap <silent> ,ht <Plug>RestNvim
endif
if dein#tap('any-jump.vim')
" Normal mode: Jump to definition under cursor
nnoremap <silent> <leader>ii <cmd>AnyJump<CR>
" Visual mode: jump to selected text in visual mode
xnoremap <silent> <leader>ii <cmd>AnyJumpVisual<CR>
" Normal mode: open previous opened file (after jump)
nnoremap <silent> <leader>ib <cmd>AnyJumpBack<CR>
" Normal mode: open last closed search window again
nnoremap <silent> <leader>il <cmd>AnyJumpLastResults<CR>
endif
if dein#tap('undotree')
nnoremap <Leader>gu <cmd>UndotreeToggle<CR>
endif
if dein#tap('thesaurus_query.vim')
nnoremap <silent> <Leader>K <cmd>ThesaurusQueryReplaceCurrentWord<CR>
endif
if dein#tap('vim-asterisk')
nmap * <Plug>(asterisk-g*)
nmap g* <Plug>(asterisk-*)
nmap # <Plug>(asterisk-g#)
nmap g# <Plug>(asterisk-#)
xmap * <Plug>(asterisk-g*)
xmap g* <Plug>(asterisk-*)
xmap # <Plug>(asterisk-g#)
xmap g# <Plug>(asterisk-#)
nmap z* <Plug>(asterisk-z*)
nmap gz* <Plug>(asterisk-gz*)
nmap z# <Plug>(asterisk-z#)
nmap gz# <Plug>(asterisk-gz#)
xmap z* <Plug>(asterisk-z*)
xmap gz* <Plug>(asterisk-gz*)
xmap z# <Plug>(asterisk-z#)
xmap gz# <Plug>(asterisk-gz#)
endif
if dein#tap('nvim-ts-hint-textobject')
omap am <cmd>lua require('tsht').nodes()<CR>
xnoremap <silent> am :lua require('tsht').nodes()<CR>
endif
if dein#tap('sideways.vim')
nnoremap <silent> <, <cmd>SidewaysLeft<CR>
nnoremap <silent> >, <cmd>SidewaysRight<CR>
nnoremap <silent> [, <cmd>SidewaysJumpLeft<CR>
nnoremap <silent> ], <cmd>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')
nmap sj <cmd>SplitjoinJoin<CR>
nmap sk <cmd>SplitjoinSplit<CR>
endif
if dein#tap('linediff.vim')
xnoremap <Leader>mdf :Linediff<CR>
xnoremap <Leader>mda :LinediffAdd<CR>
nnoremap <Leader>mds <cmd>LinediffShow<CR>
nnoremap <Leader>mdr <cmd>LinediffReset<CR>
endif
if dein#tap('dsf.vim')
nmap dsf <Plug>DsfDelete
nmap csf <Plug>DsfChange
endif
if dein#tap('caw.vim')
function! InitCaw() abort
if &l:modifiable && &buftype ==# '' && &filetype != 'gitrebase'
xmap <buffer> <Leader>V <Plug>(caw:wrap:toggle)
nmap <buffer> <Leader>V <Plug>(caw:wrap:toggle)
xmap <buffer> <Leader>v <Plug>(caw:hatpos:toggle)
nmap <buffer> <Leader>v <Plug>(caw:hatpos:toggle)
nmap <buffer> gc <Plug>(caw:prefix)
xmap <buffer> gc <Plug>(caw:prefix)
nmap <buffer> gcc <Plug>(caw:hatpos:toggle)
xmap <buffer> gcc <Plug>(caw:hatpos:toggle)
else
silent! nunmap <buffer> <Leader>V
silent! xunmap <buffer> <Leader>V
silent! nunmap <buffer> <Leader>v
silent! xunmap <buffer> <Leader>v
silent! nunmap <buffer> gc
silent! xunmap <buffer> gc
silent! nunmap <buffer> gcc
silent! xunmap <buffer> gcc
endif
endfunction
autocmd user_events FileType * call InitCaw()
call InitCaw()
endif
if dein#tap('fin.vim')
nnoremap <Leader>f :<C-u>Fin<CR>
function! InitFin() abort
cmap <buffer><nowait> <Tab> <Plug>(fin-line-next)
cmap <buffer><nowait> <S-Tab> <Plug>(fin-line-prev)
cmap <buffer><nowait> <C-j> <Plug>(fin-line-next)
cmap <buffer><nowait> <C-k> <Plug>(fin-line-prev)
endfunction
autocmd user_events FileType fin call InitFin()
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
if dein#tap('coc.nvim')
noremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
" use <tab> for trigger completion and navigate to the next complete item
function! s:check_back_space() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~ '\s'
endfunction
inoremap <silent><expr> <Tab>
\ pumvisible() ? "\<C-n>" :
\ <SID>check_back_space() ? "\<Tab>" :
\ coc#refresh()
endif