How can I define a keyboard shortcut in Xcode to scroll down both the cursor and the line?
In Xcode's key bindings terms, this would be equivalent to performing "Scroll Line Down (Scrolling)" followed by "Move Down (Selection)". I'm looking for a way to define a keyboard shortcut which will perform both actions at once.
Best Answer
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
: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
: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: