re: Vim for starters - the minimum you need to know VIEW POST

VIEW FULL DISCUSSION
 

You missed the truly best feature of vim, the i directive.

Say you have this code:

function(foo, bar) {
  // some stuff
}

To select the entire params list, with the cursor in command mode and inside of the params type:

vi(

Now you can copy it or what ever

To select the entire function body

vi{

Better yet, you may want to redefine the param list:

ci(

Which deletes the params and switches you into insert mode

And finally say you are editing some HTML,

<p>Delete this message</p>

You can use:

cit

To clear everything inside of a tag.

 
code of conduct - report abuse