Live data from Hacker News

Vim users: stop using hjkl

vimcasts.org

111–120 of 218 posts

Re: Vim users: stop using hjkl

#111
post #69
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…

How is using text find to move to where you want "tricking" the program? With Easy Motion that type of cursor movement becomes even easier. Using a mouse just slows a vim/emacs user down.

> How is using text find to move to where you want "tricking" the program?

It's a trick because it uses one function (locating text) to accomplish another (navigation). Modern editors don't need to be tricked into cooperating with their users.

> With Easy Motion that type of cursor movement becomes even easier.

Ah, an add-on tool to get around vim's built-in inefficiencies. Guess why modern editors don't need Easy Motion to improve their usability? The answer is that they were pre-improved by their creators, who (among other things) eliminated modes as a design goal. No modes, no need for Easy Motion.

Re: Vim users: stop using hjkl

#112
post #76
post #69

Earlier quoted context omitted.

How is using text find to move to where you want "tricking" the program? With Easy Motion that type of cursor movement becomes even easier. Using a mouse just slows a vim/emacs user down.

Exactly, but it isn't just vim and emacs. Using the mouse is terribly inefficient for any typing-oriented endeavor.

> Exactly, but it isn't just vim and emacs. Using the mouse is terribly inefficient for any typing-oriented endeavor.

That depends -- how far do you need to move, and how much text do you need to select? For large moves, and for large text selections, using a pointing device is often much easier than using the keyboard. Modern editors auto-scroll to keep the mouse cursor in view, which means I can select an arbitrary, and huge, block of text in seconds. And I do, regularly.

Re: Vim users: stop using hjkl

#113
post #35

Earlier quoted context omitted.

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

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.

Why wouldn't you remap the keys if you were interested in ergonomics?

Re: Vim users: stop using hjkl

#114
I've never felt too pressed to learn vim, but I now realize how nice it is to be able to open the same exact editor with the same exact shortcuts on any linux machine in the world. I have 20+ servers I need to SSH into on a weekly basis, and I would much rather benefit from the convenience of using vim on every one of them than some hacky SFTP solution with Sublime on my machine.

Re: Vim users: stop using hjkl

#115
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... 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…

First, I don't know vi. Well, I am aware that something like this exists, because I see "{not in vi}" everywhere in VIM docs. So maybe you should familiarize yourself with VIM before talking about it - for example I noticed that you wrote that "[in modern editors] there is no need to wonder in what mode you are" as if it was a problem in VIM. It's true for vi, but VIM has a mode indicator on a status bar since times…

> It's true for vi, but VIM has a mode indicator on a status bar since times immemorial.

That's a nice improvement -- an indicator to tell you which of the three exclusive modes you're in at the moment. But imagine this -- imagine eliminating both the indicator, and the modes, all in one fell swoop, as modern editors have done.

> ... please take a closer look at modern VIM and then come back with a critique that makes sense in 2013.

When I wrote Apple Writer in 1978, I rendered vi/vim obsolete (and my program became a best-seller based on its ease of use). Among other things, Apple Writer didn't either have or require modes. Neither have any more recent editors, all of which had to compete with Apple Writer or its descendants.

Re: Vim users: stop using hjkl

#116

One of the best (collection of) cheatsheets: http://www.viemu.com/a_vi_vim_graphical_cheat_sheet_tutorial... The pdf version can be found here: http://www.glump.net/howto/vim_graphical_cheat_sheet

I never found the keymap cheat sheets useful. It tells me what happens if I press a certain key, but what I need is the reverse. Tell we what key to press if I want X to happen. When using a cheat sheet like that I waste a lot of time scouring the image looking for text relating to the type of operation I want. I'd rather have a list of options grouped by operation type.

I have a deck of flashcards in Anki to help learn vim bindings in a way similar to what you're looking for.

The flashcards are designed so the front is a description of some operation (ex. "motion cursor to end of the line" or "backward find word under cursor") and the back is the key combo to make that operation happen.

It works really well for me and I've noticed a huge improvement to my productivity in vim. If you're interested: https://github.com/MrPants888/vim_flashcards

Re: Vim users: stop using hjkl

#117

Oh please, not vim again. Now you are not even supposed to use the already ridiculous hjkl mappings. It's really amazing to me to see this sub-culture attach itself to an editor that was designed as it is BECAUSE THE AUTHORS DID NOT HAVE KEYBOARDS WITH MORE KEYS ON THEM! "hjkl is faster than reaching for the cursor keys". Holy frigging crap! Really? You are so good as a developer that MILLISECONDS make a difference?…

Imagine if there was a way to edit text entirely through just mentally thinking what you wanted changed? No physical overhead whatsoever, but just having the text change as soon as you mentally think, "change this parameter name to ___" and it happens. Being proficient in a good editor, like vim, makes that slightly closer to reality than using traditional, non-modal editors. Even so, this slight difference can have the major effect of helping the editor "get out of the way" and just let you make the changes a bit more proficiently - essentially freeing your mind up a bit to think about what you are changing instead of how. Physical traveling to the cursor/arrow keys to move one character or row at a time is wasting your time and a bit of mental energy, since you can't quickly and efficiently get to where you want to edit immediately (e.g. your brain has to do more and wait longer in between thinking, "x should instead be y" and it actually being changed).

Re: Vim users: stop using hjkl

#118

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.

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

Re: Vim users: stop using hjkl

#119
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... 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 sav…

> `:w` is as natural to me as ctrl-s.

Yep. And it is two keystrokes instead of one. Wouldn't it be more efficient to eliminate one of those keystrokes rather than committing them to memory? That's the approach taken by all editors written since about 1980, so it seems to be an idea whose time has come -- and passed.

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

The "cheat sheets" I refer to are those that map multiple-keystroke sequences to the actions that, in a modern editor, require one keystroke.

Re: Vim users: stop using hjkl

#120
post #112
post #76

Earlier quoted context omitted.

Exactly, but it isn't just vim and emacs. Using the mouse is terribly inefficient for any typing-oriented endeavor.

> Exactly, but it isn't just vim and emacs. Using the mouse is terribly inefficient for any typing-oriented endeavor. That depends -- how far do you need to move, and how much text do you need to select? For large moves, and for large text selections, using a pointing device is often much easier than using the keyboard. Modern editors auto-scroll to keep the mouse cursor in view, which means I can select an arbitrary…

Shift + page down allows you to select entire pages of text, cut it, and move it to whatever other position. It's also probably faster given that autoscrolling moves at a slower speed than page down.
Post reply on HN