2

I am using colemak and thus I have remapped my direction keys like so

noremap n h
noremap e j
noremap i k
noremap o l

noremap h n
noremap j e
noremap k i
noremap l o

The problem is that these keybindings are not honored by the viewport navigation. Eg. when I press ^w+n I want to shift focus to the viewport to the left but instead a new empty viewport is opened.

How can I help rebinding all the viewport navigation keys individually?

paldepind
  • 4,680
  • 3
  • 31
  • 36

2 Answers2

2

This subject has been somewhat beaten to death over at the colemak forums:

There are a number of listed links to

  • keymaps
  • plugin scripts

I feel Shai's own script is going way too far - doing way more than just integrate Colemak into vim (remapping C-w to Close Tab e.g., showing some bias towards tab-oriented editors, people have complained about in-/exclusive motions (diw, daB etc) not working any more etc).

I guess the best advice, as has been given before is to stick with the defaults and do:

Keyboard bindings for Vim

Vim is an extremely efficient text editor that I use for writing emails and editing any sort of text file. Vim's commands are all controlled from the keyboard: 'd' for delete, 'w' to move the cursor forward one word, 'dw' to delete the text moved over by 'w', '2dw' to delete two words, etc. Left/Down/Up/Right navigation is located on the QWERTY keys H/J/K/L so that the typist's hands never need to reach for arrow keys or the mouse.

Unfortunately, these navigation keys are not so intuitive under Colemak and so I needed to find some more appropriate mappings. After experimenting with many alternatives, here is what I finally decided on and am very happy with:

noremap n j|noremap <C-w>n <C-w>j|noremap <C-w><C-n> <C-w>j
noremap e k|noremap <C-w>e <C-w>k|noremap <C-w><C-e> <C-w>k
noremap s h
noremap t l

noremap f e
noremap k n
noremap K N 
noremap U <C-r>
sehe
  • 374,641
  • 47
  • 450
  • 633
1

I think you'll have to map the <C-W> window navigation commands explicitly, by doing something like:

noremap <C-W>n <C-W>h
noremap <C-W>e <C-W>j
noremap <C-W>i <C-W>k
noremap <C-W>o <C-W>l

noremap <C-W>h <C-W>n
noremap <C-W>j <C-W>e
noremap <C-W>k <C-W>i
noremap <C-W>l <C-W>o
m0tive
  • 2,796
  • 1
  • 22
  • 36
  • This what I'd like to avoid. I don't understand why my remaps doesn't work. I'd also have to remap the uppercase version of the above commands. – paldepind Dec 17 '11 at 14:40
  • 1
    When you type ``, you ask Vim to wait for another keypress. At that moment I don't think you can consider yourself in _NORMAL_ mode anymore, hence your _NORMAL_ mode mappings not working. – romainl Dec 17 '11 at 15:04
  • romainl: My bindings are definitely NOT normal mode mappings. They are the standard binding mode applying to both normal, visual and operator-pending mode. Normal mode bindings would have been `nnoremap`. – paldepind Dec 25 '11 at 16:59