Saturday, September 3, 2011

Re: Problem mapping Ctrl+Alt combinations in GVIM on windows

-------- Original Message --------
Subject: Re: Problem mapping Ctrl+Alt combinations in GVIM on windows
Date: Fri, 2 Sep 2011 15:26:35 -0700 (PDT)
From: William E. Skeith III <wes_zilla@yahoo.com>
Reply-To: vim_use@googlegroups.com
To: vim_use@googlegroups.com <vim_use@googlegroups.com>

On 02/09/11 19:59, William E. Skeith III wrote:

> Hello,
>
> I am trying to map some basic Ctrl+Alt key combinations for GVIM on windows,
> for example>
> :imap<C-M-L> <C-Right>
>
> but I've become seriously stuck. It seems that windows GVIM does not respond
> at all to<C-M-x>, where x is virtually any printable character (0-9,a-z,
> punctuation, etc.).
>
> To test, I hit ctrl-Q while in insert mode, and then ctrl-alt-x key
> combinations, (as described above) and nothing happens at all. However, it
> does respond to other non-printable keys, for example<M-C-Left>, but that's
> about it.
>
> Can anyone else confirm this to be the case? And if so, are there any
> work-arounds? Key combinations like that would be extremely useful for me...
> By the way, I'm using version 7.3.46, installed just a few days ago.
>
> Many thanks in advance for your help.
>
> -WES
>

Ctrl-Alt-letter keys may be preempted by the OS, or they may trigger a menu.

When you type
:verbose set wak?

what is the answer?

Oh, and 7.3.046 is already old hat: for W32 I recommend the "Vim without
Cream" distribution, available as gvim-<version>.exe (a self-installer,
currently for 7.3.289) at http://sourceforge.net/projects/cream/files/


Best regards,
Tony.

============================================
Hi Tony,

Thanks for the quick response! I had already discovered the issue with menu
interference, so I have set winaltkeys=no from my vimrc. This problem does
seem a little conspicuous to me, since it is not just some keys, but _every_
key. GVIM is only responding to <M-C-k> if k is an arrow key, or some other
control key like <BS>,<Del>,<Ins>.

I will upgrade as you suggested, and see if that helps...
Thanks again.

-WES

Hm, if Ctrl-V (or Crl-Q if you use Ctrl-V to paste) followed by
Ctrl-Alt-<letter> fails to elicit any response (with 'showmode' on, the
^V or maybe ^Q remains in the lower right corner, and nothing appears in
the buffer), then for some reason Vim doesn't get that key. Maybe the OS
snatches it, I don't know. It might be better in gvim than in Console
Vim, but no guarantee.

In general, the "best" keys for the {lhs} of a mapping (keys which Vim
will receive and which don't already have a preset binding) are the
function keys, F2 to F12 (F1 is already Help, and F10 may or may not be
a Menu key), then after that on many systems Shift-F1 to Shift-F12 (on
Linux, Ctrl-F1 to Ctrl-F12 are usually reserved by the window manager
for its own purposes, but if you run Vim only on Windows they should be
usable too).


Best regards,
Tony.
--
If the colleges were better, if they really had it, you would need to
get the police at the gates to keep order in the inrushing multitude.
See in college how we thwart the natural love of learning by leaving
the natural method of teaching what each wishes to learn, and insisting
that you shall learn what you have no taste or capacity for. The
college, which should be a place of delightful labor, is made odious
and unhealthy, and the young men are tempted to frivolous amusements to
rally their jaded spirits. I would have the studies elective.
Scholarship is to be created not by compulsion, but by awakening a pure
interest in knowledge. The wise instructor accomplishes this by
opening to his pupils precisely the attractions the study has for
himself. The marking is a system for schools, not for the college; for
boys, not for men; and it is an ungracious work to put on a professor.
-- Ralph Waldo Emerson

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: