6 ms·
> Moving your Vim cursor around using the arrow keys is a bad habit ... Yes, as is having a keyboard with more than 64 keys, a pointing device, software that a
by lutusp 14y ago
> Moving your Vim cursor around using the arrow keys is a bad habit ...
Yes, as is having a keyboard with more than 64 keys, a pointing device, software that allows character insertion, deletion and cursor motion all without changing modes, or any computer designed after 1980. We must all fight against this rising tide of convenience and efficiency by insisting that everyone use vim and its descendants.
- JulianWasTaken 14y agoThis comment is ridiculous. Being "anti-vim" is perfectly alright with me. I use vim because it's the fastest thing I've ever used by a very wide margin. I also respect others who find it too hard to learn or find they're more productive elsewhere. But a comment that essentially boils down to "vim is archaic" in a post about vim usage habits is totally ridiculous, so in the nicest way possible, get lost.
- lutusp 14y ago> But a comment that essentially boils down to "vim is archaic" in a post about vim usage habits is totally ridiculous ... And entirely topical. Young programmers who read such posts may not realize how many more efficient options are now available. Speaking about vim as though it's an obvious choice in 2013 would be like insisting that everyone code in Fortran in 2013.
- mdpye 14y agoPerhaps you'd care to share some of them and their advantages with the younger and older coders who've never come across them? Otherwise - in a slightly less nice way than last time - get lost.
- lutusp 14y ago> Otherwise - in a slightly less nice way than last time - get lost. If that's your argument in favor of vi/vim, then other vi/vim users may ask you not to be on their side.
- kiwim 14y agoOooh. I'd love to hear those many more efficient options!
- lutusp 14y ago> I'd love to hear those many more efficient options! This may come as a surprise, but modern programming editors don't require the operator to switch between three mutually exclusive modes -- insert, delete and navigate. That's because modern keyboards have keys dedicated to those purposes, which means the operator doesn't have to either wonder which mode he is in, or switch modes, which saves an enormous amount of time when programming. The first step toward modern editing is use of the arrow keys for navigation. The next step is to realize, if the arrow keys can reposition the cursor without using letter keys, then maybe there's no reason to have to switch modes. Vim's focus on keyboards that no longer exist, and on displays that no longer exist (including the paper terminal I used with vi while working for NASA forty years ago), requires an incredible number of unnecessary keystrokes, as exemplified in this typical conversation: http://stackoverflow.com/questions/1379198/in-vim-how-do-i-delete-a-word-and-go-into-insert-mode http://stackoverflow.com/questions/1379198/in-vim-how-do-i-d... Notice that no one says "have you considered solving the problem by changing editors?"
- JulianWasTaken 14y ago> This may come as a surprise, but modern programming editors don't require the operator to switch between three mutually exclusive modes -- insert, delete and navigate. That's because modern keyboards have keys dedicated to those purposes, which means the operator doesn't have to either wonder which mode he is in, or switch modes, which saves an enormous amount of time when programming. You speak as if modal editing came first and universally agreed upon better things evolved afterwards. I know this isn't true. I know you know this isn't true. You're being highly disingenuous. Your link is equally disingenuous since you either don't understand that the operation involved there is not one you can do in-stride or with as few keys in any other "modern" editor, or if I give you slightly more credit but presume malice then you're being willfully misleading again.
- klibertp 14y agoI would really like to know what options are there that are more efficient than VIM for text editing... And when talking about IDEs and code writing remember to include VIM plugins in comparison.
- lutusp 14y ago> I would really like to know what options are there that are more efficient than VIM for text editing... In answer, I have to say that nearly every other text editor that exists is more efficient than vi/vim. Modern editors are mode-free, meaning (don't faint) you don't have to change modes to insert, delete and navigate. These editors don't need "cheat sheets" to help you figure out how to switch modes and navigate, because you don't have to cheat. Vi/vim is the oldest editor still commonly available. I used it in the 1970s when I worked for NASA, on a "paper terminal". In that environment, its quirks made sense because they saved paper. Since then, it has been completely superseded by newer, better programs. Even my now-ancient program Apple Writer (http://en.wikipedia.org/wiki/Apple_Writer http://en.wikipedia.org/wiki/Apple_Writer) was easier to use, largely because my program addressed and solved some of vi's more annoying problems. There's a reason Apple Writer became a best-seller -- one of them was that fact that, by eliminating modes, it represented a huge improvement over existing editors, including vi. But that was the early 1980s. If I had been told then that I would still be trying to get people to use more efficient editors over 30 years, later I would have laughed -- impossible!
- falcolas 14y agoSpeaking only to one of your many weak arguments: > These editors don't need "cheat sheets" to help you figure out how to switch modes and navigate, because you don't have to cheat. I haven't used a cheat sheet with vim in years now. I don't think I used a cheat sheet after a month of using vim. `:w` is as natural to me as ctrl-s. Slightly more natural, because I don't have to think in order to turn a save into a save as, if I want to write the contents to another file. And if we want to talk cheat sheets, wouldn't you consider menus in non-modal editors to be cheat sheets, since they show both the keyboard shortcut, and the action, side by side?
- deleted 14y ago[deleted]
- sofal 14y agoYou're commenting on a vim post in order to help lost young programmers understand that there are other options besides vim? Speaking about vim as though it's an obvious choice in 2013 would be like insisting that everyone code in Fortran in 2013. Oh, now talking about how to use vim effectively is like insisting that everyone uses an archaic programming language? I suppose if we were to have a post here talking about how to use the command line effectively, you'd feel obliged to educate young programmers that we've moved on from the 1970s.
- lutusp 14y ago> You're commenting on a vim post in order to help lost young programmers understand that there are other options besides vim? Yes, and what better place? > Oh, now talking about how to use vim effectively is like insisting that everyone uses an archaic programming language? Based on the number of objections to a discussion of vim's alternatives, yes -- that's a legitimate comparison. > I suppose if we were to have a post here talking about how to use the command line effectively, you'd feel obliged to educate young programmers that we've moved on from the 1970s. Only in the midst of an amazing discussion that included various "cheat-sheet" strategies to get around the behaviors of an editor that demands cheating to be productive. Given that context, saying that newer editors don't require you to cheat seems entirely topical.
- alinajaf 14y ago2 points: > This comment is ridiculous. Yes. However, I would point out that eventually this productivity thing matters i.e. more productive developers will be able to effect more change in the world faster than less productive developers. While I'm all for sharing knowledge, if my competition is putting creative effort into hobbling themselves, then I say leave them to it. > I use vim because it's the fastest thing I've ever used by a very wide margin. I used to think this, but then I paired with someone who was eye-wateringly fast with TextMate (that person has since converted to using vim full-time). Rather than speed, for me at least, its always been about fluency (how little cognitive load is there between thinking and the code appearing). I happen to be a lot faster than most IDE clowns I happen to be working with, but I believe that's a happy side-effect.
- xtracto 14y agoI use vim for some things (mainly script and minor XML editing) and IDEs for other things. I would never attempt to develop a big C, Java or even Ruby (after trying RubyMine) system in. Stuff that refactoring, finding usage-of and looking at call-hierarchy are some of the things that are either only done in a 'patchy' way or non-existent in Vim.
- vitalique 14y agoTry using IdeaVim plugin with RubyMine. It's a real gem.
- marcpeabody 14y agoBeing rude is a bad habit too.
- eropple 14y agoHis post isn't rude at all. Sarcastic, sure, but that's not the same thing.
- eropple 14y agoNo kidding. I spend a ton of my day in Vim and use the arrow keys because I like them. That's the only reason: I've tried hjkl (I mean, I've ascended seven times in Nethack, I know hjkl) and I don't like it. I even use motions...with the arrow keys. I have a Mac and the arrow keys are all of three and a half inches from the home row and I do not have the little blob in the back of my brain that lights up with pain when I am performing a trivial operation in a more mentally consistent but less optimal manner. (The time it's taken to write this post has probably outstripped any optimization I'd get for using hjkl...yearly.)
- swift 14y agoI don't do use hjkl out of concerns about optimality, personally. I do it because I find moving my hand back and forth from the home row to the arrow keys is hard on my wrists, and I get tired sooner. I've found that coding is a lot less hard on my hands since I started using the traditional vim way of doing things, but YMMV of course.
- eropple 14y agoI'm sure that's true for some folks, yeah. For me, I find it to be less of a concern since moving to a laptop keyboard (less distance to move, forced me to stop pounding the keyboard) and working at a standing desk a lot more. Those seemed to address the deeper causes of my ergonomics issues.
- erifneerg 14y agoBut as Drew points out in his post, moving by by word (w,b and e) and by character search (f,F,t,T) is much faster the arrow keys or h,j,k,l. The article isn't about not using h,j,k,l completely but encouraging people to use those other keys for movement.
- eropple 14y agoSure. And don't get me wrong--I use them! (Though I will admit that also use that touchy-pointy thing that's bolted on below my spacebar for getting around too, which I never did on Windows or Linux.) But when I need to move character-by-character, for me, it makes way more logical sense to use the things with the left, right, up, and down marks on them because that's what they're there for. hjkl doesn't make sense to me, so I don't use it. (Something like HJUK--or even just WASD--would make more sense to me, but I don't care enough to start remapping all the live-long day.)
- notaddicted 14y agoIt really doesn't have to be dogma, stuff like this can really help building a habit especially if you use it every day. I had this problem when I used to play Counter Strike Source. I was weapon switching with the scroll wheel which is just terrible, and since it is a shooting game I was getting shot because in a tight spot I couldn't pull out my pistol fast enough. So I just unbound the scroll wheel for a couple weeks and then using the number keys instead was natural, and now it doesn't matter if the scroll wheel is connected or not, I reach for the numbers first. So after you fix the habit you can put the mapping back and still have it available. Totally Unrelated: I read most of your book about sailing (most I think, you're in the Mediterranean,) and I've enjoyed it, cheers.
- lutusp 14y ago> It really doesn't have to be dogma, stuff like this can really help building a habit especially if you use it every day. Yes, but in modern times, the habit of navigating with arrow keys is a more transferable habit to develop. Assuming we use more than one program in our work. And almost no programs retain the archaic i/j/k/m navigation scheme -- not surprising, since those are letter keys and most modern programs don't require the operator to switch modes in order to move the cursor -- and why should they? A modern keyboard has dedicated keys for that purpose. > I read most of your book about sailing (most I think, you're in the Mediterranean,) ... Thanks -- well, I did have to sail the remaining half distance around the world from there. :) The above refers to my free world sail book: http://arachnoid.com/sailbook http://arachnoid.com/sailbook
- jakejake 14y agoI can see the point only so far as disabling the keys temporarily in order to force yourself to learn and use some of the more powerful key combinations. But, I had to deal with hjkl on dumb terminals either without arrows, or with arrows that didn't work. I always hated it. The arrow keys I find very obvious, simple and effective.
- sp332 14y agoThe other stuff you mentioned at least has upsides. Moving your hand over to the arrow keys does nothing that hjkl doesn't, and it's slower. There is literally no upside.
- kps 14y agoI have a keyboard with 68 keys (I don't count the auxiliary rubber buttons), which is nice because I can reach them all without moving my hands from the home position. I call this convenience and efficiency. I have a pointing device that I like a lot for some purposes, but I don't use it for core work, since that revolves around manipulating a bunch of symbols found on the aforementioned keys, and not found on the pointing device. I call this convenience and efficiency. vi and its descendants — actually TECO and its descendants — don't actually have ‘modes’ in the sense suggested. They have functions with arguments, and certain rules for combining these functions. What this article is trying to point out is that some of these functions take advantage of the correspondence between the symbols being manipulated and the symbols literally at the user's fingertips. I call this convenience and efficiency.
- agwa 14y agoThis isn't about being some old fogey who's stuck in the 80s. It's good ergonomics to avoid hand movements away from the home row to the arrow keys or the mouse. My wrists have felt significantly better since I went cold turkey on the arrow keys.
- kingmanaz 14y agoSame here, and I type dvorak. The hjkl keys are in a completely different location on a dvorak keyboard as opposed to qwerty, and yet I have seen a reduction in wrist pain.
- juliogreff 14y agoMust be a fun exercise using hjkl on dvorak. I think I would end up remapping the whole normal mode to the same positions of a qwerty keyboard.
- to3m 14y agoJ and K are the C and V keys respectively, and H and L are the J and P keys respectively - so it's not too bad, though hardly ideal. My use of a dvorak keyboard is probably why I never bothered with H and L when using vim, and only very rarely used J and K. I just used the arrow keys, if I wanted to move one cell at a time. (I never really saw the point of trying to make people use hjkl for cursor navigation. You should try always to use higher-level navigations commands, and if you move cell by cell, you've lost already! - so there's nothing wrong with using the arrow keys for it rather than hjkl. That is, after all, what the arrow keys are there for.)
- peeters 14y agoI used vim with colemak for a while. It's really, really hard to customize because some commands are mapped according to their position (hjkl) and others are mapped according to their initial ("y" for "yank", e.g.). Trying to keep both is thus impossible, as there are collisions. So your options are: 1) Preserve position, and remap everything back to its qwerty location. Downside: you have to train yourself that you're not pressing "n" for next, you're pressing "k". 2) Don't remap anything. Downside: nothing is ergonomic anymore. 3) Keep positional keys in their correct position, assign mnemonic keys when they don't collide with the positional keys and choose new mnemonics when there are collisions. Downside: only you can ever use your vim. The best support I saw was for #3 but it ended up being a deal-breaker since I pair program (but that's OK, because using colemak itself ended up being a deal-breaker since I pair).
- jules 14y agoThis is so true. The basic error the article makes is equating number of keys typed with efficiency. Not all key presses are equal. When you navigate with letter searches you have to think much more than holding down an arrow key until you're at the point you want to be, or even better moving your mouse pointer. Fingers are quick, brains are slow. Especially when you are already using that brain at full capacity for the programming task itself. I for one welcome touch screens for programming, which are even better than a mouse (touch screens are of course not a good replacement for a keyboard, they are however a good replacement for a mouse for many tasks).
- Jach 14y agoFewer keys and being old aren't arguments against something being convenient and efficient... See for instance the benefit that 22 keys can have with a stenotype machine: http://en.wikipedia.org/wiki/Stenotype http://en.wikipedia.org/wiki/Stenotype Should everyone learn to use one? Probably not, but if you're invested already it wouldn't be prudent to ignore the advice of those already familiar with the device. Similarly with vim.
- alayne 14y agoIf anything, you're the one arguing for outdated editors -- editors that are not aware of structure and treat programs like an array of characters, allowing navigation only by the simplest and least efficient means possible.
- crucialfelix 14y agoI've been a VIM hater for years but I'm really enjoying it recently. Mouse works, scroll wheel, arrow keys work even in terminal. It's really about switching files, navigating by class/definition, and 0 latency GUIs. ZERO. No excuse for having to wait for your computer when you are just editing text files. Sublime Text is pretty fast but still I'm often waiting for it to build a new tab or format search results. Eclipse is unusable. More importantly, why don't we have eye tracking so we can just look and start typing ? Maybe leap motion can get us there.