14 ms·
Why, oh why, do those nutheads use vi?
- mammadori 15y agoWhy is that a NEWS? It seems quite old to me.
- AdrianRossouw 15y agoI've been using vi for 10 years and i didn't know about the '.' command. I've been writing macros whenever i needed to do stuff like that.
- manuscreationis 15y agoIt seems quite powerful, but overall vi still overwhelms me with all the options and functionality... I'm trying to learn more about vi/m (and emacs) as I get more into Linux development, but I think a lifetime of Windows has damaged me, mentally
- yogsototh 15y agoIn fact learning vi/m is a lot like learning to play a music instrument. It is a pain to start using vim. But if you reach a certain level you start improving more and more. Concerning vim, it should takes some weeks to be as efficient than with notepad. I written this article which also might help you: http://yannesposito.com/Scratch/en/blog/Learn-Vim-Progressively/ http://yannesposito.com/Scratch/en/blog/Learn-Vim-Progressiv... Don't give up! It will pay faster than you think.
- brooklynite 15y agoI read your article a few days ago, great stuff. I agree vim is a pain in the beginning, and I only recently went to using it full time. But even after two weeks of full time use a lot of the commands are already starting to get "embedded" in my fingers.
- manuscreationis 15y ago"In fact learning vi/m is a lot like learning to play a music instrument." If thats the case, I am screwed
- re_todd 15y agoHonestly, when I was younger, I used to use vim when collaborating with other programmers to impress them, and then use an IDE most of the time when noone was looking. But then something strange happened, I began building up the muscle memory and eventually preferred using vim over an IDE. It seems like every year, if I take the time to learn more about vim, I become twice as effective as the year before. There seem to be an infinite amount of new things to learn, constantly making my life easier. I've been with it 4 years now, and will never go back to an IDE. The coolest thing I learned this year is the '. command, which will go to your last change. So, you can be editing a program/script, run it, and it has an error. Most of the time you want to go back to the last modification, so just type: '. This even works, at least on my system, after closing and re-opening the file. Related to that, you can type g; and g, to go through next/previous modifications.
- techiferous 15y agoI want to meet a dvorak keyboard user who is passionate about vi.
- Lio 15y agoI'm a Colemak user and still really like Vim. I have to do a bit of mapping to get things comfortable but still it works well for me.
- stevelosh 15y agoI've been learning Colemak off and on and am a bit worried about using it with Vim. What mappings do you use (particularly for hjkl)? My first instinct was to map them to something more comfortable, but lots of other apps use those keybindings so I feel like it might be better to just learn to use them as-is.
- dkersten 15y agoI switched to Colemak (and a DAS keyboard) about two and a half months ago. Any details about your mapping that you could share would be appreciated.
- TomasSedovic 15y agoPleasure to meet you. Not sure how much passion you require. I'm not exactly head-over-heels with vim, but I have been using it for about 7 years and dvorak for about 3. Anything in particular you want to ask?
- dasil003 15y agoI imagine the mnemonics make it work reasonably well, but what about hjkl? Do you really get used to having those spread around?
- TomasSedovic 15y agoYeah. Adjusting to typing in Dvorak took me considerably more time and effort that getting used to the new shortcuts. Luckily, Dvorak isn't that bad for this. For instance, 'j' (down arrow) and 'k' (up arrow) are still next to each other, in the same order. 'h' (left arrow) and 'l' (right arrow) are not, but when you have your right hand in the starting position, their location and distance is very similar to where they are on QWERTY. As a side note, it's much harder to type QWERTY on Dvorak. Now, the arrow keys no longer in the same place -- up/down is on the left side of the keyboard whilst left/right is on the right side. But that's not as big a problem as you may think -- provided you keep both your hands on the keyboard. Interestingly, the Kinesis Contoured keyboards [1] have the arrows similarly separated. And there are no "gotchas" where the keys' position would go against the spatial intent. You could imagine a layout that would for instance have ctrl-f (page down) located below ctrl-b (page up) or 'h' (left arrow) on the right side of 'l' (left arrow). But that's not the case in Dvorak neither for vim nor for the emacs keybindings that I'm familiar with (c-b, c-f, c-a, c-e). Sheer dumb luck, methinks. Both under vim and under Gnome in general, I've found that all the shortcuts I'm using aren't that much worse off. Some are actually better. It seems to pretty much balance out. [1]: http://www.kinesis-ergo.com/advantage.htm http://www.kinesis-ergo.com/advantage.htm
- CJefferson 15y agoAt this point, particularly on news.ycombinator, surely the article should be about "Why, oh WHY, do those #? nutheads not use vi?". It seems a majority of people believe it is better, certainly a majority of the vocal crowd.
- zokier 15y agoI'd be interested to know how much of the stuff presented in the article is actually present in plain vi (not vim). If you mean vim, then say vim, not vi. They are two different things.
- dasil003 15y agoWhat's the biggest OS distribution that does not have vi mapped to vim by default these days?
- adient 15y agoLast time I installed Arch, it did not. Also checking Scientific, it does not (assume also RHEL/CentOS).
- MatthewPhillips 15y agoArch definitely doesn't. sometimes I accidentally type vi and am confused for a few seconds why things dont work right. Luckily an alias will fix it.
- graywh 15y agoIs it a case where vi is a version with the tiny feature set and vim has a larger (huge) feature set?
- telemachos 15y agoSounds reasonable. I was about to guess a similar thing. A minimal Debian install (perhaps Ubuntu and other child-distros as well?) installs a vim-tiny[1], which often throws people off[2]. [1] http://packages.debian.org/squeeze/vim-tiny http://packages.debian.org/squeeze/vim-tiny [2] http://www.google.com/search?client=safari&rls=en&q=site:forums.debian.net+vim-tiny&ie=UTF-8&oe=UTF-8 http://www.google.com/search?client=safari&rls=en&q=...
- brown9-2 15y agoOne of the great things about vim is that even if you use it as your regular editor (I use MacVim), you tend to learn something new every time you read a new article. Today I learned about the '.' command. Also, old discussion on same article: http://news.ycombinator.com/item?id=151637 http://news.ycombinator.com/item?id=151637
- tkellogg 15y agoYeah, I also learned about the -i] commands. Can't believe I didn't know about them before...
- gbog 15y agoYou might like , as well, it repeats the last move.
- qdog 15y agoYeah, I've never used the autoindent command before, either. Oops. Been manually indenting stuff with :<line1>,<line2>,s/^/\t/ for years now, oof.
- jjcm 15y ago= will also indent any selection you have automagically. gg=G will do your whole document, and V[selection]= will give you a selection range to indent. < and > are nice as well for indenting specific amounts in the left or right direction.
- drblast 15y agoDon't ever start using vi. After you do, any text editor that you are forced to use that doesn't have vi key bindings will give you fits and make you cry. Learning vi is your standard process of enlightenment and elation followed by a lifetime of disappointment. Think about how you'd feel if you ate the best meal of your life at age 13, and the restaurant where you ate it went out of business the next day. You'll be frustrated by all other software. You'll wander around trying to explain to other people why the thing you had was so good, and it was so easy, and that nothing else compares, and wouldn't it be great if everyone did things this way. Exactly like the author of this article. You have been warned.
- singular 15y agos/vi/emacs/ ;-)
- Riesling 15y agoI feel your pain. This problem needs to be solved. See my post below[0]. Your input would be appreciated. [0]http://news.ycombinator.com/item?id=3543011 http://news.ycombinator.com/item?id=3543011
- tomjen3 15y agoBut vi has been ported to just about anything, so why wouldn't you use it?
- andrewvc 15y agoI just switched from ViM to emacs (mostly for SLIME) after about 6 years of ViM usage, it wasn't a big deal at all, both are great.
- sjs 15y agoI use TextMate day to day. If I'm not on OS X I use Emacs for making software, and sometimes I use Emacs on OS X. It's great for JavaScript. Though vim is no longer my main editor I still use it every day. Right tool for the job and all that.
- wahnfrieden 15y ago
- dchest 15y agoI use vim for about a year or more, and I like it, however I'm still having trouble with copying and pasting tiny fragments of text. Maybe someone can help me out with this? 1) If I yank a line with yy, pressing P or p will insert the text into a new line. 2) If I go to visual mode and select a region, yank it with y, then press p/P, it gets it inserted into the current line. That is, vim preserves new lines. What I can't figure out is how to paste into the current line in the first case, and, vice-versa, how to easily paste into a new line in the second case (without doing :put, or opening a new line).
- countersixte 15y agoFor #1, the yy command will yank the entire line (including the newline). Try using y$, which will yank from the cursor to the end of the line (not including the newline).
- falcolas 15y agoThis is the simplest way, in my opinion. So simple, that I remapped 'Y' to do exactly that (so it matches the functionality of 'D' and 'C'). map Y y$
- minikomi 15y agoFor the first, you need to do a 0yt$ .. this will yank to endline, but not include it. The whole line can then be pasted into another without breaking it. The 2nd can be o/O<esc>p .. Maybe there's a more elegant way though! You could bind these to, say, <leader>p and <leader>P, if you find yourself doing it a lot.
- graywh 15y ago:h i_ctrl-r That is, i<C-r>0 will paste a line character-wise, but the EOL will still be there, so you might have to join lines afterward. Alternatively, you could not yank the EOL with ^y$. For making a newline with a character-wise yank, use o or O to make the new line and you can use <C-r>0. Or Escape and p.
- austintaylor 15y ago
- boofar 15y agoThere are some video tutorials by Derek Wyatt that have been recommended on HN a few times: http://www.derekwyatt.org/vim/vim-tutorial-videos/ http://www.derekwyatt.org/vim/vim-tutorial-videos/
- jjcm 15y agoVimcasts is also a nice series of video tutorials, and the author's accent is lovely to listen to. http://vimcasts.org http://vimcasts.org
- agentultra 15y agoI used vim for about 9 or 10 years before I switched to emacs. From my perspective people use vim because they haven't tried emacs yet (I kid!). I still have the muscle memory for vi and that's what these sorts of editors rely on to be effective with them. Once you get enough practice the editor practically disappears and it becomes more about the text on the screen... almost like you are manipulating it directly with your mind. Fun article. :)
- zrail 15y agoAugh the muscle memory! I used vim for five years in and out of college and then switched to emacs for the cool things you can do with SQLi-mode and shell-mode. Once in a great while I have to edit something on a machine I can't TRAMP to and I use vim, and then my fingers are completely shot for about an hour because they keep trying to type esc :wq instead of C-x C-s.
- nik_0_0 15y agoInteresting article, I have always been interesting in moving to Vim, and this article all but sealed the deal for me. The only problem being I don't really see how useful this would be for general notepad usage. I understand the author of this article is selling his plugin for Visual Studio, and this is a marvellous way to do it. Is there any other way to integrate vim with Visual Studio 2008 without purchasing his ViEmu? I would love to start learning vim but I doubt a trial would be enough, and I don't see most of the other attributes he covered ('.' for example) being very useful in daily notetaking.
- mmavnn 15y agoTry VsVim if you're on VS2010.
- alimbada 15y agoI'd love to use ViEmu or VsVim, but it'd confuse the hell out of my team members if we ever have to pair up. And then I'd be lumped with trying to explain what it is to them when they barely even know what Unix is...
- platz 15y agoIm waiting for this day to come for me, now.
- electrichead 15y agoI know this will be an unpopular comment, but my whole problem with it is actually the attitude of those that use it. After reading the article, I was really impressed and imagining all the ways it could help me after what, 8 years of coding into an IDE; and then I got to this: "Do whatever you want. Don't learn it if you feel it's too much effort just for nothing. Learn emacs instead. Or stay in your IDE using a lousy editor. Whatever. But in any case, don't ever claim again that those 'vi guys are nutheads' - I hope that I have succeeded in showing you why they (we) stick to it, and you should at least be able to understand its power, even if you prefer to stay away from it."
- jng 15y agoI'm the author of the article. Yes, the ending is anticlimatic, but the only reason is that I didn't want to "push" it on people. I just wanted to share my views. I thought many people would complain of fanboyism if I finished with a push to use it. I guess you just can't please everyone.
- aiscott 15y agoI believe the GP was referring to the condescending tone.
- mechanical_fish 15y agoSome unsolicited advice: Never use the word "fanboy". It's a word used by people who hate joy. Other people will call you a fanboy no matter what you do. Ignore these people. You are a fan of vi. Nobody is fooled by your disclaimers: The joy shines through. This is not a problem. Advocate vi with pride!
- un1xl0ser 15y agoFirst, you understand how and why it is modal. Then you learn simple commands for movement and editing. Then you learn all the meta-commands. All of these building blocks are only limited by your creativity of combining them to get what you want done. The more commands and tricks you know, the more you can slice and dice text, code, logs, whatever inside your editor (without leaving it). I guess it's just a Unix/neckbeard thing. This is how the rest of Unix is designed, so why not the editor.
- kenrik 15y agoI used to use vi but I did not like it, now I use nano.
- Riesling 15y agoWhenever I am using a program other than vim I feel clumsy. Plugins for Eclipse, Chrome and so on will only bring you so far. The other way around, namely turning vim into a multipurpose IDE does not satisfy my needs. One needs to admit that some features (refactoring support in Eclipse for example) cannot be matched by the available vim plugins. I know there are other solutions, like eclim, but I am looking for something more universal (think of using vim bindings in your email client). This is why I have been thinking about implementing a vim emulation layer recently, so that every program can profit from vim keybindings. Basically this would be implemented as some form of keygrabber that would translate vim specific commands into regular ones. Does anyone know of related pre-existing projects one could use as a reference. A quick google search did not deliver any results for me.
- Shanewho 15y agoHere is one in C# https://github.com/jaredpar/VsVim/ https://github.com/jaredpar/VsVim/
- skrebbel 15y agoThat's not what the GP meant. He meant getting Vi key bindings in any imaginable text field.
- phlyingpenguin 15y agoI'm not sure if this still works, but I'll be trying it a bit later today. (and I am guessing you're not after GTK only VIM editing) http://vim.wikia.com/wiki/Vi_key_bindings_in_gtk http://vim.wikia.com/wiki/Vi_key_bindings_in_gtk
- drothlis 15y agoYou didn't specify an operating system, but for OS X there's KeyRemap4MacBook[1]. Among a zillion other things, it has a setting for "Ubiquitous Vim Bindings" which enables vi-like bindings everywhere, except in terminals, emacs, and vi itself. And some things like password dialog boxes default to insert mode. I'm not a vi person myself so I can't comment on how effective it is, but I do use KeyRemap4MacBook to enable certain system-wide emacs/readline-like keybindings that are missing (C-w for backward-kill-word, C-m for return) and some ergonomic tweaks (Return key mapped to Control when held down, because I don't have a right-hand Control key on my keyboard). [1] http://pqrs.org/macosx/keyremap4macbook/ http://pqrs.org/macosx/keyremap4macbook/
- skrebbel 15y ago> Do whatever you want. Don't learn it if you feel it's too much effort just for nothing. Learn emacs instead. Or stay in your IDE using a lousy editor. Whatever. Why do all articles about how wonderful vi is end with condescension? Anyway: vi -> fast editing. IDE -> fast maintenance. I know which one I'd choose. The text editing features of an IDE is not why people choose to use IDEs (note: of course this helps best if you use a well-supported statically typed language - a Ruby IDE can't be as awesome as a Java IDE). Also, there could perfectly well be good IDEs with good Vim key binding support. This would be a wonderful mix of two worlds, and finally end this stupid discussion. I believe at least Qt Creator has a half-decent FakeVim mode baked in.
- skrebbel 15y agoOh! I read over the line that says that the author is actually developing a Visual Studio plugin to close exactly this gap. That's cool. Also puts what I took for condescension in a different light. Anyone used it? I might consider learning vi bindings decently if I can keep getting all the IDE goodness.
- qdog 15y agoI use cscope as my backend for vim, there are other ways to get your IDE going. Adding a vim emulator would not be as good as just using vim, imho. http://sourceforge.net/projects/vimplugin/ http://sourceforge.net/projects/vimplugin/ is the vim plugin for Eclipse if you can't live without Eclipse. I can't live without vim, myself ;)
- bostonvaulter2 15y agoI've tried his free trial for ms word and it was pretty good.
- Derbasti 15y agoIt is absolutely awesome! A few finer points are missing, but overall I can wholeheartedly recommend it. (missing: put last deletes in number registers) There is also the free VsVim, though.
- 15y ago
- nateberkopec 15y agoThat "vi gang sign" is a real shocker.
- sarcasmatron 15y agoI didn't want you to think your comment had gone unnoticed. Well played.
- deleted 15y ago[deleted]
- funkah 15y ago> The first time you stumble into vi or vim, you are shocked and disgusted that you have to use 'i' to start typing text. Can't remember which of hjkl moves in which direction. And you need to press 'a' if you want to insert after the last character of the line. Since you're already probably used to other editors, and if the arrow keys work in insert mode (they do if the system is configured properly, which is over 90% of the cases), you will stay in insert mode and not go back to normal mode except if absolutely necessary. You'll probably spend 20 minutes with it, and never go back. All of this, except the 20 minutes part. I'd hate to have to spend that much time with one of these "enlightened" editors. Just let me use my arrow keys, please and thank you.
- pyre 15y ago> All of this, except the 20 minutes part. I'd hate > to have to spend that much time with one of these > "enlightened" editors. Did you have this same resistance to learning when you learned the languages you are presumably programming in? "I'd hate to have to spend 20 minutes with Ruby, just let me describe my program in 'real' language please."
- recursive 15y ago> Did you have this same resistance to learned when you learning the languages you are presumably programming in? Speaking for myself, no. My reasons for disliking "enlightened" editors are similar to my reasons for disliking alternative keyboard layouts. If I can only be fluent in a highly specialized environment, in a sense, my skills become less portable. I like being able to walk up to someone's computer and just use it or help them with their issue. I do care about editing efficiency and superfluous keystrokes. But when I compared the keystrokes required to complete the example to what I would use in my preferred editor, (Programmer's Notepad) I didn't find the savings to be significant enough to warrant all the pain of learning a completely separate UI. And FWIW, if I was actually doing that example in real life, I'd be in my IDE, clicking "Implement Interface", not wrangling text. As for learning new languages, I enjoy doing it, and look forward to learning new ways of approaching problems that new languages can provide.
- overshard 15y agoI thought this was a rant on hash bangs or GET request variables and the coloration between them and people who use VI...
- kstenerud 15y agoI've never really felt comfortable in vi. I first started using it in 1989 at home, used it throughout college, and then used it on-and-off during my career, but it's never really felt powerful compared to a GUI editor. I want a scrollbar. I want a list of files in my project that I can just click on to open. I want tabs I can click. I want multiple windows that I can alt-tab to. And since I spend most of my time thinking and modifying code, I'm more often than not thinking in terms of tweaks and copy/pasting between files rather than "replace in this block of 3 words". A mouse and GUI just feels a lot more natural to me, even after 20 years of vi.
- tomjen3 15y agoIt is very nice to have a tab for each of your files. Until you have twenty files open and you can't find the right one (will happen sooner than you think, at least on largeish projects).
- kstenerud 15y agoI like having 20+ tabs open, provided the text editor supports multiple rows of tabs so you can see the names.
- eropple 15y agoI currently have 55 tabs open in IntelliJ (I counted). I have no trouble finding any of them. Side tabs and alphabetical sort are great.
- LogicHoleFlaw 15y ago...I have a persistent Vim session with ~600 files open. It's been in active use for over a year. It works great.
- eropple 15y agoYes, and? How is that related to "tabs don't work past about 20"?
- daniel_iversen 15y agoI really don't get how its more efficient than a modern editor! I use vi(m?) when I am working on a unix/linux/mac terminal and have done so for 10+ years. But I never bothered learning it properly so I only know a handful or two of commands. So I can't appreciate both perspectives clearly. However, how can it be faster and more efficient to edit in vi than in a modern editor? I'd assume that if you can use multi gesture scrolling, point and click location, the modern editor type keyboard shortcuts (with multiple keys pressed) that it would lend itself to be faster to work with and more "efficient" somehow (hard to explain). Would love to know what vi-people think about that because I am most likely wrong (as I said, very one-sided experience) but would love to get that level of detail (I don't think the story was iron clad on that point). Is there anyone who has switched from many years of very happy vi onto modern editors and love that more? Thanks..
- jimrhoskins 15y agoI feel like such a tool for saying this, because I thought people who said this were tools before I 'got it'. Taking your fingers off the keyboard and to the mouse and trackpad is slow. I now even get how moving your fingers to the arrow keys is slow. I never thought I would believe it, but somehow here I am, spouting the same nonsense. It's true. I think there is just some mind-body-editor connection that develops with vi(m) usage (and emacs, I don't know). When you really start thinking in vim, your mind starts describing what you need to do in vim commands, that magically flow out of your fingers, and vim responds. In other editors, for any task I need to do, instead of telling my editor to do something, I have to show my editor how to do it by selecting text and menu items with the mouse, it just feels clumsy. Once the keystrokes are muscle memory, it's impossible to beat with point and click in terms of speed. That's just an opinion from a vim novice that can never go back.
- blindhippo 15y agoI've used Vi(m) enough to know that I'm far more efficient in an editor designed to work with my OS. Knowing Vi (or Emacs) is essential as a software developer, but using it as your local code editor has never made sense to me. What most people who pontificated about Vi/Emacs/editor-of-choice often fail to realize is that there isn't a "One True Way To Do Things Bestest". Everyone works differently. Using Vi for 30+ hours isn't going to make me a better developer - and it certainly isn't going to speed up anything.
- itmag 15y agoWhat I want to know: how good is the best autocompletion available? Does it stack up to Visual Studio's Intellisense? (For statically typed languages, that is; Intellisense doesn't work very well for eg Javascript).
- JanezStupar 15y agoFor all your programming needs I would highly recommend JetBrains products. I am currently evaluating PyCharm and their JavaScript and Python editors are awesome. I was mostly using vim and tmux for Django development until now. Using vim plugin in PyCharm feels really 21st century. It kinda feels like VisualStudio + ReSharper (also a JetBrains product) for .NET
- LearnYouALisp 15y agoWe await the day when they produce the last word in parenthesis-based IDEs.
- qdog 15y agoI used to hook up auto completion to my tab key in vim, worked fine in c/c++ at the time. It would pop up a window of the options, but I stopped using that feature at some point.
- mattmanser 15y agoTo be completely honest if you were impressed you shouldn't have been. Learn your IDE! Apart from the douchey tone of the article, the thing he misses is that most editors can do this stuff, you've just got to make a bit of an effort to find out how. Emacs/Vim force you to learn this stuff as they suck without it. That's one of the big difference between Vim/Emacs and others, people don't realise they can do so much more with IDEs. For example in VS2010 with the MS productivity tools extension: Example 1: Use ctrl-shift-r/ctrl-shift-p (temp macro), actually less typing than his example due to auto-bracketing. Also learn how to use snippets. Example 2: I'm dubious on the value as believe this would require cognitive effort that I'm using for the code. I suspect hunt-and-peck (and only 4 or 5 keystrokes using ctrl-arrow at that) is probably better than switching mind modes to figure out the best cmd. For example won't handling entry.key().equals(qk.key) instead require different keystrokes, hence thought? Example 3: Use End, Shift-Home or Home, Shift-End instead Example 4: Use home, end, ctrl-pageUp, ctrl-pageDn to mostly deal with this Example 5: VS does this automatically on paste, so no typing at all required. If it really struggles you can use shift-},tab to indent an entire block, assuming starting on the { as the article does. Example 6: VS highlights end tags automatically without you even having to press anything, there's probably a command to select the enclosing block but I've never looked as it happens so quickly I don't think it's worth the time, here I just End, shift-upArrow a few times or go to the mouse. Deleting a whole block of code generally requires some thought about what it was doing, you're not in edit mode at the point of deletion. If you're looking for multiples then ctrl-F (find) will highlight all instances of the word your cursor is on, this is easier with productivity tools installed as it doesn't open a dialog. And VS also has the excellent rename all instances of this variable only in the right scope. He keeps banging on about fingers staying on the home row, but I don't really notice moving to the arrow keys, perhaps it's cognitively similar to switching to/from insert mode. I had to actually do all of them a few times to be able to write them down as just like Vim/Emacs, that's all muscle memory to me now. NB for example 5/6 I highly recommend changing the default colour of highlighted start/close tags in C#, the gray MS uses is far too light given how important it is. This is pretty much the only colour I have ever bothered changing from default. The other massive productivity thing in all editors if you didn't know it is ctrl-arrow, moves along words instead of single instances. Holding shift works as expected and you can hold shift-ctrl with one little finger. But I'm sure everyone knows that one. In regard to the productivity tools, I would turn off the auto-correct mixed tabs as it moans all the time when you look at downloaded code and also 'Quick Access' too as that's annoying. All that power without months of learning a new way of using a text editor.
- Jayasimhan 15y agoI wish every editor/language/product could have a blog like this that explained the philosophy behind its design.
- javajosh 15y agoI'm realizing that the distinction between vim/emacs and typical IDE editors is entropy. Vim is extraordinarily precise - very low entropy at all times. An IDE editor is constantly moving between high entropy (e.g. mouse motion) and low entropy (e.g. the interpretation of the mouse motion as a precise command). This implies that vim appeals to minds that desire constant precision, and GUI editors appeal to minds that prefer to vacillate between levels of precision. Decoupled from this is the question of which pattern of thought lends itself to being a better programmer. There is a good argument either way: staying at a very precise level of thought is wonderful when solving problems; and yet it is better to loosen up when figuring out which problems to solve. I tend to take the view that a programmer's actions while programming should ideally be unambiguous, precise, and regular at all times. Higher level thought should have a distinct place, time and another set of tools (pencil and paper being foremost among the alternatives).
- maxerickson 15y agoIs such a split between types of minds a real thing?
- javajosh 15y agoThat is my belief, although it is based on anecdotal evidence. Some (most?) hackers enjoy descending into and inhabiting continuously a low-entropy mind-state. There are others that would rather maintain some sort of fluidity between states, as inhabiting that low-entropy mind-state tends to come at the cost of human connectivity.
- TheCapn 15y agoI guess a nitpick on the article. When you say a "Steep learning curve" doesn't that mean the time to learn is quick? (Think X/Y plot with Time being independant, steeper slope indicates faster learning?)
- esrauch 15y agoHe is using "steep learning curve" correctly, in your example X-axis is what you want to achieve and Y-axis is how much you need to know to achieve it. The beginning part is a sharply increasing line for vim, you have to learn more to achieve the same amount on the low end.
- vacri 15y agoa different way to represent esrauch's point: time is the dependent variable, not the independent.
- joshhart 15y agoIn his first example, implementing a header file/interface is only CMD-I in IntellJ. Everything else is done automatically. I can understand why text editing is a big deal, but having an editor that actually understands your code is a powerful thing. Think of an IDE as a gigantic set of macros.
- __s3 15y agosed is faster than vi. and pagers are better for reading through documents than vi, or emacs.
- methodin 15y agoI believe I had two ah-hah moments about vim when reading this article. I love those moments! How I never knew about ]p is beyond me! I guess I should assume that something I'm doing that is annoying means I'm doing it the wrong way.
- rwos 15y agoReading the article and the comments here, I came to the conclusion that I seemingly don't really use vi. As in: I don't live in it. On a typical day, I work with my files using grep, awk, bash, python, sed, make, cat, xargs, etc. And, of course, vi. But I don't really use it like some (most?) people here seem to do. I don't list and navigate through files in vi (I use tree, ls and find for that). When I use vi, it's mostly for short bursts of manual editing. Occasionally, vim's syntax highlighting comes in handy - but that's about it. Don't get me wrong: that is exactly why I _love_ vi. It starts fast[0]. It fits in pretty well with the rest of the unix environment (it can read stdin, for example; and with vim you can open multiple files given on the command line - and you can construct that file list with any of the standard unix tools, of course). So, for me, the question "IDE or vi" ends much earlier. I don't even come to the point where I could discuss editing features. Can't read from stdin? Doesn't start in less than 1 second? Doesn't fit into my work-flow. Of course, vi(m) is a great editor, for all the reasons mentioned here and in the article. But the unix user-land has some great tools, too. And it includes vi. So it is by definition an even better editor than vi. :-) So that's what I use. [0] Believe it or not, emacs starts still too slow for me. These one or two seconds tend to disrupt me a lot (I've tried it, with GNU emacs). And, as I said before, I invoke my editor pretty often, maybe 50 times a day.
- Aga 15y agoA couple of years ago I was recommended to read this article as I was doubting if vim was anything for me. It convinced me to give it a try and after two weeks of learning it felt I could never go back. Since then I have vimified everything I can. Later I have recommended this article to others of whom some have had similar experiences... The author does a fine job describing the vim-philosophy instead of just a bag of tricks.
- Zakharov 15y agoWow, I used vim for five years and never knew about '.'. Glad to have found this article!
- nerdfiles 15y agoVi/m is a funny hat that I put on and that gives me powers. Let's call it meta-learning! I'm writing code; now, I'm writing code with a funny hat on. _This_ computer's funny hat! The great thing about Vi/m is that it compels you to read by withholding input entry. Key-bindings are secondary, but no less significant in that you can use two different object languages for dealing with text. Being forced to read through navigation of text with a robust language aids in presenting analogies to the coder. Who is entering the text? Does VISUAL feel like a finger pointing at the screen?
- davvid 15y agoIf you use vim then I highly recommend mapping spacebar to page-down and shift-spacebar to page-up. This key is kinda useless otherwise and super-helpful afterwards. It is also the largest key on your keyboard. usability++ nmap <space> <c-d> nmap <s-space> <c-u> vmap <space> <c-d> vmap <s-space> <c-u>
- platz 15y agoIm a fan of using the spacebar as my leader key.
- cjr 15y agoI started attempting to properly learn vim a couple of weekends back, watched a load of vimcasts (http://vimcasts.org http://vimcasts.org) and got my vimrc file all set up, but rushing to get things done before a release meant I switched back to sublime within a couple hours. Perhaps not the best timing! Can anyone recommend a good plugin for switching between files frequently - as in the Command-T shortcut in textmate/sublime. I did try the CommandT vim plugin, but didn't find it as good as the implementation in sublime.
- tedkalaw 15y agoI grew to love vim after being introduced to it in my data structures class. One of my favorite tools is much older than me - which seems kind of weird in the current state of technology. I find it very humbling.
- no-espam 15y agoVim is great but learning requires a good investment of time. If somebody tells you, you can be as productive as with your current editor in a few weeks, don't believe it. If all you need is notepad or gEdit, Vim is not worth the debt. Spend your time learning another language or create an open source project. I live in a terminal so Vim is my weapon of choice. I tried and bought a license for Sublime 2, which is awesome n vintage mode, but Sublime is not Vim.
- platz 15y agoViEmu or VsVim?
- Karunamon 15y agoI used to be in the "eww, vi" camp before taking a sysadmin job that basically forced me to use it. I used to remove vi at my first opportunity and link /bin/vi to nano instead. Well, almost a year later, and I can't use nano without being irritated. All of the jumping around the keyboard for functions seems really inefficient all of a sudden. Vim - :wq! :D Nano - C-o <ret> <ret> C-x >:( Probably the reason that emacs feels so wrong right now, though I'm doing my damnedest to become at least basically proficient with it, if nothing else for all of the ancillary features (like a really nice IRC client or the best text-mode organizer I've ever seen).
- becasse 15y agoThis article has been linked to 1,210 times on hacker news alone since it was first published 4½ years ago (according to Google: https://encrypted.google.com/#sclient=psy-ab&hl=en&source=hp&q=link:http%3A%2F%2Fwww.viemu.com%2Fa-why-vi-vim.html+site%3Anews.ycombinator.com https://encrypted.google.com/#sclient=psy-ab&hl=en&s...). It's fascinating how excited people get when given the chance to talk about their favourite editor! Further down in the comments it always gets to the point where someone asks: "Yeah, I'm trying to learn vi, but how do you delete 3 lines?", or something like that. Reminds me of this article: http://rachelbythebay.com/w/2012/01/16/replyall/ http://rachelbythebay.com/w/2012/01/16/replyall/