It is the time to reset my MacBook again. Last time was in 2024: Setting up a Mac in 2024.
The main plan is as follows:
- Configure MacOs to my preferred defaults
- Install Homebrew
- Install basic tools
- Install my dotfiles from https://github.com/korya/dotfiles
- Install all required tools
- Install Tailscale
- Other configurations
Configure MacOS
Change MacOS hostname
By default, MacOS sets the hostname to a ridiculous value based on your name. Something as āDmitriās MacBook Proā. I prefer to name my machines after latin or greek gods. Easy to remember and easy to identify them in the office network.
NEW_HOSTNAME="mercury"
sudo scutil --set ComputerName "${NEW_HOSTNAME}"
sudo scutil --set LocalHostName "${NEW_HOSTNAME}"
Generate SSH Key
Generate SSH key for the machine:
ssh-keygen -o -a 256 -t ed25519 -C "${USER}@$(hostname -s)-$(date +'%d-%m-%Y')"
MacOS UI Settings
The only changes I make to the default settings are:
Trackpad:
- Enable
Tap to click. I like tapping rather than clicking.
- Enable
Dock:
Move the dock to the left. The real estate at the center of the screen is very precious and hence, I try to free it up for the content that requires my attention at this current moment. Dock is very useful and should be available fast when needed. But not that important to be at the bottom of the screen.
Turn on magnification effect on the Docker and set it to the mid level.
Auto-hide the dock. I donāt need to see it all the time.
Clean it up. Remove all these stock apps from the dock. Keep Finder, Launchpad, Safari (later will be replaced with Chrome) and Notes.
Desktops:
- Disable
Automatically rearrange Spaces based on most recent use. I donāt want to be distracted by the changes in the desktops order.
- Disable
Input languages:
- Open
Keyboardgroup then clickEditto the right ofInput Sources:- add Russian and Hebrew
- Open
Time format:
- In
Date & Time, turn on24-hour timeandShow 24-hour time on Lock Screen
- In
Shortcuts:
- On the same screen,
Keyboard, ensure that š is set toChange Input Source - On the same screen,
Keyboard, clickKeyboard Shortcuts:- In
Modifier Keys, change Caps Lock to Escape - In
Mission Control, enable shortcuts for switching to Desktops:^1,^2, etc.
- In
- On the same screen,
Below are CLI commands suggested by ChatGPT (o3-mini-high):
#!/bin/bash
# --- Trackpad ---
# Enable "Tap to click" (for both current host and global settings)
defaults write com.apple.AppleMultitouchTrackpad Clicking -bool true
defaults -currentHost write NSGlobalDomain com.apple.mouse.tapBehavior -int 1
defaults write NSGlobalDomain com.apple.mouse.tapBehavior -int 1
# --- Dock ---
# 1. Move the Dock to the left side of the screen
defaults write com.apple.dock orientation -string "left"
# 2. Enable magnification and set the magnification size to a mid-level value (adjust "64" if needed)
defaults write com.apple.dock magnification -bool true
defaults write com.apple.dock largesize -int 64
# 3. Auto-hide the Dock
defaults write com.apple.dock autohide -bool true
# --- Desktops (Spaces) ---
# Disable "Automatically rearrange Spaces based on most recent use"
defaults write com.apple.dock mru-spaces -bool false
# --- Apply Changes ---
# Restart the Dock to immediately apply all the above changes.
killall Dock
Install Homebrew
Homebrew is my default package manager in MacOS.
Follow the instructions at https://brew.sh/. At this moment, they are:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Then configure Homebrew temporarily:
eval "$(/opt/homebrew/bin/brew shellenv)"
Note: This must be done manually until the dotfiles are installed.
Install Basic Tools
Basic tools (GBU core utils and other CLI utils):
brew install coreutils binutils diffutils ed findutils moreutils \
gawk gnu-indent gnu-sed gnu-tar gnu-which gnutls grep gzip gpg2 \
watch wdiff gpatch m4 make cmake file-formula \
bash bash-completion@2 less wget curl socat git openssh python \
rsync svn unzip tree rename jq just ag fzf zellij gh \
macvim nvim bat
New tools:
- just is a modern replacement for
make - ag is a super-fast āgrepā
- fzf is an interactive Unix filter for
command-line that can be used with any list; files, command history, processes,
hostnames, bookmarks, git commits, etc.
fzfstands for fuzzy finder. There are infinite ways to use it. Read https://github.com/junegunn/fzf?tab=readme-ov-file#examples for some insights. The most essential use is the integration in your shell: - zellij is a modern alternative to GNU
screenandtmux - bat is a great substitution for
cat(make sure to addalias cat=bat)
Install my dotfiles
Now that the basic tools are installed (including git), the dotfile can be
installed from Github.
My dotfiles are available at https://github.com/korya/dotfiles
cd ~
git init .
git remote add origin https://github.com/korya/dotfiles
git pull origin master
Unfortunately, all conflicts need to be resolved manually.
Install Rerquired Tools
Producivity Tools
fzf is an interactive Unix filter for
command-line that can be used with any list; files, command history, processes,
hostnames, bookmarks, git commits, etc. fzf stands for fuzzy finder.
There are infinite ways to use it. Read https://github.com/junegunn/fzf?tab=readme-ov-file#examples for some insights. The most essential use is the integration in your shell:
- Use
<CTRL-R>to search command history. - Use
<CTRL-T>to find a file. - Use
[PATTERN]**<TAB>to run fuzzy completion.
brew install fzf
# To install useful key bindings and fuzzy completion:
$(brew --prefix)/opt/fzf/install --all
zellij is a modern alternative to GNU screen and tmux:
brew install zellij
iTerm2
iTerm2 is the best terminal emulator available for MacOS for now.
brew install --cask iterm2
Configure iTerm2:
Copy profiles JSON to Downloads folder
cp ~/.korya.d/iTerm2-Profiles.json ~/Downloads/Import it:
- Open Settings
- Select Profiles tab
- Click Other Actions⦠dropdown
- Then Import JSON Profiles
- Select the file from Downloads folder
- Set the imported Default profile as default
- Delete the old default profile
Fancy (Nerd) Fonts
Install Nerd Fonts (used by LazyVim and OhMyZsh):
brew install font-hack-nerd-font
In iTermsā Setting:
- Update the Default profile:
- Goto Profiles
- Select the Default Profile
- Goto Text tab
- Select Hack Nerd Font Mono
- Set size to 14
- Repeat the steps for Hotkey Window profile
Docker
Docker Desktop Docker is the easiest and the most reliable way to ship reproducible software:
brew install --cask docker
brew install docker-credential-helper
IDEs
MS VSCode is used by a lot of people and has a lot of plugins. This is the mainstream IDE today so I install it by default.
But I try to experiment with modern IDEs coming with integrated agentic AI such as Cursor and Windsurf.
brew install --cask visual-studio-code cursor windsurf
Here is a list of great extensions I use (excluding language specific ones):
- VSCodeVim is a vim emulator
- Error lens highlights errors in the code. I am not really sure why this is not part of the core VSCode.
- Remote SSH allows to develop on a remote server via SSH.
- Modelines allows to configure VSCode via modelines in the files.
- Github Copilot is a great tool for generating code. It is not perfect but it is a great help.
- GitLens is a nice tool for previewing changes inside VSCode. It is also great for making basic commits. Unfortunately, I was not able to use it for more advanced scenarios requiring rebasing.
- Jupyter is a great tool for working with Jupyter notebooks.
Bitwarden
I use Bitwarden as my password manager. Migrated to it recently from LastPass and it is great!
brew install --cask bitwarden
Install Tailscale
Tailscale is one of the best software Iāve discovered in the recent years. Iāve been using it for a very long time. I think that Iāve discovered it in some newsletter early on after they made their product available. I gave it a try and it just worked, and it just made my life so much easier. I recommend everyone to try it out. It is an amazing product that just works!
brew install --cask tailscale
Configuration:
Grant all required permissions:
- Unblock the app in System Preferences > Security & Privacy > General
- Grant Sharing permissions in System Preferences > Security & Privacy > Privacy
Login to Tailscale
Enable run on start up
Configure password-less SSH; e.g.
cat ~/.ssh/id_rsa.pub | ssh '<YOUR IP>' tee ~/.ssh/authorized_keys
Other Configurations
Git
Recommended default settings for Git:
credential.helper=osxkeychainuses the MacOS KeyChain for storing Git credentials.pull.rebase=trueuses git rebase instead of the default git merge when pulling from a remote.fetch.prune=trueruns git remote prune on every fetch and will automatically delete inaccessible Git objects in your local repository that arenāt on remote. In short, all branches and their commits that are merged into master on Github gets deleted automatically in your local repo.diff.colorMoved=zebrauses a different color in git diff for code that just moved within a file. This makes it easier to distinguish moved code from other changes.
git config --global credential.helper osxkeychain
git config --global pull.rebase true
git config --global fetch.prune true
git config --global diff.colorMoved zebra
Vim
vim +PlugInstall +PlugUpgrade +PlugUpdate
NeoVim
# Start neovim
nvim
# Install and sync all plugins
Upload SSH Key to Github
Then upload the generated SSH key to Github:
- Open Settings / SSH and GPG keys in Github: https://github.com/settings/keys
- Create a new SSH key:
Click New SSH key
Enter a title for the new key:
awk '{ print "Developer key for " $3 }' ~/.ssh/id_ed25519.pub | pbcopyPaste the public key from
~/.ssh/id_ed25519.pub:pbcopy <~/.ssh/id_ed25519.pubClick Add SSH key
Last Words
That is it. This environment should be good enough to start.
Something I need to look into in the future:
- Automate the installation of Chrome
- Fully automate the bootstrapping of a new macBook