How I set up a clean Mac

2024-10-28


See dotfiles for zsh at Github: dotfiles-zsh

Terminal and config

Pick a terminal. I prefer iTerm2.

  1. Configure iTerm2
    1. Choose a theme under Profiles → Colors → Color Presets (can be downloaded/imported)
    2. Disable "Show mark indicators" under Profiles → Terminal
    3. Remove the marked areas if desired
  2. Set up oh-my-zsh
  3. Set up powerlevel10k
    1. Or try an alternative
      1. p10k is currently on life support
      2. YouTube
    2. powerlevel10k
  4. Add aliases if desired

Remove animation time for dock

Source link

First, change your settings to auto hide the dock.

hide-show-doc.png

# Remove animation
defaults write com.apple.dock autohide-time-modifier -int 0;killall Dock
# Remove delay
defaults write com.apple.dock autohide-delay -float 0; killall Dock

Make hidden apps appear as faded in dock

# Faded
defaults write com.apple.Dock showhidden -bool true; killall Dock
# Revert
defaults write com.apple.Dock showhidden -bool false; killall Dock

Insert blank spaces in dock

defaults write com.apple.dock persistent-apps -array-add '{tile-data={}; tile-type="spacer-tile";}'; killall Dock

Change duration that the screenshot image hangs out

# May no longer work due to changes in macOS
defaults write com.apple.screencaptureui "thumbnailExpiration" -float 15 && killall SystemUIServer

Git & GitHub

Add your computer to GitHub's SSH key list: github settings

Configure git

git config --global user.name "[name]"
git config --global user.email "[email of GitHub account]"
git config --global core.editor "vim"
git config --list # Lists all settings

Better git log

Note: Oh My Zsh now has a standard alias for this. This step can be omitted.

https://coderwall.com/p/euwpig/a-better-git-log
  • Quick install

Enter this in the terminal:

git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"

Now git lg or git lg -10 will display all or 10 formatted log lines

To see lines that have changed: git lg -p

Make 'git open' open the repository in the browser

npm install --global git-open

Use by typing git open in a repository.

git-open on npm

Copy .dotfiles

# In home folder 
git clone git@github.com:aukoyy/dotfiles-zsh.git

Brew

Install: brew.sh

Bundle: Brew-Bundle-and-Brewfile

‼️ Follow the instructions in the terminal to add to PATH

Update Homebrew and packages:

  • Run brew update (may take several minutes)
  • Then run brew upgrade

Other Apps

Tinker tool

KeyStrokePro - displays key shortcuts while typing

YouTube downloader: yt-dlp

yt-dlp from brew

Add to aliases:

alias yt='yt-dlp -f bestvideo+bestaudio --merge-output-format mp4 -o "~/youtube-downloads/%(uploader)s - %(title).200s [%(duration/60.0)dm].%(ext)s" '
alias yta='yt-dlp -f bestaudio --extract-audio --audio-format mp3 -o "~/youtube-downloads/%(uploader)s - %(title).200s [%(duration/60.0)dm].%(ext)s" '
← Go back