-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.mappings-surround.vim
47 lines (43 loc) · 1.44 KB
/
init.mappings-surround.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
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""" Init {{{1
" These might be more convenient than the default vim-surround
" Source: https://www.reddit.com/r/vim/comments/yporwp/my_anal_vimsurround_alternative/
nmap <silent> yS( viWS(
nmap <silent> yS) viWS)
nmap <silent> yS[ viWS[
nmap <silent> yS] viWS]
nmap <silent> yS{ viWS{
nmap <silent> yS} viWS}
nmap <silent> yS< viWS<
nmap <silent> yS> viWS>
nmap <silent> yS" viWS"
nmap <silent> yS' viWS'
" Some markdown ones
nmap <silent> yS` viWS`
nmap <silent> yS_ viWS_
" NOTE: these 3 are tested in vim, IdeaVim, and VSCodeVim. Don't use `gv`
nmap <silent> yS* diWi**<C-r>-**<Esc>
nmap <silent> yS= diWi==<C-r>-==<Esc>
nmap <silent> ySw diWi[[<C-r>-]]<Esc>
nmap <silent> ys( viwS(
nmap <silent> ys) viwS)
nmap <silent> ys[ viwS[
nmap <silent> ys] viwS]
nmap <silent> ys{ viwS{
nmap <silent> ys} viwS}
nmap <silent> ys< viwS<
nmap <silent> ys> viwS>
nmap <silent> ys" viwS"
nmap <silent> ys' viwS'
" Some markdown ones
nmap <silent> ys` viwS`
nmap <silent> ys_ viwS_
" NOTE: these 3 are tested in vim, IdeaVim, and VSCodeVim. Don't use `gv`
nmap <silent> ys* diwi**<C-r>-**<Esc>
nmap <silent> ys= diwi==<C-r>-==<Esc>
nmap <silent> ysw diwi[[<C-r>-]]<Esc>
" NOTE: these 3 are tested in vim, IdeaVim, and VSCodeVim. `gv` used in other
" ways would act inconsistently in all 3.
vmap <silent> s* di**<C-r>-**<Esc>gv4l
vmap <silent> s= di==<C-r>-==<Esc>gv4l
vmap <silent> sw di[[<C-r>-]]<Esc>gv4l