Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there any way to map the k key to 'down' and the j key to 'up'? This seems much more intuitive to me, since the right arrow will also move the cursor down, if it's at the end of the line.

Why was this mapping decided on? And why does the left / right movement not also take you to the next line like in most other editors?

share|improve this question
Wikipedia suggests the above followed from ^h for backspace and ^j for return, apparently since ancient times. – Eroen Mar 14 '12 at 6:17
There are a large number of applications that follow the vi/vim as a standard. You are going to drive yourself nuts. – Zoredache Mar 14 '12 at 7:25

You can do it, but this is a Bad Idea™! This is going to cause you grief down the road.

However, if you are dead set on doing this, put these two lines in ~/.vimrc:

:nnoremap j k
:nnoremap k j

As for left/right moving wrapping on lines:

:set whichwrap+=h,l

See :help 'whichwrap' (with the single-quotes), and note that the help says this is not recommended.

share|improve this answer
+1 for "Bad Idea(tm)" – tidbeck Mar 14 '12 at 10:55
Thanks for the info -- super helpful. But is it only a bad idea because I'll get confused on other systems? I assume that these were put in that order for some ergonomic reason or something. Any idea what it is? (Or is it just history, as comments above suggest?) Thanks! – Loren Rogers Mar 14 '12 at 17:31
The confusion is basically what is at issue, but don't discount it; this will be more of an issue for you than you realize after you have gotten used to your nonstandard movement keys. There are other problems you may run into with Vim itself, possibly with plugins, for example.. – Heptite Mar 14 '12 at 19:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .