I'd like to map ":cprev" to <Shift-F4>
I use (in normal mode)
:map <S-F4> :cprev <CR>
But when I press the <Shift-F4> key, Vim displays the message 'Already
an oldest change'
Maybe, <Shift-F4> is a "reserved" combinaison key for Vim ?
if I try
:map <F4> :cprev <CR>
that works
what is wrong ?
you probably have a buffer-local mapping like
:map <buffer> <S-F4> u
defined somewhere. You can check this with
:map <S-F4>
This should show something like
<S-F4> @u
<S-F4> :cprev <CR>
The mapping with the ampersand is the buffer-local one and this takes
precedence over the second one.
If you want to know where the first mapping was defined execute
:verbose map <S-F4>
and you get something like
<S-F4> @u
Last set from c:\map_u.vim
<S-F4> :cprev<CR>
Regards,
Jürgen
--
Sometimes I think the surest sign that intelligent life exists elsewhere
in the universe is that none of it has tried to contact us. (Calvin)
> The mapping with the ampersand is the buffer-local one and this takes
> precedence over the second one.
>
> If you want to know where the first mapping was defined execute
>
> :verbose map <S-F4>
>
> and you get something like
>
> <S-F4> @u
> Last set from c:\map_u.vim
> <S-F4> :cprev<CR>
>
and ':verbose map <S-F4>' also displays 'No mapping found'
Maybe, the problem is around the SHIFT key
When I try to use Fx key (F2, ... F12) with the additionnal SHIFT key
for the :map function, it's failed
:map <F4> :do_something
:map <F...> :do_something
:map <F12> :do_something
all succeeded
but when I try
:map <S-F4> :do_something
:map <S-F...> :do_something
:map <S-F12> :do_something
all failed :-(
Check that the operating system isn't getting in the way: go to insert
mode and hit Ctrl-V Shift-F4. If you get <S-F4> then I would expect
the mapping to work.
Al
ludo wrote:
>
> Maybe, the problem is around the SHIFT key
> When I try to use Fx key (F2, ... F12) with the additionnal SHIFT key
> for the :map function, it's failed
> :map <F4> :do_something
> :map <F...> :do_something
> :map <F12> :do_something
> all succeeded
>
> but when I try
> :map <S-F4> :do_something
> :map <S-F...> :do_something
> :map <S-F12> :do_something
> all failed :-(
which system are you on? And what do you see when you enter
<C-V><F4>
and
<C-V><S-F4>
while you are in insert mode?
I use Vim 7.2 for cygwin with XP
I use Vim 7.2 for cygwin with XP
I have tried on my Debian with Vim 7.1 and the result is similar (:map
<S-F4> doesn't work)
when I hit 'Ctrl-V Shift-F4' => Vim displays ^[[26~
when I hit 'Ctrl-V F4' => Vim displays ^[[[D
Hm. What is 'term' set in each case. If it is set to different values
(let's assume "cygwin" and "xterm" for the sake of argument; but replace
them below if different), you should be able to cure the problem as follows:
if &term == 'cygwin'
set <S-F4>=^[[14~
elseif &term == 'xterm'
set <S-F4>=^[[[D
endif
where ^[ is obtained by hitting Ctrl-V followed by Esc.
Alternately, use gvim rather than Console Vim: there, your F keys ought
to be detected correctly.
Best regards,
Tony.
--
Fornication, n.:
Term used by people who don't have anybody to screw with.
thanks for your help