Adventures in vim

Vim is my text editor of choice.  (emacs users, commence flaming!)  Yesterday I discovered ip and today I discovered Control-O.  Best shortcuts ever!

ip selects the current paragraph, delimited by blank lines unless you set the modes otherwise.  I used to select whole paragraphs with {y}, which copied extra lines and lost my cursor position.  Now I can copy with yip, which grabs just the paragraph text and keeps the cursor firmly planted.  Fantastic!  See :help object-select for more.

Control-O is a get-out-of-insert-mode-free card.  When inserting, hit Control-O and you’ll be back in command mode for the duration of one command.  That can be a colon or immediate command.  For example, <Ctrl-O>f, will jump you forward to the next comma — without leaving insert mode.  Esc, w or f or / or what have you, i has been my everyday for years. I am thrilled about saving one keystroke per such action times ~1e100 actions over my vimming life. More at :help ins-special-special.

Stay tuned for more adventures in vim!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s