Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

Thanks!

share|improve this question
2  
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

1 Answer 1

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: https://github.com/godlygeek/vim-files/blob/master/plugin/terminalkeys.vim

share|improve this answer

Your Answer

 
discard

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.