[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: dvorak keyboard



nori@sccs.swarthmore.edu said:
> now that you mention all this, my vim muscle memory will be the
> hardest of all to change.  i still think i'm going t o give it a shot,
> though ... just as soon as my wrist stops hurting.  thanks to all who
> respomded -- you've been most helpful (as usual)!

well, here's what I did with vim. I make no claim that it's the best way
to do it; it's simply the first remapping I thought of when I changed to
dvorak. It proved fairly easy to learn; whatever remapping you come up
with will stick after a day or two.

The downside is that it becomes much harder to use vim when you don't
have your own vimrc, but when your vimrc is in cvs it's pretty easy to
get it no matter where you go. 

Jason


if !exists('*Dvorak')
    function Dvorak ()
	" these remap the hjkl arrow keys. Home row cursor movement is
	" too good to part with.

	noremap d h
	noremap h gj
	noremap t gk
	noremap n l

	" Now we replace functionality lost in the previous remapping.
	" h has already been replaced by d. That means we need new homes
	" for d, t, and n. j, k, and l are now redundant and open for
	" use as new mappings. So, I replace l with n.  This means you
	" just have to learn to press l after a search. This is
	" convenient because the / that starts the search and the l that
	" continues it are right next to each other on the dvorak
	" keyboard.

	noremap l n

	" the 'd'elete and un't'il keys were a little harder.  I was
	" already used to using the middle finger of my left hand to
	" delete things, so I made that character, 'e', the new delete
	" character. This came at the cost of not being able to go to
	" the 'e'nd of words, but going to the 'E'nd of Words turns out
	" to be enough for me:

	noremap e d

	" alternately, if you're willing to learn a new delete key, you
	" can just replace d with j or k. I didn't want to relearn the
	" muscle memory, and it's nice to have delete on home row
	" because it's so frequently used.

	" So, we have t left and j and k open to replace it with.  it
	" turns out you don't need to do it. For me, 't' is pretty much
	" only needed in operator-pending mode. So I unmap it in that
	" mode, meaning that t has different meaning depending on
	" context. For me, it always does the right thing.

	if version > 500
	    ounmap t
	endif
    endfunction
endif

" Dvorak mappings
if this_user_needs_dvorak_remapping
    call Dvorak()
endif





Reply to: