Xcode keyboard shortcut for scrolling down both cursor and line
Xcode

Assign some key combinations to the Scroll Line Up and Scroll Line Down actions:



Then install KeyRemap4MacBook and save a file like this as ~/Library/Application Support/KeyRemap4MacBook/private.xml:

&lt;?xml version="1.0"?&gt;
&lt;root&gt;
  &lt;appdef&gt;
    &lt;appname&gt;XCODE&lt;/appname&gt;
    &lt;equal&gt;com.apple.dt.Xcode&lt;/equal&gt;
  &lt;/appdef&gt;
  &lt;item&gt;
    &lt;name&gt;xcodearrows&lt;/name&gt;
    &lt;identifier&gt;xcodearrows&lt;/identifier&gt;
    &lt;only&gt;XCODE&lt;/only&gt;
    &lt;autogen&gt;__KeyToKey__ KeyCode::CURSOR_UP, VK_OPTION | ModifierFlag::NONE, KeyCode::CURSOR_UP, KeyCode::PAGEUP, ModifierFlag::CONTROL_L | ModifierFlag::OPTION_L&lt;/autogen&gt;
    &lt;autogen&gt;__KeyToKey__ KeyCode::CURSOR_DOWN, VK_OPTION | ModifierFlag::NONE, KeyCode::CURSOR_DOWN, KeyCode::PAGEDOWN, ModifierFlag::CONTROL_L | ModifierFlag::OPTION_L&lt;/autogen&gt;
  &lt;/item&gt;
&lt;/root&gt;


Then open the KeyRemap4MacBook application, press the ReloadXML button, and enable the setting.

Other applications

Create ~/Library/KeyBindings/ and save a property list like this like this as ~/Library/KeyBindings/DefaultKeyBinding.dict:

{
  "~\UF700" = (moveUp:, scrollLineUp:); // option-up
  "~\UF701" = (moveDown:, scrollLineDown:); // option-down
}


Then quit and reopen applications to apply the changes.

DefaultKeyBinding.dict stopped working in Xcode 4. See https://stackoverflow.com/questions/5626788/custom-key-bindings-xcode-4.

This would make option-up and option-down scroll eight lines and center the view around the caret:

{
  "~\UF700" = (moveUp:, moveUp:, moveUp:, moveUp:, moveUp:, moveUp:, moveUp, moveUp, centerSelectionInVisibleArea:);
  "~\UF701" = (moveDown:, moveDown:, moveDown:, moveDown:, moveDown:, moveDown:, moveDown, moveDown, centerSelectionInVisibleArea:);
  "~$\UF700" = (moveUpAndModifySelection:, moveUpAndModifySelection:, moveUpAndModifySelection:, moveUpAndModifySelection:, moveUpAndModifySelection:, moveUpAndModifySelection:, moveUpAndModifySelection, moveUpAndModifySelection);
  "~$\UF701" = (moveDownAndModifySelection:, moveDownAndModifySelection:, moveDownAndModifySelection:, moveDownAndModifySelection:, moveDownAndModifySelection:, moveDownAndModifySelection:, moveDownAndModifySelection, moveDownAndModifySelection);
}