Map Alt Combinations in Vim Rxvt

阅读更多
vim mingw rxvt alt meta

1. gVim won't have this issue, because gVim always handles 'Alt' byitself.


2. Check vim help, a lot of useful information:

:h :map-alt-keys

3. Basically if Alt combination do not work in your vim, it is because the 'meta8' -- the 8th bit of the input character code.
By default vim need it to identify whether you have pressed 'Alt'. But in some terminal or by your settings, rxvt, console or terminal don't set the meta8 when you press 'Alt', instead, they use a Escape sequence. i.e. 'Alt-a' will be translated to '^[a'.

4. Set up rxvt environment to use the 'meta8' apply one of the following:
  • a. start rxvt with '--meta8' option
  • b. add a line 'Rxvt.meta8:True' in your .Xdefaults
  • c. add following lines to your .inputrc: (*** not recommend ***)
  •  set meta-flag on
     set input-meta on
     set output-meta on
     set convert-meta on
  • d. use map Escape sequence to use Alt combination, see "Get Alt key to work in terminal" and 'How to Map Alt Key' in reference section

  • *** changing the behavior of your bash environment may affect or bring conflict to other programs in the environment

    5. Notes:
    Watch out your 'encoding' options

    Reference:
    Using alt key in console vim
    How to Map Alt Key
    Get Alt key to work in terminal

    你可能感兴趣的:(vim,PHP,Bash,BBS,Yahoo)