Friday, April 2, 2010

Re: ctrl-k mapping not working

On 04/02/10 15:17, Zhang Cheng wrote:
> I have these lines in my vimrc:
>
> nn <C-J> :bn<cr>
> nn <C-K> :bp<cr>
> imap <expr> <c-j> pumvisible()?"\<C-N>":"\<C-X><C-O>"
> imap <expr> <c-k> pumvisible()?"\<C-P>":"\<esc>"
>
> Everything works fine until today. I'm using gnome-terminal, and vim72,
> The c-j mapping works as expected, but whenever I press c-k, nothing
> happens,
> just like no key pressed. But everything is ok in gVim.
>
> :verbose nn <c-k> output:
> n <C-K> * :bp<CR>
> Last set from ~/.vimrc
>
> What's wrong with my vim? or something is wrong with my gnome-terminal?
>
> Thanks!

Sorry for answering so late.

In Insert/Replace or Command-line mode, Ctrl-K is a prefix key, used to
usher either a digraph (when followed by two printable keys) or the <>
notation for one non-printable key. The first of these two functions can
also be used for the argument of some Normal-mode commands such as r F f T t

See
:help i_CTRL-K
:help c_CTRL-K
:help 24.9
:help digraph.txt

If 'showcmd' is on (which is the default on Windows but not on Unix),
hitting Ctrl-K should display ^K near bottom right of the screen,
telling you that something more is expected.

AFAIK, this key is not remappable. Don't know if it's intended or an
oversight, but the help says that its operands are not considered for
mapping.


Best regards,
Tony.
--
Back up my hard drive? I can't find the reverse switch!

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

To unsubscribe, reply using "remove me" as the subject.

No comments:

Post a Comment