Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In my .vimrc file, I have the following two lines:

noremap! <C-PageDown> :bnext <CR>
noremap! <C-PageUp>   :bprev <CR>

but they do not work! In insert mode, typing




(literally) and similarly so for <C-PageUp> and if I try to execute the command I get


(plus a newline). In normal mode there's no effect. Thus, I know that the key map isn't being gobbled up by X or my shell but what else could be the problem? Other key maps work fine.

share|improve this question


noremap  <C-PageDown>           :bnext <CR>
noremap  <C-PageUp>             :bprev <CR>
inoremap <C_PageDown> <C-\><C-O>:bnext <CR>
inoremap <C_PageUp>   <C-\><C-O>:bprev <CR>

In insert mode, anything on the RHS of the key mapping is inserted literally so we need to use <C-O> which enters normal mode for a single command. The <C-\> prevents the cursor from moving leftward which occurs when invoking <C-O> at the end of a line.

Also note that you can't have a space between <C-O> and :bnext else it will be eaten by <C-O>.

share|improve this answer

Could it be, because this keys are already used by vim for switching tab pages? See the description in vims documentation

share|improve this answer
Well, not according to this (c.f. second paragraph under Unused Keys). – gvkv Sep 27 '10 at 10:38

The n in :noremap is for normal mode, so it won't work in insert mode. If you want it to work in insert mode, use :imap. If you were trying to use <C-V> to make it work in insert mode, I think you were looking for <C-O>.

share|improve this answer
No. That would be :nnoremap; two ns. – gvkv Sep 27 '10 at 10:26

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.