lecoursen / mac-config

Some of the main configuration files I use on my work MacBook

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mac-config

The main configuration files I use for my work MacBook.

This repo contains the following config files:

  • Zsh shell configuration

    See its own README for details.

  • Karabiner key mapping configuration

    I have a lot of muscle memory from using Windows and Linux OSs and keyboards, and this makes it a lot easier.

    Although I previously remapped some of the modifier keys using the native MacOS Preferences interface, I now have implemented almost everything in my Karabiner configuration.

    • On my Windows keyboard, I have the modifier keys (Ctrl ⊞ Win Alt) remapped as the following:

      Physical keyboard key Mapped to MacOS...
      Ctrl ⌘ Command
      ⊞ Win ⌥ Option
      Alt ^ Control
    • On the built-in MacBook keyboard, I have the modifier keys (fn ^ Control ⌥ Option ⌘ Command) remapped as the following:

      Physical keyboard key Mapped to MacOS...
      fn ⌘ Command
      ^ Control fn
      ⌥ Option ⌥ Option
      ⌘ Command ^ Control

    I also have a few extra key combination shortcuts that do special things. For example, ⌥ Option(mapped)+Tab opens MacOS Mission Control, and a single press on ⌥ Option(mapped) is mapped to the keyboard shortcut to open Alfred.

    This karabiner/ directory is symlinked from ~/.config/karabiner.

  • MacOS key bindings for text navigation

    In addition to the above Karabiner settings to change keys, I have also changed some of the default MacOS keybindings to make keyboard text navigation behave more like Windows.

    This includes changing the behaviour of the Home and End keys to respectively move the cursor to the beginning and end of a line (and using Shift to select the text, if desired).

    Also, I have swapped the ⌘ Command/⌥ Option+ arrow keys behaviour: ⌘ Command(mapped)+/ now moves the cursor between words, and ⌥ Option(mapped)+/ moves to the start/end of a line (and Shift with both sets to select the text, if desired).

    This seems to work in most places in MacOS, except Electron-based apps (like VS Code, Atom, Slack, etc.). The editors like VS Code have their own keymaps, so I have also had to replicate this behaviour in the VS Code keymap settings. For apps that don't allow you to customise this, like Slack, I've had to resort to Karabiner rules.

    Place this file in the ~/Library/KeyBindings folder (you might need to create that folder).

    Inspiration from: https://damieng.com/blog/2015/04/24/make-home-end-keys-behave-like-windows-on-mac-os-x

  • iTerm2 configuration

    Especially for the colour palette that I really got used to when using Fedora, as well as some key mappings (as iTerm2 doesn't recognise/respect most custom DefaultKeyBinding.dict settings).

    Set the iTerm configuration to this file in iTerm2 > Preferences > General > Preferences > Load preferences from a custom folder or URL.

  • VS Code configuration

    The files that control the majority of my VS Code editor's configuration.

    These files/folders are symlinked from ~/Library/Application Support/Code/User/

    To get a list of extensions, I used this command: code --list-extensions > vs_code_extensions_list.txt

  • Firefox

    Mainly just userChrome.css, this configures some minor (mainly font) changes in the Firefox UI, aka the 'chrome'. The user profile location on macOS is ~/Library/Application Support/Firefox/Profiles/xxxxxxxx.default.

    See https://www.reddit.com/r/FirefoxCSS/ for some good tutorials and required settings for a custom userChrome.css.

  • Some other minor settings:

    • I use uBar as a Windows-like taskbar, so I have the MacOS Dock set to autohide on the right of the screen. This command sets the Dock to be less sensitive to appear, so it's less prone to accidental activation when I move the cursor near the right edge of the screen.

      defaults write com.apple.dock autohide-delay -float 0.20
      killall Dock

About

Some of the main configuration files I use on my work MacBook

License:GNU General Public License v3.0


Languages

Language:Shell 80.2%Language:CSS 8.6%Language:CoffeeScript 6.3%Language:Less 4.9%