The shortcuts for each application can be easily changed in the very preference menu you mentioned.
Which shortcuts can be changed is determined by what options are in that application's menu. So for Finder, you can customize "New Finder Window" and etc. etc. whatever is in the menu.
To change the shortcut for "Open" (which happens to be Finder -> File -> Open in the menu) you go to the System Preferences Keyboard Shortcuts, go to Application shortcuts, find "Finder", press the "+" button, and add a new option with name "Open" (exactly spelled as the menu option) and enter a keyboard shortcut.
Note that you can't use the enter key or anything: you can only use the modifier keys (shift, command, control, fn) and numbers or letters.
For general shortcuts you can scroll up into "All Applications" and add a shortcut for "Copy" or "Paste" or which will toggle for whichever application has that menu option in its menu.
EDIT: Response to comments:
1) If you can't find the exact name of a menu command or if there isn't a menu command... well, you just can't set a shortcut unless you use some kind of a third party application that intercepts keystrokes (kinda like AutoHotKey but on Mac). Thus for Quick Look, it doesn't work since the menu command (there is a menu option for it in Finder File->Quick Look) adds the name of the file to be "Quick Looked", e.g. "Quick Look 133.png." I believe in Leopard it may have worked if one just set "Quick Look" to whatever shortcut under Finder, but it doesn't work in SL for me.
2) Screen Capture Cmd+Shift+3 is universal: it's a full screen screenshot. Cmd+shift+4 is similar except it lets you select a box to screen shot. I'm not sure what you mean which shortcuts are for which apps... Either it's listed under the app (in the preferences) or it's universal and applies to either every application with the menu option or the system itself.
EDIT 2: I'll add even more when I have time
a) To my knowledge CUSTOM keyboard shortcuts are stored in com.apple.universalaccess.plist and com.company.application.plist (e.g. com.apple.finder.plist) located in the ~/Library/Preferences folder.
com.apple.universalaccess.plist lists the apps with custom shortcuts:
com.apple.finder.plist lists the actual custom shortcuts for finder under NSUserKeyEquivalents:
EDIT 3:
b) I believe that the default shortcuts for Cocoa apps are stored in the nib files, for example ../Finder/Contents/Resources/English.lprog/MenuBar.nib
or seomthing like that. I've successfully edited these nib files MANUALLY using interface builder to change the keyboard shortcuts for the menu bar items. (Whether there are shortcuts that are not menu bar items and not defined by the system I don't know) Thus I don't know of any command line way either...
The nib:
I don't know whether this serves your purpose well. As a side note, for completeness, to edit a compiled nib file like those of finder... is an entirely different answer on its own. This article sums it up well. Basically you work with an uncompiled nib to edit a compiled nib: If you undertake this journey and have trouble finding an uncompiled nib I've uploaded one here.
If I ever find a command line method or learn more about where applications store keyboard shortcuts I will update this answer accordingly.
EDIT: Final Note
These nibs are in xml format or something and can be opened by text editors... that might allow for... I don't know. :D
The default shortcuts for moving to beginning or end of (wrapped) lines are ⌘← and ⌘→. ⌥↑ and ⌥↓ or ⌃A and ⌃E move to the beginning or end of unwrapped lines (or paragraphs). ⌥← and ⌥→ move backwards/forward by words, and all of these are compatible with holding Shift to select during the corresponding moves.
You could remap home and end by creating ~/Library/KeyBindings/
and saving a property list like this as DefaultKeyBinding.dict
:
{
"\UF729" = moveToBeginningOfLine:; // home
"\UF72B" = moveToEndOfLine:; // end
"$\UF729" = moveToBeginningOfLineAndModifySelection:; // shift-home
"$\UF72B" = moveToEndOfLineAndModifySelection:; // shift-end
}
Most of the keybindings for editing text in OS X are defined in /System/Library/Frameworks/AppKit.framework/Resources/StandardKeyBinding.dict
.
Applying changes requires reopening applications. DefaultKeyBinding.dict is ignored by some old versions of Xcode (works with latest version 6.3.1), Terminal, and many cross-platform applications.
See Cocoa Text System and my website for more information about the customizable keybindings.
Terminal's keybindings can be customized in Preferences > Settings > Keyboard. \033OH
moves to the beginning of a line and \033OF
to the end of a line.
In Eclipse, key bindings should be modified in Preferences > General > Keys. You need to modify default bindings for commands Line Start and Line End (replace ⌘← by ↖ and ⌘→ by ↘). For selection to work, also modify Select Line Start and Select Line End.
PS: You may need to logout and login again for the ~/Library/KeyBindings/DefaultKeyBinding.dict
change to take effect.
Best Answer
I remember having the same problem in some apps after upgrading to Lion. A reboot fixed it for me.
Workaround: use Ctrl+A (instead of ⌘+←) to move the cursor to the beginning of the line and Ctrl+E to move the cursor to the end of the line (instead of ⌘+→). This works in all Cocoa-based applications.