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.

  • So i've done it. Do you know the answer? – atilkan Mar 6 '15 at 18:39
  • Did you try creating the KeyBindings folder? It may not be present by default. – tubedogg Mar 6 '15 at 18:39
  • I did that. And i already wrote it in the question. – atilkan Mar 6 '15 at 18:39
  • Your question does not make that clear. It sounds like you tried to do it, but stopped because that folder was not present. – tubedogg Mar 6 '15 at 18:40
  • Ok, edited. Do you know the answer? – atilkan Mar 6 '15 at 18:42
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"} },
  • Thanks for the answer. But i have switched to brackets. I needed some command for OS level. But thanks to Apple it is not possible. Thanks anyway. – atilkan Jun 4 '15 at 9:20
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.
  • Thanks. I will try when i get to office after 10 days. I don't have full keyboard currently. – atilkan Sep 19 '15 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 Sep 20 '15 at 1:56
  • Just for you to now, this is not working. Copy paste cat. – atilkan Oct 11 '15 at 3:38

You must log in to answer this question.

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