Inspired by a comment [1] made today by kaylarose. It points to a most useful list of resources [2].<p><pre><code> [1] http://news.ycombinator.com/item?id=2910991
[2] https://github.com/carlhuda/janus</code></pre>
One thing I think a lot of the naysayers here are missing is that you don't sit down and read a book on vim -- or even this stackoverflow answer -- and immediately expect to begin using all you've learned. It takes time. And it's painful at first. But it's a lot like gripping a tennis racket correctly or properly positioning your fingers at a piano. Your default method is indubitably the most comfortable -- by definition -- but the payoff of attempting the more difficult path can be likened to the magic of compound interest.
Flame suit on, but I <i>really</i> don't understand the appeal.<p>I have reams of arcane bits of information to commit to memory already. .Net in two languages plus VB6 for legacy code. SQL in more dialects than I care to list, each with their own quirks and limitations. HTML and JavaScript. XML and various associated technologies like XPath. That's just professionally; once I go home I can add in photography and music straight off with others at different levels.<p>There's only so many things one can usefully commit to memory (edit - yes, I meant <i>am prepared to dedicate the time to committing to memory</i>); odd bits are just easier to look up. So why, exactly, should I voluntarily use a text editor whose interface was already far behind the state of the art when I started school?<p>:q!. I've had others try to persuade me of the joys and power of vi; I'm not even slightly convinced and that is the one command I'm committing to memory.
> I've often done things iteratively and interactively that could probably have been done more efficiently if I'd taken the time to think out the correct incantation.<p>Maybe not. Efficiency is a measure of the time it takes accomplish something. 'Puzzling out how' can sometimes be a more relevant bottleneck than 'number of keystrokes.'
My problem with Vim is that it can't be configured to validate and <i>correctly</i> complete code in realtime (except by mad-science brain grafts like eclim). Note that ctags style word completion is like 1% of enough. The important thing is that code is either <i>visibly wrong</i> (red squigglies) or <i>visibly syntactically valid</i> (no red squigglies). That massively cuts down the contribution of trivial typos to bug hunting. And to do it requires a full parse and analysis of the language being edited, going on in the background as you type.<p>Without that, Vim is reduced to a quick hacks editor, or an editor for languages where no realtime parse is possible.
Interestingly emacs seems to be popular in Japan (where I'm based) but I always preferred Vim. Though it is rather complex.<p>Interestingly if you want to do any Japanese text editing, most IDE's or editors fail horribly. I almost always find myself falling back to Vim.<p>Mind you, I really like textmate. Sadly, it sucks at Japanese. And will for the time being.
It's great to see all the vimmers on this thread. One question, WHERE are all you guys? I work at a very large corp. and I am hard pressed to find another vimmer when it comes to discussing the beauty/elegance/purity of vi at the water cooler. May be we need a secret handshake or nod?
I wonder if the set of folks discussing here is completely different from the set of folks that saw Notch (Minecraft creator) coding on the weekend. Everyone seemed to agree he was very productive developing his game inside Eclipse.
Is it a good or bad sign that I'm starting to see a lot of stories repeat on here? I installed Ubuntu on my work machine last friday and I was just looking at this earlier this morning (I had saved this the last time it was posted).
It took me far too long to really start using vim. I have to say, though, that as an avid user now I find it really annoying to find dw yy p :q and :w in the other editors I have to use on other machines. It does take discipline, though, but it is really FUN. How awesome is it to find some really sweet new key combination you didn't know existed? I almost never seek out the obscure settings of newer IDEs yet I often randomly search out new key combinations for vim. Love it.
This article captures the one thing about vim that took me the longest to "get", and which proved the most powerful once I did: vim has a rich set of movement commands, and a pile of commands which operate on those movement commands. Putting the two together gives a huge set of useful commands with a simple two-part form.
I have been enjoying using Vico for the past month or so, a pretty Mac face on vi, with extras like support for Textmate Bundles. The mac-ness of the interface helped me through some vi adjustment rough spots, and now I'm extremely comfortable doing almost everything the vi way.
Yes, I get it: some hackers of lore kept adding magic commands to the unix line editor until it grew into a stand-alone editor. Still doesn't appeal to me. Too many arcane keystrokes to do simple edits.
A thing that nobody ever seems to mention which unsettles me far more than learning key commands or modal behaviour in my brief tryouts with Vim is how its cursor visually highlights a current <i>character</i> rather than a point <i>between</i> characters like every other editor I've ever used.<p>Say I have a line as follows:<p><pre><code> abcdef
</code></pre>
In other editors:<p><pre><code> to delete "abc" from the left:
put the cursor on the a
C-d C-d C-d
to delete "abc" from the right:
put the cursor on the character after the c (the d)
C-h C-h C-h
to delete "def" from the left:
put the cursor on the d
C-d C-d C-d
to delete "def" from the right:
put the cursor on the character after the f (the EOL)
C-h C-h C-h
</code></pre>
Symmetrical and consistent, to my mind.<p>In Vim:<p><pre><code> to delete "abc" from the left:
put the cursor before the a
xxx
to delete "abc" from the right:
put the cursor on the character after the c (the d)
XXX
to delete "def" from the left:
put the cursor on the d
xxx
to delete "def" from the right:
put the cursor on the f
xxx
</code></pre>
The last case there is exceptional. It's a small thing, but not being able to put the cursor on a real or virtual 'end-of-line' character in Vim makes me feel constricted.<p>I think that the <i>between</i> chars cursor model is simpler because you then have two choices: act on the preceding chars (thus, delete with C-h or <Backspace>) or act on the succeeding chars (thus, delete with C-d or <Delete>). By contrast Vim is more complicated because from the current <i>character</i> you have three choices: act on the preceding chars (thus, delete with X), act on the current char (thus, delete with x), and the principle of 'completeness' suggests a third: act on the succeeding chars - which AFAIK is not available in Vim and so it feels lop-sided to me.<p>Ironically I think that it's my 'programmer head' which makes the <i>between</i> chars model appeal to me more, as I think of the file as a bunch of bytes (well, maybe multibyte characters) and the text editor as a glorified hex editor, and I just want to choose a position and insert or delete chars regardless of whether they're alphanumeric, LFs, or whatever. Whereas Vim's model of manipulating words, lines and sentences suggests to me a fit with people writing in human languages. Why, non-geeks should love Vim, perhaps except for all the key commands to learn; one imagines an alternate universe where the common keyboard evolved with two Return keys instead of one, labelled "Open new line above" and "Open new line below", and other Vim-inspired niceties - and I wonder whether your archetypal 'grandmother' might find it easier to write letters on the computer in that world than her current futzing about in Microsoft Word.
Why should I have to grok a text editor? Up, down, left and right should get me around and if they don't, I'm not the one who's wrong.<p>"You guys just don't <i>understand</i> why I eat dirt. I'm on a higher plane of existence and <i>you just don't get it.</i>"
Good post, and worth reading if you're stuck with vim and don't like it.<p>But, reading this reminds me of how much I like GUIs. Yup these movements are great. I get the appeal of turning selecting text into a dumb programming trick, I'm sure it makes you feel very clever and productive. Of course I can do all this stuff and more without even consciously thinking about it using a mouse.<p>Go do multi file grep in BBedit in front of an emacs jock one day. Look what I can do by finding a menu item!<p>Douglas Adams used to talk about how powerful formatting features in word processors were a great way to procrastinate.