Hallo all. I thought I'd share my Colemak mappings for Vim and other console programs. These stay true to the defaults as much as possible while retaining traditional homerow HNEI arrows. I have been using these for 5+ years daily at home and work, and I love it!
I have also created fairly consistent bindings based on this for other programs and their Vi-modes:
Zsh
Tmux
Less
Pentadactyl [Vimperator]
There are many other approaches to be found in Colemak + Vim. Some alternatives are Shai's complete remapping of everything, LeoMaheo's very elegant and minimal approach, or just sticking with the defaults. This approach lies somewhere in the middle.
In a Nutshell
The idea is to use HNEI as arrows – keeping the traditional Vim homerow style – and changing as little else as possible. This means JKL are free to use and NEI need new keys.
k/K is the new n/N.
s/S is the new i/I ["inSert"].
j/J is the new e/E ["Jump" to EOW].
l/L skip to the beginning and end of lines. Much more intuitive than ^/$.
That's the basics...there're more in the actual code such as pane/tab navigation, but a few other highlights and notes:
Ctrl-l joins lines, making l/L the veritable "Line" key.
r replaces i as the "inneR" modifier [e.g. "diw" becomes "drw"].
The default s/S is the only "lost" mapping, but it's synonymous with cl/cc anyway; I never found it useful.
The Code
I've copied the relevant mappings for Vim below.
For other programs [and .vimrc details such as Colemak NERDTree], you can explore my complete dot-files at https://github.com/bunnyfly/dotfiles.
There are some of my own personal settings and mappings, but most everything is well commented and Colemak-related bindings are almost always marked as such. Direct links: Vim, Zsh, Tmux, Less, Pentadactyl.
I don't use every Vim command in existence, but I think I have a fairly comprehensive setup that includes pane and tab navigation as well as common commands that are influenced by the change. If you notice something's missing, let me know! All feedback's appreciated!
.vimrc
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Colemak-Vim Mappings
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" HNEI arrows.
noremap n j|noremap e k|noremap i l|noremap gn gj|noremap ge gk
" In(s)ert. The default s/S is synonymous with cl/cc and is not very useful.
noremap s i|noremap S I
" Last search.
noremap k n|noremap K N
" BOL/EOL/Join Lines.
noremap l ^|noremap L $|noremap <C-l> J
" _r_ = inneR text objects.
onoremap r i
" End of word.
noremap j e|noremap J E
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Other Colemak Arrow-Based Mappings
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Switch tabs.
nnoremap <C-i> <C-PageDown>|nnoremap <C-h> <C-PageUp>
" Switch panes.
noremap H <C-w>h|noremap I <C-w>l|noremap N <C-w>j|noremap E <C-w>k
" Moving windows around.
noremap <C-w>N <C-w>J|noremap <C-w>E <C-w>K|noremap <C-w>I <C-w>L
" High/Low/Mid. Note that <C-m> is equivalent to the enter key.
noremap <C-e> H|noremap <C-n> L|noremap <C-m> M
" Scroll up/down.
noremap zn <C-y>|noremap ze <C-e>
" Back and forth in jumplist and changelist.
nnoremap gh <C-o>|nnoremap gi <C-i>|nnoremap gH g;|nnoremap gI g,