views:

2198

answers:

6

Although I played with it before, I'm finally starting to use Dvorak (Simplified) regularly. I've been in a steady relationship with Vim for several years now, and I'm trying to figure out the best way to remap the key bindings to suit my newfound Dvorak skills.

How do you remap Vim's key bindings to best work with Dvorak?

Explanations encouraged!

+20  A: 

I use one of the more common recommended keybindings:

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>

Movement keys stay in the same location. Other changes:

  • Delete 'd' -> Junk 'j'
  • Next 'n' -> Look 'l'
  • Previous 'N' -> Look Back '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'
Adam Davis
Thank you! I have been needing this also.
J.J.
Great, thanks!(Note that in the post, the HTML tags are lost. Be sure to follow the provided link)
Pascal
Thanks for the note - I have reformatted it so it displays here properly.
Adam Davis
+1  A: 

Vim ships with an extensive Dvorak script, but unfortunately it’s not directly source-able, since the file includes a few lines of instructions and another script that undoes its effects. To read it, issue the following command:

:e $VIMRUNTIME/macros/dvorak
Aristotle Pagaltzis
The problem with this script is that it assumes you want the keys in the same position. When really the keys that need positioned are only the movement ones.
he_the_great
+9  A: 

I don't find that I need to remap the keys for Dvorak -- I very quickly got used to using the default keybindings when I switched layouts.

As a bonus, it means that I don't have to remember two different key combinations when I switch between Dvorak and Qwerty. The difference in keyboard layout is enough that I'm not expecting keys to be in the same location.

Andrew Aylett
+3  A: 

I simply use standard qwerty for commands and dvorak for insert mode

Here is how to set it up

+4  A: 

A little late, but I use the following:

" dvorak remap
noremap h h
noremap t j
noremap n k
noremap s l
noremap l n
noremap L N

" easy access to beginning and end of line
noremap - $
noremap _ ^

This basically does the following:

  • left-down-up-right are all under the default finger positions on the home row (i.e. not moved over by one as in the default QWERTY Vim mappings)
  • l/L is used for next/previous search result
  • use -/_ to reach the end/beginning of a line

This seems to work for me...

zcrar70
There is no late, it's all about the long tail. :-)
cdleary
Thank you, your remap works great, I assigned n and N to j and k because those keys are free after the first remaps and the keys are next to each other in a fine place, besides that it takes away the need to reach for the shift key. :-)
TomWij
A: 

My rebindings:

noremap h h
noremap t j
noremap n k
noremap s l
noremap j t
noremap l n
noremap k s
noremap J T
noremap L N
noremap K S
noremap T J
noremap N L
noremap S K

Notes:

  • In qwert, vi has to use 'h', because vi doesn't want to use ';' a non-letter. But in dvroak, we have 's', so why not take this advantage?
  • vi uses Caps for relative actions. This is a good design philosophy. So I try to conform this.

Meanings:

n (Next) -> l (Left) -- "What's left?" resembles "What's next?" s (Substitute) -> k (Kill then insert) t (jump Till) -> j (Jump till) N, S, T are similar.

J (Join lines) -> T (make lines Together) K (Keyword) -> S (Subject) L[count] (Line count) -> N (line Number)

B.T.W. L itself goes to the last line, and N is the last letter of fin. (Thanks for tenzu to point out this.)

weakish