Highly opinionated personal preferences minimum viable setup.
This guide only known to be compatible with MacOS Monterey (version 12) on an M1 Mac.
Clean up hostname and computer name [apple.stackexchange.com]
-
Run commands:
sudo scutil --set HostName <mymac>
sudo scutil --set LocalHostName <MyMac>
sudo scutil --set ComputerName <MyMac>
-
Flush the DNS cache:
dscacheutil -flushcache
-
Restart Mac
- Create a copy of
/Applications/Utilities/Terminal.appcalledRosetta Terminal.appand set the Open using Rosetta option in Get Info.
-
Install Homebrew [brew.sh]:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"Run the same command also in Rosetta Terminal.
-
Install packages:
/opt/homebrew/bin/brew install gnupg pyenv poetry sublime-text visual-studio-code
In Rosetta Terminal also run:
/usr/local/bin/brew install pyenv
Ref: [scriptingosx.com]
-
Add the following to
~/.zprofile:echo $(arch) if [ $(arch) = 'i386' ]; then eval "$(/usr/local/bin/brew shellenv)" export PYENV_ROOT="${HOME}/.pyenv_x86" else eval "$(/opt/homebrew/bin/brew shellenv)" fi eval "$(pyenv init --path)"
-
Add the following to
~/.zshrc:if type brew &>/dev/null; then FPATH=$(brew --prefix)/share/zsh/site-functions:$FPATH fi fpath+=~/.zfunc autoload -Uz compinit && compinit zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}' setopt PROMPT_SUBST alias ls='ls -Gp' alias l='ls -ohL' alias ll='ls -AohL' alias lll='ls -AlhO' alias b='cd ..' alias bb='cd ../..' alias bbb='cd ../../..' # https://github.com/pyenv/pyenv/issues/106#issuecomment-94921352 alias brew="env PATH=${PATH//$(pyenv root)\/shims:/} brew" export LS_COLORS=exfxfeaeBxxehehbadacea if [ $(arch) = 'i386' ]; then export PYENV_ROOT="${HOME}/.pyenv_x86" fi eval "$(pyenv init -)"
-
Run commands:
mkdir ~/.zfunc && poetry completions zsh > ~/.zfunc/_poetry
chmod -R go-w '/opt/homebrew/share'rm -f ~/.zcompdump -
Restart Terminal
-
Add the following to
~/.vimrc:set number set t_Co=16 set re=0 syntax on
-
Install the
vim-plugplugin [GitHub]:curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
Import GPG keys [serverfault.com]
-
Copy keys and ownertrust files from your backup:
username@example.com.pub.ascusername@example.com.priv.ascusername@example.com.sub_priv.ascownertrust.txt
-
Import keys by running commands:
gpg --import username@example.com.pub.asc
gpg --import username@example.com.priv.asc
gpg --import username@example.com.sub_priv.asc
gpg --import-ownertrust ownertrust.txt
-
Trust keys by running commands:
gpg --edit-key username@example.com
Output:
> gpg> trust > Your decision? 5 > gpg> quit
Configure SSH keys and agent [github.com]
-
Generate new SSH key (use corp. email on corp. laptop):
ssh-keygen -t ed25519 -C "username@example.com"Output:
> ... > Enter passphrase (empty for no passphrase): <empty> > ... -
Add your SSH key to the
ssh-agent:-
Start SSH agent:
eval "$(ssh-agent -s)"
Output:
> Agent pid 12345 -
Run
vim ~/.ssh/configand add the following:Host * AddKeysToAgent yes IdentityFile ~/.ssh/id_ed25519 -
Add you SSH private key to the SSH agent:
ssh-add --apple-use-keychain ~/.ssh/id_ed25519
-
-
Add the SSH public key to GitHub:
-
Copy the key to your clipboard:
pbcopy < ~/.ssh/id_ed25519.pub
-
In GitHub → Profile → Settings → SSH and GPG keys, click New SSH key and paste the key.
-
For corp. emails make sure to also add these to your GitHub account.
-
-
Run commands (use corp. email for corp. laptop):
git config --global user.name "Firstname Lastname"git config --global user.email "username@example.com"git config --global commit.gpgsign true
-
Install a default Python dist:
pyenv install 3.8.13
pyenv global 3.8.13
Run the same commands also in Rosetta Terminal.
-
Install the latest JDK:
brew install java
-
Symlink so MacOS can find the JDK [mkyong.com]
sudo ln -sfn /opt/homebrew/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk
-
Run command:
defaults write com.brave.Browser AppleEnableSwipeNavigateWithScrolls -bool FALSE
-
Restart browser.
Preference for the Nord Theme.
- Download and install
Droid Sans Mono Dotted for Powerline.ttf[GitHub]
-
Download and install the
Nord.terminaltheme [GitHub]- Click Default
-
Change font to Droid Sans Mono Dotted for Powerline:
- Font Weight: Regular
- Font Size: 11pt
- Character Spacing: 1
- Line Spacing: 0.885
-
Download the
agnoster.zsh-themeto~/.agnoster.zsh-theme[GitHub] -
Edit
.zshrcand add the following line at the top of the file:source $HOME/.agnoster.zsh-theme
-
Run
vim ~/.vimrcand append the following:call plug#begin(expand('~/.vim/plugged')) Plug 'arcticicestudio/nord-vim' call plug#end() colorscheme nord
-
Still in
vimrun::PlugInstall -
Save and exit
vim
-
Run
Shift+Cmd+P→ Install Package →Nord -
Run
Shift+Cmd+P→ Preferences: Settings, and add:"theme": "Adaptive.sublime-theme", "color_scheme": "Nord.sublime-color-scheme", "font_face": "Droid Sans Mono Dotted for Powerline", "font_size": 12, "line_numbers": true,
-
Install the
Nord Deepextension -
Run
Shift+Cmd+P→ Open Settings (JSON), and add:"workbench.colorTheme": "Nord Deep", "editor.fontFamily": "Droid Sans Mono Dotted for Powerline", "editor.fontSize": 12, "editor.fontLigatures": true, "terminal.integrated.fontFamily": "Droid Sans Mono Dotted for Powerline", "terminal.integrated.fontSize": 12, "terminal.integrated.profiles.osx": { "zsh": {"path": "/bin/zsh", "args": ["-c", "/bin/zsh"]} },