On my Lenovo T530 laptop, the PgUp and PgDown keys are right next to the arrow keys, which makes for very smooth code navigation. Unfortunately, the Home and End keys are far away, above the Backspace key to be precise.

Here's how to map Alt + PgUp -> Home and Alt + PgDown -> End in Ubuntu using xbindkeys.


Now paste the following into ~/.xbindkeysrc.

"xvkbd -xsendevent -text '\[Home]'""xvkbd -xsendevent -text '\[End]'"

Then start xbindkeys. You may need to add xbindkeys to the list of startup applications.