Vim Tips Wiki
Advertisement

Previous TipNext Tip

Tip: #1390 - Change cursor movement keys for Dvorak layout

Created: November 17, 2006 0:49 Complexity: basic Author: Jesse Version: 5.7 Karma: 168/44 Imported from: Tip#1390

When one switches to the Dvorak keyboard and uses vim it becomes difficult to use the standard (h,j,k,l) movement keys. This is a great way to have the same movement locations and retain all of the functionality. There are also a few added benifits, that can be used. Add this to your .vimrc


The fixes for what is broken


* Delete 'd' -> Junk 'j' 
* Next 'n' -> ???? 'l' 
* Previous 'N' -> ? 'L' 


There were also some changes for familiarity, 's'/'S' can be used to access command mode (the old location of the :, which still works).

Added Benefits


* End of line '$' -also- '-' 
* Beginning of line '^' -also- '_' 
* Move up 8 'T' 
* Move down 8 'H' 
* Next window <C-w><C-w> -also- 'N' 
* Swap windows <C-w><C-r> -also- 'D' 


" Dvorak it!

no d h

no h j

no t k

no n l

no s :

no S :

no j d

no l n

no L N


" Added benefits

no - $

no _ ^


no N <C-w><C-w>

"no T <C-w><C-r>

no H 8<down>

no T 8<up>

no D <C-w><C-r>

Comments

Thank you for this tip. I have found some aspects of Vim limited since I switched to Dvorak, this will help immensely. Now to go change my Mutt keybindings to match!

Anonymous , November 17, 2006 6:07


I used to use something very similar to this, but lately I've felt better off just using the default keymappings under Dvorak. When I used a keymapping file for basic movement commands, I quickly became dependent on it, and I'd be unable to accomplish even simple Vim tasks under Dvorak without my handy mapping.

YMMV, but the default keymappings really aren't that bad under Dvorak in my opinion. (-:

vimsite--AT--jamcp.imap.cc , November 17, 2006 9:02


Agreed: h is left of the l, on the sam hand; jk are adjacent. It's actually pretty convenient to scroll up/down with the left hand using the default layout. If Dvorak is what you used before you found vim, it works just fine with the default bindings!

I think using :keymap dvorak is probably a better way to retain default 'nethack-style' movement though.

Anonymous , November 20, 2006 11:48


Advertisement