Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I have an entry in my .vimrc which makes it page down the viewport when I hit the spacebar. It looks like this:

map <Space> <PageDown> 

I want to create another key mapping which pages the viewport up when holding shift and hitting the spacebar. I have tried the following entries:

map <Shift><Space> <PageUp> map <S-Space> <PageUp> 

Neither work. Anybody know how to achieve this functionality?

like image 208
jerodsanto Avatar asked Nov 11 '08 03:11

jerodsanto


1 Answers

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

like image 83
Zathrus Avatar answered Oct 10 '22 04:10

Zathrus