How can I make shift+spacebar page up in Vim?

You cannot. CMS's solution will work for gVim, but not in vim because terminals cannot distinguish between <Space> and <S-Space> because curses sees them the same. It might be possible in the future if vim gains libtermkey support and your terminal supports the proper <CSI> sequences (xterm does if properly configured; nothing else does yet).


If you are using vim inside iTerm2 you can map shift-space to ctrl+U by sending the hex key 15. Here's a screen shot:

enter image description here

To look up a hex code for a ctrl+letter combination, for example ctrl+u, you can do the following:

  • In vim enter the insert mode
  • Hit ctrl+v then ctrl+u then ctrl+c then ga
  • various numerical representations will print at the bottom

You can apply this idea to other terminal emulators that support key mapping.


Use this:

map <Space> ^D   " Pagedown when press Space
map <S-Space> ^U " Page Up when press Shift Space

To get the ^D and ^U symbol correctly just press Control-V Control-D, and Control-V Control-U