Eric Leenman wrote:
Hi,

I'm trying to expand my use of GVIM also to Linux .
And I see that my mappings with CTRL and/or ALT and/or ARROW keys are handled
differently on because of the linux windows manager.

Does somebody knows which keys or key-combinations to avoid to create mappings
that work on WXP and Linux?
Should you never use ALT and/or CTRL in cross-platform mappings?

For example:
How should I remap
[...]

I think the safest keys to use are F2-F9, F11-F12, and Shift-F1 to Shift-F12 (that's 22 possibilities). (Yes, there used to be keyboards without F11-F12 but it's been decades since I've seen one.) F1 is of course Help, and F10 is the Menu key on some systems. Alt- appears as Esc in some terminals; and many Alt-Fn and Ctrl-Fn combinations are preempted by some window managers such as KDE's kwm (even with ":set winaltkeys=no") so that they are never seen by gvim but produce some other action such as "switch to virtual desktop 4" (Ctrl-F4) or "Run command or open URL" (Alt-F2). Printable keys and their Ctrl- variations are mostly already in use by Vim itself; and Alt+ printable key, when it isn't seen as Esc + something, can also be confused with the key for some printable character in the range 128-255 (accented letters etc.)

Now _which_ particular shortcut you assign to which particular function remains of course your own choice; and if 22 mappings aren't enough, you can also use one (or more) of them as a prefix for an unlimited number of additional multikey mappings (where all keys except the first can be anything, even letters and digits).


Best regards,
Tony.

Reply via email to