abbreviations used:
PREV: move line up by keeping the column
NEXT: move line down by keeping the column
Suggestions how to use vi (no remapping) with Colemak
vi can not be remapped with .vimrc, it would be necessary to recompile vi for this.
alternative moving in vi:
h = move char left: h is already the same key as with qwerty (alternative but worse: backspace).
l = move char right: Instead of this one can use the key Space which does exactly the same.
k = PREV: Instead of this one can use Ctrl-p. The key - is even harder to reach as k and does not keep the column.
j = NEXT: Instead of this one can use Ctrl-n. Ctrl-m and the key Ret are slightly different as they move to the first non blank of the next line. The key + would do the same but is even harder to reach.
Unfortunately these alternatives are not mentioned on most of the vi cheat sheets and vi introductions.
Suggestions how to use Vim and Emacs viper-mode with only a small remapping for Colemak
Unlike most others in this thread I prefer to remember and keep the original mnemonic and don't worry about the physical layout with regions and neighborhoods. I also want to keep beeing familiar as much as possible with vi (which can not be remapped with .vimrc) and less to be comfortable with Unixes on which you have only vi but no Vim out of the box like Solaris.
PREV on the key k and NEXT on the key j annoys me with vi in Colemak. Simply swapping n <-> j and p <-> k brings NEXT and PREV to Colemak-n and Colemak-p. This way NEXT comes back to the same key it was on qwerty-j (!) and the keys n and p are already used the same way for moving up and down in e. g. bash and Emacs, see summary below. The costs for these two swaps are that "Paste" moves from p to k and "search Next" moves from n to j. I appreciate these two swaps now for years.
Summary of line movement keys
up / down | tool and functionality
-------------+------------------------
C-p / C-n | bash history of command line
M-p / M-n | Emacs history of minibuffer (find-file, grep-find, compile, find-tag, ...)
p / n | Emacs dired-mode, buffer-list, ...
C-p / C-n | Emacs PREV/NEXT in buffer editing without viper-mode
C-p / C-n | Emacs PREV/NEXT in buffer editing with viper-mode if remapped for Colemak or not
p / n | Emacs PREV/NEXT in buffer editing with viper-mode if remapped for Colemak
C-p / C-n | Vim PREV/NEXT alternative keys, first of all if p/n not remapped for Colemak
p / n | Vim PREV/NEXT common keys if remapped for Colemak
C-p / C-n | vi PREV/NEXT alternative keys, first of all if p/n not remapped for Colemak
k / j | vi PREV/NEXT common keys (not remappable without recompilation)
C-p / C-n | GNU Screen selection in list of terminal sessions (C-a ") alternative keys
k / j | GNU Screen selection in list of terminal sessions (C-a ") common keys
k / j | less common keys
y / e | less alternative keys (easier for Colemak)
C-p / C-n | less alternative keys (easier for Colemak)
Colemak remap code for Vim in ~/.vimrc
" vim nnoremap for emacs-like next line for Colemak layout
nnoremap n j
nnoremap j n
" vim nnoremap for emacs-like previous line for Colemak layout
nnoremap p k
nnoremap k p
Colemak remap code for Emacs viper-mode in ~/.viper
;; vim nnoremap for emacs-like next line for Colemak layout
(define-key viper-vi-basic-map "n" 'viper-next-line) ; was "j"
(define-key viper-vi-basic-map "j" 'viper-search-next) ; was "n"
;; vim nnoremap for emacs-like previous line for Colemak layout
(define-key viper-vi-basic-map "p" 'viper-previous-line) ; was "k"
(define-key viper-vi-basic-map "k" 'viper-put-back) ; was "p"
edit: added all but the first section, Vim/vi alternative keys, link to bash changed
Last edited by cisum (17-Nov-2011 18:22:21)