vim tip: Fix the cursor keys echoing characters in insert mode

Occasionally you'll log into a remote server and find that the cursor keys echo characters when you are in insert mode using vim. Here's how to resolve it by modifying your vimrc configuration file:

  1. vim ~/.vimrc
  2. i (Enter insert mode)
  3. set t_ku= (now type Ctrl-V and press cursor up)
  4. set t_kd= (now type Ctrl-V and press cursor down)
  5. set t_kr= (now type Ctrl-V and press cursor right)
  6. set t_kl= (now type Ctrl-V and press cursor left)
  7. Press escape to exit insert mode
  8. Ctrl-zz (Saves the file and exits vim)