Live data from Hacker News

Vim users: stop using hjkl

vimcasts.org

91–100 of 218 posts

Re: Vim users: stop using hjkl

#91
post #8

Earlier quoted context omitted.

No 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 w…

But 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.

I think you end up wasting time deciding what combinations of w, b, e, f, F, t, T, h, j, k, and l you need to type to get you to the right place. Then you feel really good and efficient because you hit "just a few keys" and got where you wanted. Meanwhile, I took 2 seconds to grab the mouse, click where I want to be, and return my hands to the home row.

That's not to say Vim's keyboard capabilities aren't useful--they are! Sometimes you just want to move a character over, sometimes you need to justify a paragraph (gqap, or |fmt). But I'll contend that in general, when you want to move to a point in the text, using the mouse pointer to point where you want is the easiest.

When I need a shopkeeper to grab something off the shelf (maybe my favorite dirty magazine, I don't know), I don't say "ok 3 rows down from the top, 7 columns in, no sorry one more column to the right, that's it". I point and say, "I want that one".

Re: Vim users: stop using hjkl

#92
post #79
post #51

Earlier quoted context omitted.

> 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…

Please see http://vimgolf.com/ and let me know if you still believe Vim requires and incredible number of unnecessary keystrokes. Some of the editing you can do with so little keystrokes is amazing!

> Please see http://vimgolf.com/ and let me know if you still believe Vim requires and incredible number of unnecessary keystrokes.

But that site's purpose is to show how clever people have become in fighting vim's innate inefficiencies. If someone posted to that forum using a modern editor, he would be thrown out for cheating, for suggesting that there's a better way.

Re: Vim users: stop using hjkl

#93
post #2

> 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.

This 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.

I 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.

Re: Vim users: stop using hjkl

#94
post #61

Earlier quoted context omitted.

>What vim user does all their movement with hjkl only anyway? Having used vim for nearly two decades now, my primary movement routine seems to be start with "/" and "?". In other words, jump to the approximate location using a word search and "W" or "w" as needed to the specific word, then use the hjkl or other commands to further refine the cursor's location.

> Having used vim for nearly two decades now, my primary movement routine seems to be start with "/" and "?". In other words, jump to the approximate location using a word search and "W" or "w" as needed to the specific word, then use the hjkl or other commands to further refine the cursor's location. Young programmers should be made aware that there are now programming editors that do away with the need to think of…

I somewhat agree with you. Which is why I use macVim. for editing and getting places you want, nothing is faster or better than vim (In my humble opinion). But sometimes my dumb ass has no idea where to start or what I should be looking at, so I need need NEED a nice scrolling feature and mouse click actions from my trackpad. some simple mindless hand movements combined with using my eyes to read is a million times faster for me than any kind of key combo if I don't know where I'm going.

Re: Vim users: stop using hjkl

#95
post #77

Earlier quoted context omitted.

I 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.

> 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…

Speaking 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?

Re: Vim users: stop using hjkl

#96
post #78
post #61

Earlier quoted context omitted.

> Having used vim for nearly two decades now, my primary movement routine seems to be start with "/" and "?". In other words, jump to the approximate location using a word search and "W" or "w" as needed to the specific word, then use the hjkl or other commands to further refine the cursor's location. Young programmers should be made aware that there are now programming editors that do away with the need to think of…

Not sure if just trolling, but if not it seems you're not very experienced yet in the use of the tools of the trade of the professional programmer. The point of using the vi interface is nowadays (and yes I know about the original reasons of the modal workings of vi...) that moving your fingers off the home row takes too much effort, let alone having to move your hand to the mouse. It's easier to drive an automatic,…

I'm not sure if he's trolling or not either. But since he wrote the original "Apple Writer", (see http://www.arachnoid.com/administration/index.html ) It seems likely that he knows something about the tools of a professional programmer.

Re: Vim users: stop using hjkl

#97

Earlier quoted context omitted.

Same 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.

Must 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.

J 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.)

Re: Vim users: stop using hjkl

#98
post #2

> 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.

If 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.

Re: Vim users: stop using hjkl

#99
post #78
post #61

Earlier quoted context omitted.

> Having used vim for nearly two decades now, my primary movement routine seems to be start with "/" and "?". In other words, jump to the approximate location using a word search and "W" or "w" as needed to the specific word, then use the hjkl or other commands to further refine the cursor's location. Young programmers should be made aware that there are now programming editors that do away with the need to think of…

Not sure if just trolling, but if not it seems you're not very experienced yet in the use of the tools of the trade of the professional programmer. The point of using the vi interface is nowadays (and yes I know about the original reasons of the modal workings of vi...) that moving your fingers off the home row takes too much effort, let alone having to move your hand to the mouse. It's easier to drive an automatic,…

My problem is that this power doesn't motivate me. Do I want to make lots of changes rapidly? No. Further: THAT WOULD BE BAD. I want to make concise changes based on sober reflection. Do I want a convenient browsing mechanism that stays minimal while I internalise the code I'm reading? Yes. I get the _why_ of vim, but the obsession over mashing keys as fast as you can seems like a bad smell in terms of developer attitude.

Re: Vim users: stop using hjkl

#100

I was hoping someone would trash the idea of hjkl, which I personally don't like. So first I was disappointed to read yet again about not using the arrows. Then when I read the rest of the post, it definitely makes sense. I do use w, b quite frequently, and I don't use f, but I've found the vim-seek[1] plugin recently, and it seems to make more sense to use. It matches two rather than one character, which makes it mu…

I'm now considering extending the seek idea to moving to close-by lines, through mappings that would work like EasyMotion's w, b, e and ge but excluding the current line and working on lines above (b and ge) and below (w and e), by typing the two characters that respectively end and begin the target word.
Post reply on HN