
Numeric keypad in iTerm with viWell ... this frustrated the heck out of me and consumed most of my morning. Here's the issue:I'm using iTerm with on Mac OS X (Panther). When I used vi, on either a remote or local machine, my numeric keypad was outputting q, r, s, along with some control characters. Because of the way it was acting, I assumed that it was outputting control characters of some kind. Turns out that the numeric keypad "1" was sending "
1. It seemed to only affect iTerm. GLTerm worked fine. ...this would seem indicate to me that it's an issue with iTerm.
...see my troubleshooting problem? :) Long story short, after much fruitless googling, I finally was able to find something that would work for me. I don't think it really fixes the problem, it seems like more of a bandaid, but none the less it works.
I modified my /etc/vimrc from:
if &term=="xterm"
set t_Co=8
set t_Sb=^[4%dm
set t_Sf=^[3%dm
endif
Note: This was on a linux machine (FC1). This didn't exist on my mac. To:
if &term=="xterm" || &term=="xterm-color"
set t_Co=8
set t_Sb=^[4%dm
set t_Sf=^[3%dm
:imap <Esc>Oq 1
:imap <Esc>Or 2
:imap <Esc>Os 3
:imap <Esc>Ot 4
:imap <Esc>Ou 5
:imap <Esc>Ov 6
:imap <Esc>Ow 7
:imap <Esc>Ox 8
:imap <Esc>Oy 9
:imap <Esc>Op 0
:imap <Esc>On .
:imap <Esc>OQ /
:imap <Esc>OR *
:imap <Esc>Ol +
:imap <Esc>OS -
endif
This fixed the problem both on Linux, and on my Mac. I'm not sure if it's the correct way to fix the issue, but it seemed to work.
Also, if you miss syntax highliting, you may want to add this: :syntax enable
Update: In OS X Tiger, this file in /usr/share/vim/vimrc Created by swannie on 2005-04-11 13:26:55, modified by swannie on 2005-06-21 19:19:23.
|
| Home > Linux > Mac OS X > Numeric keypad in iTerm with vi |