The setup assistant will launch once you turn the computer on. Enter your language, time zone, Apple ID, and so on. The first thing you should do is update macOS to get the latest security updates and patches.
Catalina comes with zsh as the default shell. Install Oh My Zsh for sensible defaults.
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
Prior to the installation make sure you have committed the alias to your .bashrc
or .zsh
:
alias config='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME'
And that your source repository ignores the folder where you'll clone it, so that you don't create weird recursion problems:
echo ".cfg" >> .gitignore
Now clone the dotfiles into a bare repository in a "dot" folder of your $HOME:
git clone --bare https://github.com/dakshshah96/dotfiles.git $HOME/.cfg
Checkout the actual content from the bare repository to your $HOME
:
config checkout
The step above might fail with a message might fail due to a conflict with existing files. The solution is simple: back up the files if you care about them, remove them if you don't care.
Set the flag showUntrackedFiles
to no on this specific (local) repository:
config config --local status.showUntrackedFiles no
You're done, from now on you can now type config commands to add and update your dotfiles:
config status
config add .vimrc
config commit -m "Add vimrc"
config add .bashrc
config commit -m "Add bashrc"
config push
Oh My Zsh supports a ton of plugins. Here are a few I like to use:
- brew
- z
- zsh-autosuggestions
- zsh-syntax-highlighting
- diff-so-fancy
- Install using Homebrew
- Config has already been set up in
~/.zshrc
I’m a big fan of aliases. The steps to adding aliases for oh-my-zsh are as follows:
- Go to the folder
cd ~/.oh-my-zsh/custom
- Create a new
aliases.zsh
file. You can name it what ever you’d like - Copy the contents of the
aliases.zsh
file in this repository to the newly created file - Save and quit the editor
- Restart your terminal or use
source ~/.zshrc
Taking inspiration from Sindre Sorhus, I've paired the Pure ZSH prompt with the Snazzy iTerm2 theme. Use the "Git clone" method while installing the Pure prompt. Our ~/.zshrc
file already contains the necessary config assuming you've cloned Pure at $HOME/.zsh/pure
.
Change the font to Operator Mono in the iTerm2 preferences to get the perfect look for your terminal.
Install the Homebrew package manager. This will allow you to install almost any app from the command line.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
Make sure everything is up to date.
brew update
Install some basic CLI tools first:
brew install git yarn
- SourceCodeSyntaxHighlight: Previewing source files with syntax highlighting
- QLMarkdown: Previewing Markdown files
pyenv lets you easily switch between multiple versions of Python. It's simple, unobtrusive, and follows the UNIX tradition of single-purpose tools that do one thing well.
pyenv can usually be installed using Homebrew but there might be a few extra steps involved. Check out their official documentation for the latest installation instructions.
We use Volta to manage all our JavaScript tooling. Volta’s job is to get out of your way. With Volta, you can select a Node engine once and then stop worrying about it. You can switch between projects and stop having to manually switch between Nodes. You can install npm package binaries in your toolchain without having to periodically reinstall them or figure out why they’ve stopped working.
We'll skip updating our shell files during installation since we already have VOLTA_HOME
set and $VOLTA_HOME/bin
added to path:
curl https://get.volta.sh | bash -s -- --skip-setup
That's it. Learn more about using Volta in their documentation.
The first thing you should do with Git is set your global configuration. If you've cloned this repo, the ~/.gitconfig
should already be set up correctly.
- Install the
gpg-suite-no-mail
Homebrew cask:
brew install --cask gpg-suite-no-mail
- Generate a new GPG key
- Add the new GPG key to your GitHub account
- Update the GPG
signingKey
in.gitconfig
- Export
GPG_TTY
in~/.zshrc
:
export GPG_TTY=$(tty)
- Run the following test command to check if everything works fine and your key is printed. Select the "Add to keychain" option in the passphrase prompt if you don't want to enter it repeatedly.
echo "test" | gpg --clearsign
- Save your GPG passphrase to prevent being prompted to enter it every time you commit. Install
pinentry-mac
using Homebrew and add the following line to~/.gnupg/gpg-agent.conf
:
pinentry-program /opt/homebrew/bin/pinentry-mac
You can generate an SSH key to distribute.
ssh-keygen -t rsa -b 4096 -C "dakshshah96@gmail.com"
Add key.
ssh-add -K ~/.ssh/id_rsa
View your public key. You can also add this key to GitHub.
cat ~/.ssh/id_rsa.pub
A huge list of useful CLI tools and apps (not in any particular order/may not be up to date):
Click to expand!
- 1Password
- AdGuard
- Altair GraphQL Client
- balenaEtcher
- Brave Browser
- DaisyDisk
- Fig
- Gifski
- ImageOptim
- Infuse
- Insomnia
- Kap
- Linear
- Microsoft Excel
- Microsoft Powerpoint
- Microsoft Word
- MonitorControl
- Notion
- Numbers
- Pages
- PDF Expert
- Pixelmator Pro
- Raycast
- Rectangle
- Setapp
- Silicon
- Slack
- Spotify
- Telegram
- Todoist
- Transmission
- Visual Studio Code
- Wondershare PDFelement
- Zoom
- iBoysoft NTFS for Mac
- CleanShot X
- PixelSnap
- Bartender
- iStat Menus
- Sip
- Sizzy
Turn on VS Code's Settings Sync, and sign in with GitHub. No other setup needed. Period.
Printing, stamping and signing documents all day isn't fun. Here's a quick Automator Quick Action to make any PDF document look like it was scanned. Make sure you have both imagemagick
and ghostscript
installed via Homebrew first.
# Workflow receives current "PDF files" in "any application"
# Action: Run Shell Script
# Shell: /bin/zsh
# Pass input: "as arguments"
export PATH="/opt/homebrew/bin:$PATH"
for f in "$@"
do
base=${f%.pdf}
base=$base"_scanned.pdf"
convert -density 150 "$f" -rotate "$([ $((RANDOM % 2)) -eq 1 ] && echo -)0.$(($RANDOM % 4 + 5))" -colorspace Gray "$base"
done