Better touch typing in vim 17 Jul 2015

Lately I wasn’t happy with the way I did touch typing. I discovered, that I had no problem to touch type prose. But as soon as I wrote code I did not completly commit to touch typing.

Typing special characters became easier after I switched to the US keyboard layout. A lot of developers I know use the US keyboard layout. So this shouldn’t be big news. German umlauts work with <alt-u>[auo]. More details at osxdaily.com.

However I still had problems keeping my hands in the home row. This had mainly to do with exiting insert mode in vim with <esc>.

Then I found out that it’s also possible to quit insert mode by pressing <ctrl-c>. With <ctrl-c> it’s far easier to return to the home row. Check out :help i_CTRL-C.

The second problem I discovered was pressing backspace to delete text. In insert mode the last word can be deleted with <ctrl-w> and the last character with <ctrl-h>. Check out :help i_CTRL-W and :help i_CTRL-H.

These shortcut make it easier for me to keep my hands on the home row.

However I still have to unlearn the old habbit of pressing escape or backspace. Therefore I disabled the escape and the backspace button in vim.

inoremap <esc> <nop>
inoremap <BS> <nop>

You can find this in my .vimrc in my dotfiles repository.