Wednesday, December 20, 2006

Enable Shift-Space in XDvi for Page-Up

I use evince and xdvi for document viewing and I want the page navigation to be same: while both use Space for page down, the page up keys are difference (evince uses Shift-Space; xdvi uses Delete). This is how to set Shift-Space to act as page up for xdvi.

Add the following lines to ~/.Xresources (or ~/.Xdefaults).
xdvi.mainTranslations: #override\
Shiftspace: up-or-previous()\n\
space: unpause-or-next()\n
Then run the following command
xrdb ~/.Xresources
You're all set.

Some notes.
  1. The order is important. The translation table is searched from top to bottom, so if the line beginning space... appeared before the line Shiftspace..., then both Space and Shift-Space would trigger unpause-or-next().
  2. There are many other options for xdvi (and other programs) that can be set in ~/.Xresources. See the man page for xdvi for more information.