Apple - Any other way to move cursor to the end of line, instead of <Cmd>+<right-arrow>

I am using Ctrl+e to move to the last letter and Ctrl+a to move to the first letter.

Remember that Emacs commands, work also in the Terminal.

An appropriate tool to modify shortcuts or keybindings is Karabiner. Be aware that until now (Dec 2016) the app is not compatible with 10.12 Sierra.

  1. So download and install the app (direct d/l link)
  2. Open in the menulet Karabiner -> Preferences
  3. Open the tab Misc & Uninstall
  4. Hit the button Open private.xml
  5. Open the file private.xml with an appropriate editor
  6. Enter a customized keycode. In my example I remapped the right command key to

    <?xml version="1.0"?>
        <name>Change Command R to Command L arrow</name>
        <autogen>__KeyToKey__ KeyCode::COMMAND_R, KeyCode::CURSOR_RIGHT, ModifierFlag::COMMAND_L</autogen>
        </item><!-- note the closing </item> tag-->
  7. Save the file

  8. Open in the menulet Karabiner -> Preferences the tab Change Key
  9. Hit the ReloadXML button
  10. Enable the remapping. It should be listed at the beginning.

Then you can't use the right command key for anything else, so choose the keys wisely!

If you replace the line starting with <autogen>__KeyToKey__ by this line:

    <autogen>__KeyOverlaidModifier__ KeyCode::COMMAND_R, KeyCode::VK_LAZY_COMMAND_R, KeyCode::CURSOR_RIGHT, ModifierFlag::COMMAND_L</autogen>

you can use the right command key almost as usual. Just hitting the key, will move the cursor to the end of the line.

You can also use the right alt/option key. Then replace COMMAND_R by OPTION_R and VK_LAZY_COMMAND_R by VK_LAZY_OPTION_R.