tags:

views:

228

answers:

2

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?

+1  A: 

Start vim, enter insert mode, and type:

"Hello, world!"

Press esc to get back to normal mode, and go left at least once, now press cs"' and it'll change to:

'Hello, world!'

(I just installed surround and tried this exactly, Ubuntu-packaged vim 7.2 with my own .vimrc and plugins, but nothing that should affect this.)

Roger Pate
Note: I'm relatively new to vim and Just Use It(tm) to Get Shit Done(tm), so I might be off on a few terms, such as "normal mode" might really be "command mode" here.
Roger Pate
+1  A: 

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 )

chiggsy
When I'm in normal mode I type cs and the cursor goes to the bottom left of vim's window and after that I can't type anymore. I can only type more if I type ":" first
janoChen