Two Vim tricks

in

I'm a long-time vi/vim user and occasionally kick myself for not knowing it better. In a way it dates back to my first UNIX days when the dozen or so basic vi commands were your bread and butter across *NIX variants, which varied so widely that knowing more vi than that could bite you at the one moment when you were trying to recover partitions or whatnot on a strange box where they only had the wrong kind of vi (or am I making that up?). In the past year I've become an all-day-all-the-time vim user and finally started forcing myself to use more features and to begin to tune a vimrc. I know it's started to take because the first thing I do when I set up a new machine or account anywhere is to scp down my vimrc from other hosts.

Today I learned about the '*' command and omni completion with ctrl-n. Tomorrow they will be indispensable. Why on earth did I not find these sooner? If you use Vim and don't know about them, go learn them. If you use Vim and do know about them, how come you didn't tell me sooner? If you don't use Vim, well, I love you, too.

Omni completion details found via amik.dk while watching Bram Moolenaar's 7 Habits talk which I found via TWID #30.

Trackback URL for this post:

http://onebiglibrary.net/trackback/263

vim tricks

Note that ctrl-p and ctrl-n are plain old completion whereas omni completion is ctrl-x ctrl-o [0]. Completion I can't live without; I'm still not sure about omni completion.

Speaking of vim discoveries, a big one for me recently is block commenting [1].

[0] http://vimdoc.sourceforge.net/htmldoc/usr_24.html#24.3
[1] http://breaksalot.org/vimcomment

very useful, thanks!

Ah, took me a few times, but I get it now. Super useful. Thanks, Gabe!

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <pre> <code> <img> <ul> <ol> <li> <dl> <dt> <dd> <blockquote> <form> <input> <span> <object> <embed> <br>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <apache>, <bash>, <css>, <diff>, <dot>, <java>, <javascript>, <mysql>, <perl>, <php>, <python>, <rails>, <ruby>, <sql>, <xml>. Beside the tag style "<foo>" it is also possible to use "[foo]".

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
6 + 4 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.
Syndicate content

This site is Copyright (c) 2005-2008 by Daniel Chudnov. All rights reserved.

All opinions stated here are my own, and do not reflect those of my employer.