TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Your problem with Vim is that you don't grok vi

417 pointsby ez77over 13 years ago
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>

20 comments

dionidiumover 13 years ago
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.
评论 #2913272 未加载
评论 #2916069 未加载
评论 #2915099 未加载
eftpotrmover 13 years ago
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.
评论 #2912516 未加载
评论 #2913030 未加载
评论 #2912397 未加载
评论 #2912438 未加载
评论 #2912355 未加载
评论 #2912671 未加载
评论 #2914061 未加载
评论 #2914330 未加载
评论 #2912657 未加载
评论 #2912917 未加载
评论 #2912532 未加载
评论 #2913004 未加载
评论 #2913481 未加载
评论 #2912359 未加载
评论 #2912673 未加载
Triumvarkover 13 years ago
&#62; 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.'
评论 #2912312 未加载
评论 #2913069 未加载
评论 #2912444 未加载
JulianMorrisonover 13 years ago
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.
评论 #2912676 未加载
评论 #2912876 未加载
评论 #2912562 未加载
评论 #2912499 未加载
评论 #2913195 未加载
评论 #2912536 未加载
jodohertyover 13 years ago
This is one of the reasons I wish all standard text controls came with an optional VI mode.
评论 #2912257 未加载
评论 #2912005 未加载
评论 #2912701 未加载
freddealmeidaover 13 years ago
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.
评论 #2913294 未加载
评论 #2916231 未加载
评论 #2913103 未加载
binaryjohnover 13 years ago
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?
评论 #2914718 未加载
swahover 13 years ago
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.
评论 #2914076 未加载
scarmigover 13 years ago
I wonder how much kvetching could have been avoided simply by making Vim open up in insert mode.
评论 #2913050 未加载
评论 #2913115 未加载
评论 #2913063 未加载
评论 #2913038 未加载
评论 #2913433 未加载
评论 #2916234 未加载
s00pcanover 13 years ago
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).
评论 #2913098 未加载
methodinover 13 years ago
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.
JoshTriplettover 13 years ago
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.
sceleratover 13 years ago
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.
snorkelover 13 years ago
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.
评论 #2912720 未加载
评论 #2912542 未加载
评论 #2913109 未加载
CmdrKroolover 13 years ago
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 &#60;Backspace&#62;) or act on the succeeding chars (thus, delete with C-d or &#60;Delete&#62;). 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.
评论 #2913857 未加载
评论 #2915163 未加载
评论 #2914038 未加载
hackermomover 13 years ago
I think most people's problem with vim and vi is that they just don't feel like crossing the river to get their water.
评论 #2912555 未加载
dramaticus3over 13 years ago
&#62; A sampling of more advanced tricks<p>I don't do tricks.
评论 #2912001 未加载
评论 #2912304 未加载
sabatover 13 years ago
Actually it's just that I'm not a fan of editor modes.
funkahover 13 years ago
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>"
评论 #2912558 未加载
评论 #2915636 未加载
Tloewaldover 13 years ago
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.
评论 #2912434 未加载
评论 #2912489 未加载
评论 #2912350 未加载
评论 #2913251 未加载
评论 #2912483 未加载
评论 #2916279 未加载