You can create ~/Library/KeyBindings/
and save a property list like this as DefaultKeyBinding.dict
:
{
"~l" = selectParagraph:;
"~z" = (selectParagraph:, delete:);
"~x" = (selectParagraph:, cut:);
"~c" = (selectParagraph:, copy:);
}
After reopening applications, for example ⌥L should select a line in most native text views. It doesn't work in Eclipse, Terminal, or Xcode though. For more information, see the Cocoa Text System article or my website.
Another option is to use KeyRemap4MacBook and save something like this as private.xml:
<?xml version="1.0"?>
<root>
<item>
<name>test</name>
<identifier>test</identifier>
<not>TERMINAL</not>
<not>EMACS</not>
<not>VIRTUALMACHINE</not>
<not>ECLIPSE</not>
<autogen>__KeyToKey__ KeyCode::L, VK_OPTION | ModifierFlag::NONE, KeyCode::A, ModifierFlag::CONTROL_L, KeyCode::E, ModifierFlag::CONTROL_L | ModifierFlag::SHIFT_L, KeyCode::CURSOR_RIGHT, ModifierFlag::SHIFT_L</autogen>
</item>
<item>
<name>test2</name>
<identifier>test2</identifier>
<only>ECLIPSE</only>
<autogen>__KeyToKey__ KeyCode::L, VK_OPTION | ModifierFlag::NONE, KeyCode::CURSOR_LEFT, ModifierFlag::COMMAND_L, KeyCode::CURSOR_RIGHT, ModifierFlag::COMMAND_L | ModifierFlag::SHIFT_L, KeyCode::CURSOR_RIGHT, ModifierFlag::SHIFT_L</autogen>
</item>
</root>
In most applications ⌃A moves to the start of an unwrapped line and ⌘← moves to the start of a wrapped line, but ⌃A doesn't seem to work in Eclipse.
See the source for the key code values and predefined settings.