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

Max Cameron
  • 1,601

4 Answers4

86

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

Max Cameron
  • 1,601
22

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

mansur
  • 339
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
  • 720
  • 8
  • 19
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