Yakov Lerner wrote:
On 9/24/06, Meino Christian Cramer <[EMAIL PROTECTED]> wrot> Hi,
VimTip 979 suggests to do the following mapping:
nmap <Space> /
nmap <C-Space> ?
. I wanted to try that and wrote the sequence into my .vimrc.
The first mapping works nice, but the second doesn nothing.
I tried to figure out what happens (or what do not happen...) and
used the Ctrl-k trick I learnd here. But it shows that the problem
is some levels down.
I used xkeycaps and it shows, that Ctrl-Space isn't recognized at all
and Shift-Space does the same as Space.
Before I shoot into my own feet and render my computer useless by
screwing up the keyboard interface:
1.) Is it possible and sane to map S-Space and C-Space to something
(and what ?) with xkeycaps ?
Try 'man xmodmap'.
The following actions can/will lead to the solution:
1) Choose new unique escap-sequence, unused by other
control keys; for example <Esc>)1 (I don't really know if this is
unique...)
2) Tell xmodmap to send this key sequence for Ctrl-Space
3) In vim, map <Esc>)1 to the rhs of your choice.
Repeat for Shift-space.
Note that in this scenario, vim doesn't really know that <Esc>)1 is
Ctrl-Space, but nevertheless the whose conspiracy works.
Hope it helps
Yakov "ignorecase" Lerner
Note that since xmodmap doesn't know about Vim modes, if you hack the
Shift-Space combo -- e.g. telling xmodmap to send <Esc>)2 -- you'll need to add
:map! <Esc>)2 <Space>
in order to be able to use the space bar to insert spaces within a string of
capitals in Insert/Replace/Command-line mode without lifting your finger off
the Shift key.
Best regards,
Tony.