Skip to content

Instantly share code, notes, and snippets.

@bitc
Last active September 6, 2018 09:44
Show Gist options
  • Save bitc/5911010 to your computer and use it in GitHub Desktop.
Save bitc/5911010 to your computer and use it in GitHub Desktop.
How I Configure Mac OS X Keyboard

How I configure Mac OS X Keyboard

Start Synergy Client on login

"System Preferences" -> "Users & Groups" -> "Login Options" -> Enable "Automatic Login"

Create the following script as ~/start_synergy.sh:

#!/bin/sh

# Wait 10 seconds before actually starting the synergy client. This is needed
# to ensure that the computer is "warmed up" and that the network is ready

sleep 10

/Applications/Synergy.app/Contents/MacOS/synergyc 192.168.0.1

Make the script run during startup by creating the file ~/Library/LaunchAgents/viper.synergyc.plist (Replace "viper" with your username):

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>viper.synergyc</string>
    <key>ProgramArguments</key>
    <array>
        <string>/Users/viper/start_synergy.sh</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
</dict>
</plist>

A GUI program to manage LaunchAgents is Lingon

Swap Control and Command

This will make the standard keyboard shortcuts like Ctrl-c, Ctrl-a work.

If using Synergy: in the config swap Ctrl with Super

Make Home and End keys work normally

(From http://evansweb.info/2005/03/24/mac-os-x-and-home-end-keys)

Create a file ~/Library/KeyBindings/DefaultKeyBinding.dict with the following contents:

{
/* 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 */
}

Install iTerm2

For the terminal, we want Control to behave like Control (not Command)

The iTerm2 settings "Remap Modifier Keys" seems to only work with a hardware keyboard (not synergy), so we need another solution.

I add the following "Global Shortcut Keys":

  • Command-c: "Send Hex Codes: 0x03"
  • Command-d: "Send Hex Codes: 0x04"

For more: http://www.cs.tut.fi/~jkorpela/chars/c0.html

Configure XCode

Install this XCode plugin: https://github.com/insanehunter/XCode4_beginning_of_line

Description: "XCode 4 plugin to make HOME key jump to the first non-whitespace line of code"

TODO

  • MacVim Control Key
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment