52

My numpad works in iterm2 (bash), but it inserts characters instead of numbers in insert mode for vim.

How can I get vim to recognise the correct escape codes.

I have tried editing the escape codes as suggested here without any luck: http://code.google.com/p/iterm2/issues/detail?id=702

J0hnG4lt
  • 1,591
  • 1
  • 11
  • 16

4 Answers4

86

Looks like the answer is to go into Preferences->Profiles->Keys and load preset of: "xterm with Numeric Keypad".

J0hnG4lt
  • 1,591
  • 1
  • 11
  • 16
22

For me the solution was disabling VT100 Application Keypad-Mode in Preferences > Profiles > Advanced.

Rob Johansen
  • 103
  • 3
mansur
  • 339
  • 2
  • 3
14

You can add global keyboard shortcuts in Preferences -> Keys and map the numpad characters to "Send Text" actions to send the text they are supposed to send.

iTerm2 keys preferences

gitaarik
  • 640
  • 8
  • 18
8

but it removes some colors in my vim.

if you just need it some times, just type:

:set term=ansi

in VIM

Best regards

OskarStark
  • 191
  • 1
  • 4