Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vim's surround plugin usage

Tags:

vim

plugins

I just downloaded vim today.

The surround plugin documentation says:

Press cs"' inside "Hello world!" to change it to 'Hello world!'.

But where am I supposed to press cs"' and in which mode?

like image 535
alexchenco Avatar asked Jan 09 '10 08:01

alexchenco


People also ask

What is IW in vim?

iw means inside word - the entire command reads "yank surround inside word".

What is vim sneak?

Vim-sneak and vim-EasyMotion are a couple of Vim plugins that supercharge how fast you can move in Vim. Both of these plugins need to be enabled via your VSCodeVim settings. To enable them, just go to Preferences, Settings search for vim sneak or vim easymotion and you'll find the switch.


1 Answers

Just downloaded vim? You've made the right choice!

Vim has several modes.

Insert mode is what you use to actually type text. It is not what you use to move around the document ( in vim terms, the 'buffer' ).

After you have typed "Hello world":

hit ESC to go to Command mode.

use the 'hjkl' keys to move the cursor inside the quotes.

then type cs"' to Change Surrounds from " to '

Vim's online help is excellent.

In Command mode, type :help surround to get the help for the plugin

if you see nothing doing that, first try :help helptags , which will tell you how to setup the help files ( surround plugin also has excellent help )

like image 120
chiggsy Avatar answered Oct 14 '22 06:10

chiggsy