diff --git a/home/editors/neovim.nix b/home/editors/neovim.nix index b9af97f..c398228 100644 --- a/home/editors/neovim.nix +++ b/home/editors/neovim.nix @@ -99,6 +99,7 @@ in ]; extraConfig = with builtins; readFile ./init.vim + + readFile ./vim-surround-fix.vim + readFile ./which-key.vim + readFile ./coc.vim; # readFile ./lsp.vim; diff --git a/home/editors/vim-surround-fix.vim b/home/editors/vim-surround-fix.vim new file mode 100644 index 0000000..464471c --- /dev/null +++ b/home/editors/vim-surround-fix.vim @@ -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 "\D" . a:char . "urround" + elseif v:operator ==# 'c' + return "\C" . a:char . "urround" + elseif v:operator ==# 'y' + return "\Y" . a:char . "urround" + endif + return '' +endfunction + +omap s ''.SurroundOp('s') +omap S ''.SurroundOp('S') + +imap Isurround +imap s Isurround +imap S ISurround