cross-platform mappings

2006-08-17 Thread Eric Leenman

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


noremap C-Left  b
inoremap c-\c-n C-left

noremap C-Right w
inoremap c-\c-n C-Right


 ALT - to make from current pos till begin-of-line everything lower case
 To keep the cursor position it's prepend with mz (mark pos with z)
 and append with `z (go to mark z) (notice the backtick `[located under
 the ESC-key] is used, not a single quote sign ')
noremap M-Left  mzgu0`z
inoremap c-\c-n M-left

 ALT - to make from current pos till eol everything lower case 
noremap M-Right mzgu$`z
inoremap c-\c-n M-Right

 ALT-SHIFT - to make from current pos till bol everything upper case
noremap M-S-Left  mzgU0`z
inoremap c-\c-n M-S-left

ALT-SHIFT - to make from current pos till eol everything upper case
noremap M-S-Right mzgU$`z
inoremap c-\c-n M-S-Right



Best regards,
Eric

_
Express yourself instantly with MSN Messenger! Download today - it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/




Re: cross-platform mappings

2006-08-17 Thread A.J.Mechelynck

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.