[comp.editors] Home, End, PgUp, PgDn Keys in vi - mapping

toneyc@ut-emx.uucp (toney cassel) (06/28/91)

Howdy, 
  I have examined my .exrc file and have noted the format used to map the arrow
keys for vi. I have not been able to determine how to map the Home, End, PgUp,
PgDn keys on the IBM PC-AT extended keyboard. Can anyone tell me what codes I
need to use, etc?

Thanks,
Toney...

system@alchemy.chem.utoronto.ca (System Admin (Mike Peterson)) (06/29/91)

In article <51379@ut-emx.uucp> toneyc@ut-emx.uucp (toney cassel) writes:
>  I have examined my .exrc file and have noted the format used to map the arrow
>keys for vi. I have not been able to determine how to map the Home, End, PgUp,
>PgDn keys on the IBM PC-AT extended keyboard. Can anyone tell me what codes I
>need to use, etc?

We do this using MS-KERMIT on the PC to change the characters sent by the keys
in the first place. The basic idea is:

; Home as H (go to top of page)
set key  \d327   \x48
set key  \d4423  \x48
; PgUp as ^B (up one page)
set key  \d329   \x02
set key  \d4425  \x02
; PgDn as ^F (down one page)
set key  \d337   \x06
set key  \d4433  \x06
; End as $ (go to end of line)
set key  \d335   \x24
set key  \d4431  \x24
; INS as i (insert)
set key  \d338   \x69
set key  \d4434  \x69
; DEL as x (delete character)
set key  \d339   \x78
set key  \d4435  \x78
; BS as BS (backspace)
set key  \d270   \x08
; + as + (next line, first non-white) 
set key  \d334   \x2B
; - as - (previous line, first non-white) 
set key  \d330   \x2D 
; Tab (->|) as HT (tab)
set key  \d271   \x09
-- 
Mike Peterson, System Administrator, U/Toronto Department of Chemistry
E-mail: system@alchemy.chem.utoronto.ca
Tel: (416) 978-7094                  Fax: (416) 978-8775