5

I want to change the Home and End keys to work like Windows/Linux.

CHANGE:

Home to Command-Left Arrow. // Beginning of the line

End to Cmd-Right Arrow. // End of the line

I tried using Karabiner app known as KeyRemap4MacBook. But it doesn't work on Yosemite while I write code on editors like Sublime Text, PhpStorm, WebStorm, etc.

I also did create a DefaultKeyBindings.dict file (with proper settings) inside ~/Library/KeyBindings/ and OSX/Library/KeyBindings/.

So, is there a way to remap the Home and End keys for glabally on my mac. I could use Terminal command too. I don't want an app for that.

0

2 Answers 2

3

You might have to change the custom settings in the Terminal app. But it's quite straight forward. See here: http://fdiv.net/2007/05/12/keybindings-in-macosx-terminal-app

I also changed it for my Sublime Text 2:

   { "keys": ["home"], "command": "move_to", "args": {"to": "bol"} },
   { "keys": ["end"], "command": "move_to", "args": {"to": "eol"} },
0
1
+25

It is possible to achieve this behavior using Karabiner (I know you tried already, but please read). I use it extensively on Yosemite (10.10.2)

Optional (can't remember if is 100% necessary), but follow just in case:

  • Add Karabiner_AXNotifier.app on System Preferences > Security & Privacy > Privacy (tab or horizontal menu on top) > Accessibility (left column)

Then:

  1. Open Karabiner preferences and go to the ‘Misc & Uninstall’ tab.
  2. Click the ‘Open private.xml’ button (under ‘Custom Settings’)
  3. Add this content to private.xml (create the file if doesn't exist):

    <?xml version="1.0"?>
    <root>
        <item>
          <name>Fix Home/End</name>
          <appendix>(Home/End move to beg/end of line, Ctl/Cmd+Home/End move to beg/end of page)</appendix>
          <identifier>remap.app_firefox_fix_home_end</identifier>
          <only>FIREFOX, THUNDERBIRD</only>
          <autogen>__KeyToKey__ FROMKEYCODE_HOME, MODIFIERFLAG_EITHER_LEFT_OR_RIGHT_COMMAND, KeyCode::CURSOR_UP,   ModifierFlag::COMMAND_L</autogen>
          <autogen>__KeyToKey__ FROMKEYCODE_HOME, MODIFIERFLAG_EITHER_LEFT_OR_RIGHT_CONTROL, KeyCode::CURSOR_UP,   ModifierFlag::COMMAND_L</autogen>
          <autogen>__KeyToKey__ FROMKEYCODE_END,  MODIFIERFLAG_EITHER_LEFT_OR_RIGHT_COMMAND, KeyCode::CURSOR_DOWN, ModifierFlag::COMMAND_L</autogen>
          <autogen>__KeyToKey__ FROMKEYCODE_END,  MODIFIERFLAG_EITHER_LEFT_OR_RIGHT_CONTROL, KeyCode::CURSOR_DOWN, ModifierFlag::COMMAND_L</autogen>
          <autogen>__KeyToKey__ FROMKEYCODE_HOME, KeyCode::CURSOR_LEFT, ModifierFlag::COMMAND_L</autogen>
          <autogen>__KeyToKey__ FROMKEYCODE_END, KeyCode::CURSOR_RIGHT, ModifierFlag::COMMAND_L</autogen>
        </item>
    </root>
    
  4. Return to the ‘Change Key’ tab.

  5. Click the ‘Reload XML’ button.
  6. Search for ‘System-wide’ in the search box and check the ‘Fix Home/End System-wide’ (I named it this way to make it easier for you to activate)
  7. Try the Home/End keys.
2
  • Thanks. I will try when i get to office after 10 days. I don't have full keyboard currently.
    – atilkan
    Commented Sep 19, 2015 at 1:11
  • The solution you found is from OS X Lion. Yosemite is very different. I open bounty again and give you if it is working. Sorry i am agnostic.
    – atilkan
    Commented Sep 20, 2015 at 1:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .