Skip to content

Instantly share code, notes, and snippets.

@thiagosf
Created January 28, 2018 18:21
Show Gist options
  • Select an option

  • Save thiagosf/ec43382dc2ca720a3601efc9b8c2362f to your computer and use it in GitHub Desktop.

Select an option

Save thiagosf/ec43382dc2ca720a3601efc9b8c2362f to your computer and use it in GitHub Desktop.

Revisions

  1. thiagosf created this gist Jan 28, 2018.
    32 changes: 32 additions & 0 deletions home-end-fix.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,32 @@
    # How to fix home and end keys on Mac OS X

    Open a terminal:

    ```
    $ cd ~/Library
    $ mkdir KeyBindings
    $ cd KeyBindings
    $ vi DefaultKeyBinding.dict
    ```

    Copy/paste the following lines:

    ```
    {
    /* Remap Home / End keys to be correct */
    "\UF729" = "moveToBeginningOfLine:"; /* Home */
    "\UF72B" = "moveToEndOfLine:"; /* End */
    "$\UF729" = "moveToBeginningOfLineAndModifySelection:"; /* Shift + Home */
    "$\UF72B" = "moveToEndOfLineAndModifySelection:"; /* Shift + End */
    "^\UF729" = "moveToBeginningOfDocument:"; /* Ctrl + Home */
    "^\UF72B" = "moveToEndOfDocument:"; /* Ctrl + End */
    "$^\UF729" = "moveToBeginningOfDocumentAndModifySelection:"; /* Shift + Ctrl + Home */
    "$^\UF72B" = "moveToEndOfDocumentAndModifySelection:"; /* Shift + Ctrl + End */
    }
    ```

    Save the file and restart your computer.

    Enjoy your home and end keys!

    Credits: https://www.jvandemo.com/how-to-fix-home-and-end-keys-on-mac-os-x/