~ v3

Hej 👋 welcome to computer.mads-hartmann.com. I use this little site to jot down notes about my computer. How it’s configured, what applications I use, and how I use them. It contains a little guide for bootstrapping new computers but mostly this is for documenting how I use my computer; documenting things helps me think.

Gitpod

I do 99% of my development using Gitpod. I use the Dotfiles feeature to load my Gitpod specific dotfiles from mads-hartmann/gitpod-dotfiles.

VSCode

Extensions

This list is not comprehensive at the moment. The extensions are alphabetically sorted.

Keybindings

keybindings.json
[
    ////////////////////////
    // Coding
    ////////////////////////
    // the default is mapped to ⌘+. but I use that for Raycast.
    {
        "key": "ctrl+.",
        "command": "editor.action.quickFix"
    },
    ////////////////////////
    // Terminal 
    ////////////////////////
    {
        "key": "cmd+n",
        "command": "workbench.action.terminal.new",
        "when": "terminalFocus"
    },
    // This enables closing terminal tabs when using the build-in terminal in the panel. 
    // The !terminalEditorFocus ensure that it doesn't interfere with the default system 
    // binding for closing terminals that are shown in editor groups.
    {
        "key": "cmd+w",
        "command": "workbench.action.terminal.kill",
        "when": "terminalFocus && !terminalEditorFocus"
    },
    {
        "key": "cmd+[Backquote]",
        "command": "workbench.action.focusActiveEditorGroup",
        "when": "terminalFocus"
    },
    {
        "key": "ctrl+x 3",
        "command": "workbench.action.terminal.split",
        "when": "terminalFocus"
    },
    {
        "key": "ctrl+x 2",
        "command": "workbench.action.terminal.split",
        "when": "terminalFocus"
    },
    ////////////////////////
    // Window Management 
    ////////////////////////

    // ⌘+<number> has become the default way to navigate to tabs in macOS
    {
        "key": "cmd+1",
        "command": "workbench.action.openEditorAtIndex1"
    },
    {
        "key": "cmd+2",
        "command": "workbench.action.openEditorAtIndex2"
    },
    {
        "key": "cmd+3",
        "command": "workbench.action.openEditorAtIndex3"
    },
    {
        "key": "cmd+4",
        "command": "workbench.action.openEditorAtIndex4"
    },
    {
        "key": "cmd+5",
        "command": "workbench.action.openEditorAtIndex5"
    },
    // Matches macOS default better
    {
        "key": "ctrl+tab",
        "command": "workbench.action.nextEditorInGroup"
    },
    {
        "key": "ctrl+shift+tab",
        "command": "workbench.action.previousEditorInGroup"
    },
    // Focus the terminal - there's a similar binding for when the terminal is in focus above
    {
        "key": "cmd+[Backquote]",
        "command": "terminal.focus",
        "when": "!terminalFocus"
    },
    // Emacs-like ways of managing editor groups (frames in Emacs-speak)
    {
        "key": "ctrl+x 2",
        "command": "workbench.action.splitEditorDown",
        "when": "!terminalFocus"
    },
    {
        "key": "ctrl+x 3",
        "command": "workbench.action.splitEditorRight",
        "when": "!terminalFocus"
    },
    {
        "key": "ctrl+x b",
        "command": "workbench.action.quickOpenPreviousRecentlyUsedEditor"
    },
    {
        "key": "ctrl+x o",
        "command": "workbench.action.focusNextGroup"
    },
    {
        "key": "ctrl+x 0",
        "command": "workbench.action.closeEditorsInGroup"
    },
    {
        "key": "ctrl+x 1",
        "command": "workbench.action.closeEditorsInOtherGroups"
    },
    {
        "key": "ctrl+x k",
        "command": "workbench.action.closeActiveEditor"
    },
    {
        "key": "ctrl+x left",
        "command": "workbench.action.focusLeftGroup"
    },
    {
        "key": "ctrl+x right",
        "command": "workbench.action.focusRightGroup"
    },
    {
        "key": "ctrl+x up",
        "command": "workbench.action.focusAboveGroup"
    },
    {
        "key": "ctrl+x down",
        "command": "workbench.action.focusBelowGroup"
    },
]

This is the list of keyboard shortcuts I generally use. It’s a bit of a weird mixture of trying to use the VSCode defaults while also accepting that I have a lot of Emacs muscle memory that I might as well put to good use.

Keys Command Title Default - Reason
Coding
^ Trigger Suggest yes
⌘⇧ Trigger Parameter Hints yes
^. Quick Fix
 no - the default is ⌘. but I used that for Raycast
^- Go Back yes
F2 Rename Symbol yes
F12 Go to Definition yes
⌄⌘K Bookmarks: Toggle yes
⌄⌘L Bookmarks: Jump to Next yes
⌄⌘J Bookmarks: Jump to Previous yes
⌘K ⌘I Show or Focus Hover yes
Terminal
⌘N Terminal: Create New Terminal no - matches the macOS default better
⌘W Terminal: Kill the Active Terminal Instance no - matches the macOS default better
^X 2 Terminal: Split Terminal no - matches Emacs’ defaults
^X 3 Terminal: Split Terminal no - matches Emacs’ defaults
Window Management
⌘0 Focus Sidebar yes
⌘1 Open Editor at Index 1 - 9 no - matches the macOS default better
⌘⌄T View: Close Other Editors n Group yes
^⇄ View: Open Next Editor in Group no - matches the macOS default better
^⇧⇄ View: Move Editor into Previous Group no - matches the macOS default better
^X B View: Quick Open Previous Recently Used Editor no - matches Emacs’ defaults
^X O View: Focus Next Editor Group no - matches Emacs’ defaults
^X ↑ View: Focus Editor Group Above no - a mixture of the VSCode and Emacs.
^X → View: Focus Editor Group Right no - a mixture of the VSCode and Emacs.
^X ↓ View: Focus Editor Group Down no - a mixture of the VSCode and Emacs.
^X ← View: Focus Editor Group Left no - a mixture of the VSCode and Emacs.
^X 0 View: Close All Editors in Group no - matches Emacs’ defaults
^X 1 View: Close Editors in Other Groups no - matches Emacs’ defaults
^X 2 View: Split Editor Down no - matches Emacs’ defaults
^X 3 View: Split Editor Right no - matches Emacs’ defaults
^X K View: Close Editor no - matches Emacs’ defaults
⌘< Terminal: Focus Terminal no - makes it easy to jump to the terminal
⌘< View: Focus Active Editor Group no - makes it easy to jump back to the editors from the terminal

Settings

settings.json
{
  "editor.multiCursorModifier": "ctrlCmd",
  "editor.formatOnSave": true,
  "workbench.activityBar.visible": true,
  "workbench.colorTheme": "Noctis Minimus",
  "workbench.startupEditor": "none",
  "window.restoreWindows": "none",
  "window.commandCenter": true,
  "workbench.iconTheme": "material-icon-theme",
  "[javascript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[typescript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[json]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[css]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[scss]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[typescriptreact]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  }
}

Raycast

I adore Raycast. I pay for the Pro plan which, amongst other things, gives me access to ChatGPT through Raycast. I use the AI Chat as my primary interface to ChatGPT.

Built-in Extensions

I use the following built-in extensions

Raycast Store Extensions

I use the following extensions from the Raycast Store:

[Experimental] Arc

6th of February 2024: I’m trying out using Arc as my default browser for a bit. Some quick notes

1Password

I use 1Password for all my personal passwords, credit cards, credentials, and so on. I Install it using the App Store.

Notion

I use Notion for quite a few different things. This site is generated from a Notion document. I use it as a simple database system for books, articles, records, how-to’s, projects, and so on. I use it as an easy way to write interconnected notes when learning new topics.

I use the Notion Desktop App as I find it marginally quicker than opening a tab in Safari.

Setting Up a New Mac

This was from the last time I configured a Mac from scratch. If I were to do it today I don’t think I’d use Nix as the “global” package manager but just rely on Homebrew instead; I haven’t really seen any benefit from using Nix for system-wide packages.

Setting up Nix

To install Nix I do need some basic development tools installed like git, curl and so on:

xcode-select --install

I install Nix using The Determinate Nix Installer

curl --proto '=https' --tlsv1.2 -sSf -L \
    https://install.determinate.systems/nix \
| sh -s -- install

Shell

Don’t show the Last login message for every new terminal session:

touch ~/.hushlogin

Install Starship

nix profile install nixpkgs#starship

Create a basic profile for ZSH (touch ~/.zshrc) and add the following

alias tailscale="/Applications/Tailscale.app/Contents/MacOS/Tailscale"
source <(/Users/mads/.nix-profile/bin/starship init zsh --print-full-init)
autoload -Uz compinit && compinit

SSH

I use 1Password to manage my SSH keys (docs) and rely on their SSH agent (docs). For the agent to work the following is placed in ~/.ssh/config:

Host *
  IdentityAgent "~/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock"

To verify it works run the following

export SSH_AUTH_SOCK=~/Library/Group\ Containers/2BUA8C4S2C.com.1password/t/agent.sock
ssh-add -l

Changelog

The current version is v3

Logbook

Week 8, 2024

I’m giving Dash a try to see if having the official docs available for the tools I use means I’ll reach for them more often rather than just run ChatGPT or Google every time I need to look something up. I picked Dash because there’s a Raycast Extension for it.


Edit