On Thu, Feb 05, 2015 at 03:04:13AM -0800, Enno wrote:
> Le samedi 23 octobre 2010 22:56:28 UTC+2, PabloHot a écrit :
> > I'm trying something like :map <C--> ... but just cannot get this to
> > work. I have tried using Ctrl-K to enter the '-' key, using
> > {minus}, but the mapping does nothing when I type it. If I map map
> > '-'
> >
> > on its own it works perfectly , but just cannot get it to work when
> > using the Ctrl key. Is this a bug, or a I an idiot? Please help!!!
>
> In Vim (under Linux and in urxvt), the map <ctrl-_> is triggered by
> hitting simultaneously Ctrl and -. In gVim (under Linux) it is
> triggered by hitting simultaneously Ctrl, Shift and -.
>
> Because, Shift+- = _, one could say that gVim does it right. However,
> at the same time in Vim AND gVim, the map <ctrl-^> is triggered by
> hitting simultaneously Ctrl and 6.
>
> Why is that?
For historical reasons[*] only the following Ctrl+punctuation sequences
are recognized by vim:
- Ctrl-@
- Ctrl-[ (same as <Esc>)
- Ctrl-\ (sends SIGQUIT by default)
- Ctrl-]
- Ctrl-^
- Ctrl-_
- Ctrl-? (same as <Backspace> or <Del>, depending)
[*] ASCII has 33 control characters: 0 through 31 and 127, represented
by ^@, ^A ... ^Z, ^[, ^\, ^], ^^, ^_, and ^?. Control keys in a
terminal emit those control characters. This is also why Vim can't
distinguish Ctrl-A from Ctrl-Shift-A.
There are some alternative ways of entering those control characters:
- Ctrl-Space inputs Ctrl-@
- Ctrl-` inputs Ctrl-@
- Ctrl-2 inputs Ctrl-@ (2 and @ are on the same key on US layouts)
- Ctrl-3 inputs Ctrl-[
- Ctrl-4 inputs Ctrl-\
- Ctrl-5 inputs Ctrl-]
- Ctrl-6 inputs Ctrl-^ (6 and ^ are on the same key on US layouts)
- Ctrl-7 inputs Ctrl-_
- Ctrl-8 inputs Ctrl-?
- Ctrl-/ inputs Ctrl-_
Different terminal emulators might behave differently.
Marius Gedminas
--
In modern best-practices Java it is no longer necessary or even possible to
write big piles of gratuitous OO spaghetti. Today, experienced Java programmers
build their applications on top of huge, industry-standard, highly polished
piles of architectural bullshit, wrestling with which leaves them with no time
to write any code of their own.
-- dkarl on HN
--
--
You received this message from the "vim_dev" 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
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.
signature.asc
Description: Digital signature
