29 ms·
Vim's speed is not really the point (2013)
- dozzie 11y agoOh yes, this is why I find Vim much better than any other editor. Because I don't need to think about editing, it just happens as I need and when I need.
- jessaustin 11y agoAs noted in TFA, was discussed here before: https://news.ycombinator.com/item?id=5448983 https://news.ycombinator.com/item?id=5448983
- farresito 11y agoI personally am a fairly lazy person, so moving my hands away from the keyboard all the time to reach the mouse is just too much, and I get tired fairly fast. That's the main reason I use vim.
- aggronn 11y agoSame, though I don't know if tired is the best word for me. For me, its just like, whats the point? Being able to use a computer without having to move my arms more than an inch or so is kind of...relaxing?
- pyre 11y agoMaybe what you need is the AlphaGrip[1]! [1] http://allthingsergo.com/blog/wp-content/uploads/2011/08/grip-front-view1.jpg http://allthingsergo.com/blog/wp-content/uploads/2011/08/gri...
- JackMorgan 11y agoI've got one, the mouse leaves a lot to be desired.
- lfowles 11y agoAn upgrade I've made to my Alphagrips (with the optical trackball) is to use either a stainless steel ball or a teflon ball instead of the cheap plastic trackball. Edit: Just remembered I also replaced the tiny balls holding the trackball with teflon balls. I think the biggest improvement was just from replacing the main trackball though, I rarely have to clean the sensor/rollers anymore. My biggest issue other than that is the behavior of Shift doesn't match other keyboards :\ Can't shift click to select ranges of text.
- JackMorgan 11y agoWhere did you get them to ensure the right size? I'd be really interested. I tried to mod mine with an IBM trackpoint, with no success.
- lfowles 11y agoOrdered them from Mcmasters. I'll have to check exact dimensions later, but I want to say they were 1" and 1/8"
- lfowles 11y agoExtreme-Temperature Slippery PTFE Ball, 3/4" Diameter 316 Stainless Steel Precision Ball, 3/4" Diameter Extreme-Temperature Slippery PTFE Ball, 1/8" Diameter Hope that helps! I also tried the same stainless steel in 1/8", but that made the trackball loud.
- JackMorgan 11y agoThanks!
- melling 11y agoSomeone did a teardown a couple of months ago. Looks interesting. http://www.reddit.com/r/MechanicalKeyboards/comments/2yfb7e/photos_alphagrip_igrip_teardown_rebuild_video_in http://www.reddit.com/r/MechanicalKeyboards/comments/2yfb7e/...
- farresito 11y agoIt's annoying, but one also loses focus. I'm also a huge fan of i3wm, which is a tiling wm that requires no mouse in order to be used, so I can move around without actually moving my hands off the keyboard.
- ksk 11y agoHow many lines of code do you type in a day?
- farresito 11y agoIt's not about the amount of lines I write, since vim would barely give me any benefit. It's moving around, for example, when you really feel the difference. And it's not only vim, but other stuff that I also have configured to not have to use the mouse (like firefox, through vimperator, or the wm, through i3wm). Don't get me wrong. I don't have anything against IDEs. I've been playing around with neovim's msgpack (the thing that would theoretically allow neovim to be embeded inside Intellij, for example) and if I get some time, I might start implementing an Intellij plugin to allow me to use neovim (ideavim is very buggy, unfortunately. I really appreaciate the author's effors, though, but the way to go in the long term is through neovim).
- ksk 11y agoOkay, so you basically want to interact with your UI using only using keyboard shortcuts. I would agree that it does indeed provides a productivity boost.
- farresito 11y agoI still believe that if you are productive in an IDE like, for example, Intellij, there is no point to really go to vim. What I often recommend is that people give it a try, even if it's sublime's vintage mode or ideavim, which is pretty good out of the box (but very buggy if you get into customizing). At the end of the day, vim is another tool, and tools are there to help us be more productive. I don't work with very large projects nor do I usually do any sort of refactorings, so vim works very well in my use case, but I very much understand when people complain that vim doesn't do what they need. I run a very customized version of vim (15 plugins or so plus around 400 lines of config in total), so, as you can expect, it's very hard for me to leave it :-).
- ajford 11y agoSometimes it's not just LOC. I use vim and git to manage my todo lists. I use vim to take meeting notes, and leverage pandoc to produce aesthetically pleasing pdfs to mail out. I use vim when writing my documentation in Markdown and/or reStructured Text. Vim is my default text editor for pretty much everything.
- ExpiredLink 11y agoWhat makes you think other editors would require you to us a mouse??
- farresito 11y agoNothing. I just chose vim because I know it does let me move around without a mouse. I wouldn't mind using nano if it gave me the same thing vim gives me.
- farresito 11y agoI'm open to try new things if they are worth it. I've tried many things, and for now vim, although not perfect, is superior to the rest of things.
- ams6110 11y agoI bought a thinkpad keyboard with a trackpoint for just that reason. I prefer not using the mouse at all, and rarely do when I'm using emacs, but for any other apps and most websites it's unavoidable. The trackpoint is right there under my index finger and the mouse buttons convenient for thumbs. Far better than reaching for a mouse or even moving your hand down to a touchpad.
- farresito 11y agoI do have a Thinkpad, as well, and I also use the Trackpoint :-). Very convinient, indeed. It's one of the things I cared the less about when I bought it and now it's one of the things I can't live without.
- hasenj 11y agoThat's not lazy. Lazy is preferring to move your hand over to the mouse instead of spending weeks learning an obscure editor called vim. I have a beef with using the word "lazy" wrong like that. Lazy is undisciplined. The undisciplined will not become good programmers. It takes a lot of discipline to learn vim. It takes a lot of discipline to automate mundane operations.
- wutbrodo 11y agoThis was what originally attracted me to Vim, but I found it similarly jarring to jump all the way to the Esc key every time I wanted to switch back to execute mode. I couldn't fathom why such a poor choice was made for that key until I saw the computer it was created on: http://www.catonmat.net/images/why-vim-uses-hjkl/lsi-adm3a-full-keyboard.jpg http://www.catonmat.net/images/why-vim-uses-hjkl/lsi-adm3a-f... My .vimrc now has "inoremap jj <Esc>" in it, and that was the final missing piece to get me into uninterrupted-productivity mode with Vim. Since you seem to have similar preferences, you might find that a useful optimization. ETA: Apparently whoever I got this idea from got it from the Vim tips wiki. http://vim.wikia.com/wiki/Avoid_the_escape_key http://vim.wikia.com/wiki/Avoid_the_escape_key
- farresito 11y agoI do the exact same thing, but with the 'jk' keys. It works really well. I also have 'JJ' (insert mode) mapped to create a new line on top of the current line and go into insert mode, and 'jj' (insert mode) to create one line under the current line and go into insert mode. It seems like it makes no sense, but I have gotten used and works wonderfuly (I could finish writing the parameters for a function inside the parentheses, press jj and simply open the braces that make the function's body, instead of having to go to escape mode or having to press ')' and then enter to get out of the parentheses and go to the next line. Thank you for the tip anyway :-)
- dozzie 11y agoI don't understand neither of you two. Why bother with jj or jk when there is <Ctrl-C>? There are few cases when it differs from how <Esc> works, but those are rare and make changes big enough to justify jumping to <Esc> anyway.
- farresito 11y agoIt's faster, in my opinion. Using ctrl is one of the reasons people end up with the pinky things in emacs. jk is in my home row. I would rather avoid having to reach the ctrl key. I think ctrl-[ does the exact same thing as ctrl-c. It's just a matter of preference.
- taf2 11y agovim is like the force. you think about what you want and it happens.
- antonpug 11y agoAs a front end web developer, I am not really sure I understand any "advantages" to VIM or VI, or any command-line based edit for that matter. Sure, they might be great if you're doing scripting, messing around with the back end, or dong DB stuff. But for me, writing day-to-day JS, HTML, CSS code, VIM seems like a very huge burden. It's like trying to unscrew a screw with scissors when you have a screwdriver laying next to you. Why not just use a good, well-rounded editor like Sublime or Atom, or even Eclipse, for that matter..? I often see web developer, dabbling in front end code, doing their coding in VIM. Yuck. Someone explain?
- jkyle 11y agoI'll start off with the best advice I ever ran across with regards to the beat to death "choosing an editor" question: > Try all the popular ones, give them all a fair shot like several weeks of exclusive use. Pick one. Practice it. Move on to more interesting problems. Vim is a good well-rounded editor that can do anything Sublime or Atom can do. And it did them before Sublime or Atom existed. It has Gui's that feel native. Every new generational crop of editors, I give the new guys a fair shot. Use them for a few weeks, but usually end up back on Vim after that. Last one that really "shook things up" was TextMate...though all editors have those features now. So, to your question specifically: Why vim? I could go on about keyboard efficiency or home row or more terse key combos to get the same thing done or blah blah blah. But really, none of that is true. The reason I use vim is simple: It's feature full, does everything I need, I know it and know it well, and.... I've got better things to do then learn another editor as well.
- m0th87 11y agoYou could turn this around and make it an argument against vim, if you're an experienced sublime/emacs/whatever user.
- jkyle 11y agoThat's my point. What editor you use is, largely, inconsequential when it comes to getting work done. They're all very comparable in features. Use whatever you like. It's about the code, not the editor.
- cletus 11y agoYou can count me as one of those who simply don't like modal editors. Every vi(m) user has had the experience of pasting something in while in command mode or typing commands while in editing mode. It's disruptive and annoying (IMHO). Obviously YMMV. But take the poster's example of changing parameters. Let me tell you how I do this in IntelliJ: 1. Click anywhere between the parentheses; 2. Press Ctrl+W (context-sensitive selection) repeatedly until I have everything within the parentheses; 3. Type the new parameters. Now some might object to the mouse use here. There is a belief that the keyboard is faster, which seems to at least in part be an illusion [1]. Anyway, (1) can be replaced by any number of keyboard navigation techniques. Incremental search tends to be my "go to". The one big use case for vim/emacs for me is the ability to use them over SSH. That's actually pretty huge but I won't use either all the time just for that. At the end of the day vim (and emacs) are just text editors, which is fine, but you see this limitation all the time. Regex based syntax highlighting will have funny edge cases (emacs is a little different here I know). An IDE is built to understand code constructs and concepts like the context-sensitive selection I mentioned above. Being able to move a java file and have it update all my imports and packages. Being able to auto import when I start typing a class name. Code templates (eg type "iter" or "itar" in IntelliJ then hit tab when you want to write a loop). The amount of mental effort that seems to go into recreating an environment you get for free with an IDE is mind-boggling to me. By this I mean the constant tinkering with plugins and extensions. Unfortunately many vim/emacs diehards use Eclipse as a strawman argument against IDEs ("I once used Eclipse and it was slow thus IDEs suck") when Eclipse is (IMHO) at best a medicore IDE with a lot of warts. The other area where vim/emacs have survived is with the C/C++ family of languages (Visual Studio notwithstanding for Windows users). That's because tooling in this area has been pretty basic. I applaud Jetbrains' recent CLion effort. The problem here is that the C++ grammar is so incredibly complicated it makes tooling difficult. This is one reason why I appreciate the design goals of Go: simple grammar leads to easier tooling and faster compilation. [1]: http://ux.stackexchange.com/questions/30682/are-there-any-recent-studies-of-the-keyboard-vs-mouse-issue http://ux.stackexchange.com/questions/30682/are-there-any-re...
- Bognar 11y ago> An IDE is built to understand code constructs and concepts like the context-sensitive selection I mentioned above. Being able to move a java file and have it update all my imports and packages. Being able to auto import when I start typing a class name. Code templates (eg type "iter" or "itar" in IntelliJ then hit tab when you want to write a loop). You can have the best of both worlds. For example, I use Visual Studio with the VsVim plugin. Visual Studio is my IDE, but vim is my editor.
- nichochar 11y agoThat was a good read :) I love vim it's beautiful
- shmerl 11y agoSome things feel unnatural about vim. For instance I always tend to remap its default paste behavior to more commonly used one, and claims that one has to "adjust muscular memory" don't sound convincing to me when it introduces a drastic inconsistency. Most editors paste text before the cursor position, and also set cursor position after the pasted text (after pasting). Vim defaults are different. If you press "p" it pastes after the cursor, and as well puts cursor on the last character of the pasted text (not after!). Vim offers an option that's similar to common behavior. It's "gP" (instead of "p"), so I usually remap p to act as gP, since that's what I use all the time: noremap p gP noremap P gp noremap gp P noremap gP p Another thing that's commonly different in vim, is that when you select text in visual mode, it picks the character under cursor as well i.e. beyond the highlighted area. Most editors only select it until the cursor, and not including. Luckily this is also configurable with set selection=exclusive May be in vim it was always the other way for historic reasons, but consistency is convenient and at least in my case all other editors / text forms that I use (including browsers) act differently from vim defaults in regards to select / copy / paste behavior.
- veddox 11y ago> claims that one has to "adjust muscular memory" don't sound convincing to me when it introduces a drastic inconsistency Sorry, emacs user here... I just wanted to say that adjusting muscular memory can go faster than you expect. I learnt how to use emacs a couple of months ago, and have recently noticed the tendency to do ctrl-x + ctrl-s to save, or ctrl-y to paste, even when not in emacs ;-) The latter can be a bit annoying, but learning emacs was such a big plus that I don't mind much. The article on vim sounds interesting, I tried and gave up learning it some time back, I should definitely revisit it again.
- shmerl 11y agoI don't mean you can't adjust muscular memory - you can. But when behavior is inconsistent (like pasting I described above), you need to switch it each time you use something that's not vim. For me it's not about what key combination to press - that's not as hard to switch, but more about what behavior to expect from the action "paste" and etc.
- serve_yay 11y agoIt takes too much thinking to use editors like that. I'm very much of the "don't make me think" school, and I grew up using Notepad. Well, maybe I don't use Notepad anymore, but I like it when I press the up-arrow key and my cursor moves up a line. Simple.
- colinbartlett 11y agoIt seems to me that an approach like that won't advance you very far. There's a lot of work in software development that can reduced to nothing, if only you put the time up front to "think". Whether or not the 10x developer is a myth, there are people who are vastly more productive than others. And they are people who have invested in themselves and their skills, automating away everything they possibly can.
- z92 11y agoFor me it feels like I am pressing the up arrow key and the cursor is moving up, too. But really I am pressing a different key. Which key I no longer remember. If someone asks me, I have to retype it to check which key I have just pressed. After some time, it all become muscle memory.
- wtetzner 11y agoThis is the reason people like Vim. Yes, there's an up-front learning curve, but it's not long until it's muscle memory. Now even complex editing tasks can be done without thought or effort.
- inclemnet 11y agoIt takes thinking to learn to use editors like this. Actually using them requires little to no thought after an acclimatisation period. This is one of the points of the article.
- mcbuilder 11y agoYou're right it takes more thinking in order to learn vim or any set of key bindings. Vim has taught me that you are able to "speak", by typing, a language related to editing text. You are severely limiting your self in your efficiency of editing if you choose to ignore your ability to define macros/modes/whatever in a powerful text editor. I use emacs now with a highly configured set of key bindings, and you're right it's taken me a lot of time. You're comment makes me think there are two types of programmers, those in the "don't make me think" school and those who spend an insane amount of time in one of the big editors, i.e vim/emacs/sublime. To make a gross example of the deficiencies of each, the "don't make me think" school are the people who would manually enumerate function calls instead of learning what a for loop is, while the crazy emacs hackers are the type to spend more time fine-tuning their config than actually working.
- chipotle_coyote 11y agoWhile this is going to seem (and probably is) a bit inflammatory, I don't think any article will ever make a convincing Why Editor X Is Better argument for people who already use Editor Y. In practice, there's a functionality bar for editors to clear; the likelihood that you're going to gain massive productivity improvements by switching between editors that are both past that bar is honestly pretty low. And that bar is likely lower than most people think. Reasonable syntax highlighting, good regex support in search/replace, some kind of "project" support, some kind of scriptability, and an ability to set basic editor configuration variables on a per language basis (e,g., 2-space tabs for YAML, 4-space for Python)... once you hit a certain point, then you get into progressively more dubious arguments. "I can change the contents between these parentheses on line 9 by simply typing '9Gf(ci(' while you're clicking in the line with your mouse like an animal!" Good for you, ace, but you're not really saving the time you think you are. (Also, you can perform a rough equivalent of "select or delete the stuff between these parentheses" with a single command in BBEdit, Sublime Text, and Emacs, and I'm sure in many other editors.) I'm not suggesting all editors are absolutely fungible past a certain point -- there's solid reasons you may prefer one over the other -- but once you get really good with a given editor, "modality is awesome" and "everything in my editor is actually a Lisp command" shouldn't be particularly convincing arguments. Generally speaking, you probably have better things to do with your time than figure out how to replicate your favorite Editor X power moves in Editor Y. Don't you?
- obsurveyor 11y agoBut can you repeat it in a slightly different place? That's where vim typically beats other editors for me. Every editor can do a one-off in some way. It's when you can repeat them in different contexts or quickly adapt them to slightly different ones. vim gives you tools right up front to do this quickly and accurately instead of doing repetitive mouse gestures or filling out dialogs.
- chipotle_coyote 11y agoI'm not sure that my interpretation of this is quite what you mean; most editor operations I do day to day, at least, aren't particularly context-sensitive. The balance command in BBEdit that I referred to above, for instance, just selects whatever's in between the closest pair of braces, brackets or parens, and if you keep hitting it, it expands the selection outward. There's not much I can think of that is context-sensitive other than functions relating to the language you're editing, and I can't think of any "class A" editors -- Vim, Emacs, Sublime, TextMate, BBEdit, etc. -- that seem way below (or way above) the median in this regard. The debate about mouse-vs.-keyboard will probably be argued long after nobody's actually using either mice or keyboards. Personally I've found that the farther you need to move the cursor the more likely it is that using a pointing device for at least part of the operation will prove faster, and AFAIK most studies done on this going back 30+ years corroborate that, but it doesn't "feel" faster to us. (That's not directly relevant to editors, since Vim and Emacs both support mice just fine, even if their diehard fans consider that heretical.)
- a-dub 11y agoahh yes, editor holy wars... a) it has little to do with the tool itself (vim vs. whatever), it's about the payoff from investing time in learning an editor or environment well. once you know your tool well, friction drops substantially. if you take someone who knows something like intellij well and put them next to someone who knows vim well, it would probably be a wash in terms of who is hobbled most by the shortcomings of their tool. if you know a tool well, you know where it excels and where it sucks, and you have strategies for using it effectively. b) to really know a tool well, a significant investment of time and effort must be made. i prefer to spend my time and effort on projects, to be honest. c) vim is a tool that can be taken anywhere and the rewards of learning it can be paid back for years. corporate environment? usually already there or easy to get due to it being open source. platform? you can get it for pretty much any visual environment. language? if more than 10 people have written in it, there's a syntax colorizer for vim. need to do some ops stuff? vi will be there. hell, in a pinch, even busybox has a vi clone. is it intrinsically better or worse? hard to say. but as far as i'm concerned, vim is a worthwhile investment because of its portability, longevity and constant adaption by a strong community to changing environments.
- veddox 11y agoditto to just about everything you said. And just for the sake of having mentioned it, ed is still the standard text editor!
- tomlu 11y ago> it has little to do with the tool itself (vim vs. whatever) I don't know about that. I've been proficient in other editors too, but I found that vim's modal editing mode confers unique advantages when it comes to staying in flow. But if compared to an IDE there are several flow-breaking things in vim that just don't work as well out of the box (navigation, indexing, debugger integration etc), so if that's your point then I agree. Of course most major IDEs have some sort of vim emulator these days so you can have your cake and eat it.
- bcheung 11y agoIt's curious that vim uses modes and it is actually one of the things I really like about it. A lot of HCI talks about how modes are "evil" because the user can get confused and what mode they are in. I do occasionally issue a command from the wrong mode but I find that the time to correct is usually extremely small and far outweighs having to create more cumbersome bindings that don't have collisions in other modes.
- Yetanfou 11y agoTo me, the difference between using a command-driven tool and a graphical interface is comparable to the difference between explaining a native speaker how to get to the museum (straight-on for 200 m, second turn left, first turn right after the park) and trying to do the same to someone who does not understand any of the languages I speak by pointing, making walking movements with my hands, mimicking left and right-hand turns and trying to find a way to bring across the concept of a park by these means. Yes, I had to learn German, English, Swedish and French before I could converse with people using those languages. This took time, but it was well worth the effort. It took time to learn (eg.) vi as well, but this too was worth the effort. I can still point and click my way through a maze of menus if I want by using a GUI-enabled version of vi or any other editor, but why bother when I can just tell the thing what I want in a few keystrokes?
- oldmanjay 11y agoI suppose you could use one of the thousands of GUI-based editors that also have key shortcuts for their commands. I don't know which one you used that required menu navigation to do everything you should name-and-shame so we know to avoid it.
- splawn 11y agoUnless you are talking about emacs and/or vi bindings, the key shortcuts you are talking about are just barely scratching the surface.
- jamesrcole 11y agoThe way I'd put the point of this article: Vim enables the user to more directly translate their intentions into actions
- Animats 11y agoOh, I thought this was going to be about how fast "vim" runs. "vim" has performance good enough for looking at large text files such as logs in the 100MB range. Some editors will choke on that. Gedit on Linux blows up on excessively long lines, which is embarrassing for 2015.
- bhz 11y agoI'm not going to read the article, and I'm not going to even say if I like VIM or not. I have become completely bored with the discussions about the pros and cons of VIM and other editors. My only hope is hundreds of years ago people were having the same discussions about pens versus pencils, and they were equally as bored with it as me. I only comment because I care enough about any others out there, who may think they are all alone, who are as bored with this topic as I am.
- blt 11y agoI think the tool obsession blossoms with repetitive jobs. If you perform essentially the same programming task over and over, you focus on finding the most efficient way to do it. If your tasks are less repetitive, you probably spend more time thinking than writing code, so you are not as concerned with tool efficiency. Car mechanics debate who makes the best 3/8" flex-head ratchet. Engine designers don't. [citation needed] Still, the flex-head ratchet was probably invented by someone who got frustrated trying to turn a tricky bolt with a fixed-head ratchet. Discussing the benefits/limitations of current tools is worthwhile. However, when it comes to text editors, I see a lot more "X editor is amazing, here's why" than I see "all editors are insufficient, here's how we should make them better."
- edgarvaldes 11y agoI am not sure about "the tool obsession blossoms with repetitive jobs". Maybe my counter-example is very specific, but I think about painters (even on digital mediums) and the obsession about their tools.
- return0 11y agoI have no idea how fast vim itself is. I know that i'm faster when i use vim , so i use it all the time, because time is the most precious thing.
- bcheung 11y agoWhen I first learned vim, it took me a week to get to the same proficiency of MS notepad. After that it just got better. Now it's my main editor.
- bcheung 11y agoSome other helpful hints for the vim users: 1) You can use Ctrl-C instead of escape in most cases. This results in less travel distance and avoiding the wrist rotation. Which leads to... 2) Bind Caps Lock to Ctrl like God intended it to be. That way you can use Ctrl-C really easily and also the page navigation commands like Ctrl-(F|B|U|D) are really easy. This one might not work if you have a caps lock key with those weird notches. 3) Bind your Leader key to Space. I have the Unite plugin do fuzzy file / buffer finding when I hit Space Space. 4) Set up your own custom key bindings to the other Ctrl keys are aren't used by anything yet. Ctrl-S and Ctrl-V to split screens horizontally and veritcally. 5) Bind Ctrl-(H|J|K|L) to move between screens.
- bcheung 11y agoA programming language / environment is at its best when it minimizes the amount of cognitive load and context switches. Mouse movements require a feedback loop where the user must lift their hand feel around for the mouse, then move the mouse, then there is a rapid loop where the user moves the mouse, sees where the cursor goes, determines how far from the destination it is, then repeat until the goal is reached. Vim cursor movements however are more logical and absolute. Go up 2 lines, end of word, end of line, everything inside the quotes, etc. The cognitive load required is much less in vim -- at least once learned, but definitely not in the beginning when going through the learning curve. It may not seem like much but every bit of brain power that can be freed up is that much more brain power that can be used to concentrate on the task at hand. To someone who is trained in vim it just feels much more relaxed and fluid when editing. To exaggerate, imagine if every time you had to use the mouse, you had to open a drawer, pull out the mouse, plug it in, perform your action, then unplug it, then put it back into the desk. This is a contrived example for sure but it gives an illustration of the subtle distraction and annoyance many vim users feel when they have to use the mouse.
- ramgorur 11y agoI think vim's real point is its crazy visual block mode -- http://vimcasts.org/episodes/selecting-columns-with-visual-block-mode/ http://vimcasts.org/episodes/selecting-columns-with-visual-b...
- Shorel 11y agoFrom my experience the argument applies just as well to SublimeText. But yes, you need to know your shortcuts.