I've just started learning Vim. I use Vim in gnome-terminal (on Ubuntu 14.04). I want to map kj keys to Esc in my vimrc file. I added the following two lines in my vimrc file (~/.vimrc):
inoremap kj <Esc>
cnoremap kj <Esc>
Question 1: I sourced my vimrc file (even restarted the terminal), but when I quickly type kj in insert mode, it just types those two letters kj and does not go to normal mode. Am I doing something wrong? What is the correct way to map Esc key to something else?
Question 2: How should I edit my vimrc to map caps key to Esc?
In Vim,
:echo $COLORTERM
displays 'gnome-terminal'
For reference, here is my complete vimrc file (without comments):
set t_Co=256
colorscheme wombat256mod
syntax on
set hlsearch
set incsearch
set number
set autoindent
set ts=4
set ignorecase
set title
set scrolloff=5
" Map <ESC> key to kj
inoremap kj <Esc>
cnoremap kj <Esc>
set paste
set cursorline