* Clark J. Wang <[email protected]> [2012-01-16 10:50]: > When using the Vim editor I have following mapping configured in my vimrc: > > inoremap jj <ESC> > > so I can press `jj' (easier than <ESC>) to go to NORMAL mode from INSERT > mode when editing files. > > I know ksh93 have the KEYBD trap but I don't know how to use it to meet my > requirement. So any one has any idear?
vim uses a timeout for such mappings so that you can still type in two consecutive "j" if you type slowly. While the KEYBD trap can be used for processing arbitrary long key combinations, it is not possible to implement a timeout which means you'd loose the ability to type in a regular "j". For mapping single keys see the keybind script from the ksh book (http://kornshell.com/examples/keybind), for mapping keys that send control sequences I've written a small framework that I could make available although it is probably only useful for mapping otherwise unused keys or key combos (e.g. F1 or Insert) due to the above limitations. -- Guido Berhoerster _______________________________________________ ast-users mailing list [email protected] https://mailman.research.att.com/mailman/listinfo/ast-users
