/dotfiles

Sync all Dotfiles, Brew Binaries, Mac Apps, VSCode extensions with 1 command.

Primary LanguageShell

dotfiles

This is me managing my Dotfiles, Brew Binaries, Mac Apps, VSCode extensions

What My Setup Looks Like

CleanShot 2023-10-09 at 08 33 30@2x CleanShot 2023-10-09 at 08 34 03@2x

Warning

VSCode and iTerm are my two daily tools. I no longer use vim/nvim, nor never really understood how to get around efficiently, so all vim settings here will not really be maintained.

Quickstart

Install Homebrew1

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

(You might need a new terminal session for brew to be detected.)

git clone https://github.com/thiskevinwang/dotfiles.git
cd dotfiles
sh install.sh

sh install.sh

Run this to install all the things.

Vim/Neovim

To avoid vim errors / noise, for example, when using the interactive git rebase which runs in neovim for me, run:

nvim

this starts a neovim session:PlugInstall

This installs all the specified plugins
  • TODO: skip this manual step 👆

VSCode

TODOS

  • Programmatically install code CLI
  • Sync ~/.vscode/extentions

code CLI

Installing code CLI

  • In VSCode, + + p, search: "install code"

Allowing + K to clear the integrated terminal

In VSCode

  • + + p
  • search: ">Open Keyboard Shortcuts (JSON)"
[
  {
    "key": "cmd+k",
    "command": "workbench.action.terminal.clear",
    "when": "terminalFocus && terminalProcessSupported"
  }
]

Misc Machine Setup

Map Caps Lock () to Control ()

image

Option + Delete should delete words in terminal

Option == Opt/Alt on HHKB image

iTerm2 Colors

Download the *.itermcolors from https://github.com/cdalvaro/github-vscode-theme-iterm and import them via iTerm2

Settings → Profiles → Colors → Color Presets → Import...

Auto dark mode

# copy the below into clipboard
pbpaste > /Users/kevin/Library/Application\ Support/iTerm2/Scripts/AutoLaunch/auto_dark_mode.py
#!/usr/bin/env python3

import iterm2

async def main(connection):
    async with iterm2.VariableMonitor(connection, iterm2.VariableScopes.APP, "effectiveTheme", None) as mon:
        while True:
            # Block until theme changes
            theme = await mon.async_get()

            # Themes have space-delimited attributes, one of which will be light or dark.
            parts = theme.split(" ")
            if "dark" in parts:
                # name = "GitHub Dark Default"
                name = "GitHub Dark Dimmed"
                # name = "GitHub Dark High Contrast"
                preset = await iterm2.ColorPreset.async_get(connection, name)
            else:
                name = "GitHub Light Default"
                preset = await iterm2.ColorPreset.async_get(connection, name)

            # Update the list of all profiles and iterate over them.
            profiles = await iterm2.PartialProfile.async_query(connection)
            for partial in profiles:
                # Fetch the full profile and then set the color preset in it.
                profile = await partial.async_get_full_profile()
                await profile.async_set_color_preset(preset)

iterm2.run_forever(main)

Footnotes

  1. https://brew.sh/