feat(neovim): add fix for vim-surround
This commit is contained in:
parent
63e5929131
commit
511f115f65
|
@ -99,6 +99,7 @@ in
|
||||||
];
|
];
|
||||||
extraConfig = with builtins;
|
extraConfig = with builtins;
|
||||||
readFile ./init.vim +
|
readFile ./init.vim +
|
||||||
|
readFile ./vim-surround-fix.vim +
|
||||||
readFile ./which-key.vim +
|
readFile ./which-key.vim +
|
||||||
readFile ./coc.vim;
|
readFile ./coc.vim;
|
||||||
# readFile ./lsp.vim;
|
# readFile ./lsp.vim;
|
||||||
|
|
22
home/editors/vim-surround-fix.vim
Normal file
22
home/editors/vim-surround-fix.vim
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
" fix for vim-surround in neovim
|
||||||
|
" https://github.com/tpope/vim-surround/issues/272
|
||||||
|
|
||||||
|
let g:surround_no_mappings = 1
|
||||||
|
|
||||||
|
function! SurroundOp(char)
|
||||||
|
if v:operator ==# 'd'
|
||||||
|
return "\<plug>D" . a:char . "urround"
|
||||||
|
elseif v:operator ==# 'c'
|
||||||
|
return "\<plug>C" . a:char . "urround"
|
||||||
|
elseif v:operator ==# 'y'
|
||||||
|
return "\<plug>Y" . a:char . "urround"
|
||||||
|
endif
|
||||||
|
return ''
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
omap <expr> s '<esc>'.SurroundOp('s')
|
||||||
|
omap <expr> S '<esc>'.SurroundOp('S')
|
||||||
|
|
||||||
|
imap <C-S> <Plug>Isurround
|
||||||
|
imap <C-G>s <Plug>Isurround
|
||||||
|
imap <C-G>S <Plug>ISurround
|
Loading…
Reference in a new issue