Tuesday, June 15, 2010

Re: map ,... can't work except , why? Vista+gVim V7.2

On 15/06/10 06:49, William Fugy wrote:
> Hi list,
>
> Does anyone know why the following mapping can't work, and how to make
> it enable?
>
> " Windows Vista + gVim V7.2
> :map<C--> <C-W>w-
> :map<C-=> <C-W>w+
>
> ':map<C-->/<C-=>' and ':verbose map<C-->/<C--=>', it's OK. i.e.
> it's in the map list and hasn't been modified by others map.
>
> ------------------------------------------
> i tried any<C+Numeric key>, in main keyboard not in keypad, none
> could work except<C-6>(interior map by gVim self).
> While mapping<A-1>,<A-2>....<A-=>, all of them can work.
>
>
> Regards,
> -William
>

Because, in ASCII, they are not defined.

What you get when you hit Ctrl and 6 together is probably not Ctrl-6
(which is not defined) but Ctrl-^ (which is defined as 0x1E).

The only Ctrl+printable keys defined by ASCII (and therefore known by
Vim) are the following:

- Ctrl-? (control + Question-mark) is 0x7F (aka DEL)
- If X is in the range 0x40 to 0x5F (including all uppercase letters and
6 non-alphabetic characters) then Ctrl-X = X - 0x40 (eks minus hex-40)
- If x is a lowercase letter, then Ctrl-x is the same as Ctrl+ upcase(x)

That's all. The digits are 0x30 to 0x39 so they aren't included in any
of the above cases, and Ctrl+digit is not defined.

OTOH, if X is in the range 0x00 to 0x7F, Alt+x is x + 0x80. This means
that every 7-bit ASCII character has an Alt counterpart in the upper
half of the Latin1 character set. However, it also means that if you use
accented letters, you should avoid using Alt+something as the {lhs} of
an Insert-mode mapping. For example, to Vim, é (small-e-acute) is the
same as Alt-i (Alt with small-i), so if you map Alt-i to do something,
Vim will also do it when you hit é (similarly, see above paragraphs, for
Tab and Ctrl-I, Esc and Ctrl-[, Enter and Ctrl-M).

Note that the Alt modifier is case-sensitive while the Ctrl modifier isn't.


Best regards,
Tony.
--
For a man to truly understand rejection, he must first be ignored by a
cat.

--
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: