Contribute  :  Calendar  :  Advanced Search  :  Site Statistics  :  Directory  :  Files to download  :  Links for developers  :  Privacy policy  :  Web Resources  :  Polls  
    MacOSX Guru Site Information, tips and tricks, FAQ for Mac OS X developers    
 Welcome to MacOSX Guru Site
 Monday, July 24 2017 @ 03:43 PM BST

Problem with num keypad in vi(m) ?

   
LinuxYou connect to your Linux box thru PuTTY or Mac's Terminal application and numeric keypad doesn't work as you expected, entering meta key instead of the expected values (0,1,… ,+,-, …) ? Here is the solution…

create or edit if it already exists a .vimrc file in the user account and insert the following lines:

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>OR *
imap <Esc>OQ /
imap <Esc>Ol +
imap <Esc>OS -
nmap <Esc>Oq 1
nmap <Esc>Or 2
nmap <Esc>Os 3
nmap <Esc>Ot 4
nmap <Esc>Ou 5
nmap <Esc>Ov 6
nmap <Esc>Ow 7
nmap <Esc>Ox 8
nmap <Esc>Oy 9
nmap <Esc>Op 0
nmap <Esc>On .
nmap <Esc>OR *
nmap <Esc>OQ /
nmap <Esc>Ol +
nmap <Esc>OS -
smap <Esc>Oq 1
smap <Esc>Or 2
smap <Esc>Os 3
smap <Esc>Ot 4
smap <Esc>Ou 5
smap <Esc>Ov 6
smap <Esc>Ow 7
smap <Esc>Ox 8
smap <Esc>Oy 9
smap <Esc>Op 0
smap <Esc>On .
smap <Esc>OR *
smap <Esc>OQ /
smap <Esc>Ol +
smap <Esc>OS -
cmap <Esc>Oq 1
cmap <Esc>Or 2
cmap <Esc>Os 3
cmap <Esc>Ot 4
cmap <Esc>Ou 5
cmap <Esc>Ov 6
cmap <Esc>Ow 7
cmap <Esc>Ox 8
cmap <Esc>Oy 9
cmap <Esc>Op 0
cmap <Esc>On .
cmap <Esc>OR *
cmap <Esc>OQ /
cmap <Esc>Ol +
cmap <Esc>OS -
 

What's Related

Story Options

Problem with num keypad in vi(m) ? | 0 comments | Create New Account
The following comments are owned by whomever posted them. This site is not responsible for what they say.
 Copyright © 2017 MacOSX Guru Site
 All trademarks and copyrights on this page are owned by their respective owners.
Powered By Geeklog 
Created this page in 0.05 seconds