I have downloaded a new version of Tim Pope's surround plugin. I noticed he deprecated 's' in favor of uppercase 'S'.
He said this was to prevent interference with a lot of Vim user's muscle memory for hitting lower-case 's' in visual mode. I did some googling but I can't seem to find what exactly this does?
I'd like to know, just in case there is a good bit of info I should know about that key combo :)
Visual Block Mode of Vim allows us to perform different operations like delete, copy-paste, i.e., yanked and put, etc. To enable the Visual block mode in Vim, you have to try out the “Ctrl+V” command within the normal mode. You can see that the new. txt file has been opened in the Visual Block mode.
If you're in character-wise visual mode, pressing v will exit visual mode. If you're in block-wise visual mode, pressing ctrl-v will exit visual mode.
Press Ctrl+v to enter visual block mode. The words VISUAL BLOCK will appear at the bottom of the screen. Use the Arrow keys to highlight the single character column. You can verify that each task is indented the same amount.
Before pasting into vim, enable paste mode by entering :set paste . Press i to enter insert mode. The status bar should say -- INSERT (paste) -- now. Press the right mouse button to paste in your stuff.
As described in the Vim manual:
{Visual}["x]c or v_c v_s {Visual}["x]s Delete the highlighted text [into register x] and start insert (for {Visual} see Visual-mode). {not in Vi}
So both c and s do the same thing in visual mode.
Also, in general, if you want to know what a key does in something other than normal mode, just prefix the key with the first letter of the mode and a underscore.
For example:
:help v_s
to find out what the s key does in visual mode.
s
does the same thing as x
then i
essentially deleting the currently highlighted character(s) then entering insert mode
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With