tpope / vim-surround

surround.vim: Delete/change/add parentheses/quotes/XML-tags/much more with ease
https://www.vim.org/scripts/script.php?script_id=1697
13.39k stars 444 forks source link

ysiw just goes into insert and types a 'w' #381

Open Christensen-John opened 11 months ago

Christensen-John commented 11 months ago

I've been trying to get this to work. The more basic vim.surround commands work. When I type ys and then follow it with i the i is interpreted as going into insert mode.

Christensen-John commented 11 months ago

Edit, it turns out that it works after I remapped j and k to swap around. Why would remapping those keys affect this command which doesn't use a remapped key?

Here is the remapping I used: noremap k j

noremap <C-w>k <C-w>j

noremap <C-w><C-k> <C-w>j

noremap j k

noremap <C-w>j <C-w>k

noremap <C-w><C-j> <C-w>k

Source: https://superuser.com/a/1742512

I split that onto different lines or else VSCode would not work with the remappings.