Thursday, September 20, 2012

VIM hints

I need a page for keeping vim hints.  This is that page.

The stuff I use every day,  j/k  h/l  etc are easy to remember but the following stuff I just don't do often enough to have it bound to my fingertips.

Indent a block:

tag and use the > key.

:.,''a >

note: works in both directions.  (as in < )

You can indent x lines by doing x<< or x>>

Joining lines:

It's easy to join a line with the shift-J key, however that inserts a space (after trimming any additional spaces in the joined line.

Using the command:   gJ will join and not insert spaces.  ( g  then J ).



No comments:

Post a Comment