Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

When I use tabs in vim, I use the shortcut ctrl+pgup and ctrl+pgdn for navigating between tabs. I realize I can do :tabnext and :tabprev, but that is certainly more keystrokes.

Everything works fine until I'm running vim in a screen session. To reproduce:

touch .screenrc.tmp && screen -c .screenrc.tmp 

(launch screen with an empty screenrc)

then run:

vim -p file1 file2 

and attempt to navigate between tabs via ctrl+pgup and ctrl+pgdn. Some strange capitalization changes will happen too, if you have some text in either file.

screen version is 4.00.03jw4

vim version is 7.3.429


share|improve this question
The normal way to do this is gt and gT. Move forward or backwards a tab. Most likely pageup and pagedown are being interpreted differently in screen. – FDinoff Jul 23 '13 at 0:27
Awesome, thank you! :) – cat pants Jul 23 '13 at 16:46

Compare the t_kP option in each scenario. Vim in Xterm is ^[[5;*~; Vim in Screen is ^[[5~. When the latter value is used for that option, the escape sequence ^[[5;5~ isn't recognized as being ctrl-pageup. I always use xterm, so this plugin will set t_kP and other Vim terminal options so modified F keys, page up/down, etc. just work:

share|improve this answer

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.