Vim Dvorak keybindings (rebindings :)
Asked Answered
A

7

37

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!

Assuntaassur answered 3/10, 2008 at 0:30 Comment(0)
N
36

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

Nuclide answered 3/10, 2008 at 0:41 Comment(2)
Great, thanks! (Note that in the post, the HTML tags are lost. Be sure to follow the provided link)Swoon
Thanks for the note - I have reformatted it so it displays here properly.Nuclide
S
21

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.

Sale answered 3/10, 2008 at 10:32 Comment(0)
S
10

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

Seiden answered 27/1, 2009 at 15:37 Comment(2)
There is no late, it's all about the long tail. :-)Assuntaassur
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. :-)Pluck
P
9

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

Here is how to set it up

Protomartyr answered 10/10, 2008 at 16:34 Comment(0)
M
4

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

P.S. I have used these rebindings for a while. Now I does not use it in vim. I just use the default ones.

Maidenhair answered 13/7, 2010 at 6:0 Comment(0)
N
2

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
Nyctophobia answered 3/10, 2008 at 9:18 Comment(1)
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.Allistir
A
1

You can use this to have Vim use Dvorak only in insert mode:

:set keymap=dvorak

This way all of the commands are still in QWERTY, but everything you type will be in Dvorak.

Caveats: Well, almost everything. Insert mode, search mode, and replace mode will all be dvorak, but ex commands will not. This means that you don't have to relearn :wq, but you will need type :%s/foo/bar/gc in QWERTY.

This won't help if you only want to move certain commands, but I found that in my head, "move forward one word" was bound to "move left ring finger up," rather than "ask the typing department where the letter 'w' is and then press it," which made this method much easier for me.

Aquarelle answered 9/2, 2013 at 19:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.