sponsor Vim development Vim logo Vim Book Ad

fixkey : Use non-ASCII keys in console Vim

 script karma  Rating 30/9, Downloaded by 1450    Comments, bugs, improvements  Vim wiki

created by
Michael Henry
script type
Fixkey helps Vim use the non-ASCII keys of a terminal emulator, permitting
mapping of several classes of characters, including:

- Alt-lowercase letters (<M-a> - <M-z>).
- Alt-uppercase letters (<M-A> - <M-Z>), except <M-O> due to keycode
- Function keys with no modifiers or combinations of shift, control, and alt:
  <F1> - <F12>, <S-F1> - <S-F12>, ..., <M-C-S-F1> - <M-C-S-F12>.
  *Note* not all combination of terminal and environment send all of these.
- Arrow keys with no modifiers or combinations of shift, control, and alt:
  <Up>, <Down>, <Left>, <Right>, <S-Up>, <S-Down>, <S-Left>, <S-Right>, ...,
  <M-C-S-Up>, <M-C-S-Down>, <M-C-S-Left>, <M-C-S-Right>.
- Home and End keys with no modifiers or combinations of shift, control, and
  alt: <Home>, <End>, <S-Home>, <S-End>, ..., <M-C-S-Home>, <M-C-S-End>.
- <S-Enter> (few terminals).
- <M-Enter> (not all terminals).

Now, console Vim users can map keys like Gvim users, e.g.::

  " Map Alt-q to re-wrap a paragraph.
  :nnoremap <M-q> gqap

See documentation in doc/fixkey.txt for installation instructions and
terminal setup.

Developed by Michael Henry (vim at drmikehenry.com).

Distributed under Vim's license.

Git repository:   https://github.com/drmikehenry/vim-fixkey
install details

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
fixkey-0.3.8.zip 0.3.8 2016-10-05 7.0 Michael Henry Work around TERM=tmux issue with mis-detected mouse settings that interfere with proper operation of <Home> and <End> keys.
fixkey-0.3.7.zip 0.3.7 2016-03-13 7.0 Michael Henry Fixup function keys and navigation keys (home/end/arrows/etc.)
for xterm, konsole, and gnome-terminal.  This corrects a problem
with stock Fedora Linux vim, because Fedora patches Vim and
exchanges the definitions for <F1> through <F4> with <xF1>
through <xF4>.
fixkey-0.3.6.zip 0.3.6 2015-10-23 7.0 Michael Henry Support TERM=tmux.  Starting with version 2.1, tmux allows TERM to be "tmux" instead of just "screen".
fixkey-0.3.5.zip 0.3.5 2014-07-27 7.0 Michael Henry Add support for \"TERM=screen-it\" and similar (thanks to Kevin MacMartin) (updated for minor typo in documentation).
fixkey-0.3.3.zip 0.3.3 2014-05-17 7.0 Michael Henry Add support for overlooked PuTTY-SCO keys <F1> to <F12>.
fixkey-0.3.2.zip 0.3.2 2013-10-03 7.0 Michael Henry Documentation reorganization.
vim-fixkey-0.3.1.zip 0.3.1 2013-09-23 7.0 Michael Henry Restore cpoptions correctly.
vim-fixkey-0.3.0.zip 0.3.0 2013-08-25 7.0 Michael Henry Add support for more modifier keys.  Now all combinations of Shift, Control, and Meta work with function keys, arrows, and home/end (on supported terminals).
vim-fixkey-0.2.3.zip 0.2.3 2013-08-20 7.0 Michael Henry Add support for -bce and -s subvariants of screen (e.g., TERM=screen-256color-bce-s will now work).
vim-fixkey-0.2.2.zip 0.2.2 2013-08-18 7.0 Michael Henry Add support for <M-Enter>, <S-Enter> for some terminals
vim-fixkey-0.2.1.zip 0.2.1 2013-08-15 7.0 Michael Henry Initial upload
ip used for rating:

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
SourceForge.net Logo