Skip to content

Comprehensive Mac Setup For Full-stack Development

Published: at 02:23 AM

Table of contents

Open Table of contents

Init

System Settings

then:

Finder Settings

cmd settings

#𝗙𝗮𝘀𝘁𝗲𝗿 𝗗𝗼𝗰𝗸 𝗛𝗶𝗱𝗶𝗻𝗴:
defaults write com.apple.dock autohide-delay -float 0; defaults write com.apple.dock autohide-time-modifier -int 0;killall Dock
#𝗙𝗮𝘀𝘁𝗲𝗿 𝗗𝗼𝗰𝗸 𝗛𝗶𝗱𝗶𝗻𝗴 𝗨𝗻𝗱𝗼:
defaults write com.apple.dock autohide-delay -float 0.5; defaults write com.apple.dock autohide-time-modifier -int 0.5 ;killall Dock

#𝗔𝗱𝗱 𝗗𝗼𝗰𝗸 𝗦𝗽𝗮𝗰𝗲𝗿 (paste for each spacer):
defaults write com.apple.dock persistent-apps -array-add '{tile-data={}; tile-type="spacer-tile";}' && killall Dock
#𝗔𝗱𝗱 𝗛𝗮𝗹𝗳-𝗛𝗲𝗶𝗴𝗵𝘁 𝗗𝗼𝗰𝗸 𝗦𝗽𝗮𝗰𝗲𝗿 (paste for each):
defaults write com.apple.dock persistent-apps -array-add '{"tile-type"="small-spacer-tile";}' && killall Dock

# show Library folder
chflags nohidden ~/Library

# show hidden files
defaults write com.apple.finder AppleShowAllFiles YES

# show path bar
defaults write com.apple.finder ShowPathbar -bool true

# show status bar
defaults write com.apple.finder ShowStatusBar -bool true

killall Finder;

Softwares

Parallels Desktop Settings:

After Install and activate PD, before install Windows, edit Win 11 Configuration:

Options - Sharing: Mirror Mac and Windows user folders off, share iCloud, dropbox and google drive off, share mac volumes with Windows off, Share Windows: Access windows folder from Mac off

Options - Applications: Share Windows Apps with Mac off, Share Mac apps with Windows off

Hardware - Network: Bridged Network, default adapter

Tools

iTerm2 Settings

HomeBrew Formulaes

nano
vim
tldr
fzf #/opt/homebrew/opt/fzf/install
broot
nnn
git #and open a new tab it will use the latest git.
maccy
ccat

Languages

C++

xcode-select --install
brew install cmake cmake-docs
brew install vcpkg # And follow the caveats
brew install conan

Go:

brew install go

Rust:

brew install rustup-init

Python

brew install --cask miniconda
conda init "$(basename "${SHELL}")"
conda config --set auto_activate_base false

NodeJS:

brew install fnm
vim ~/.zshrc:
#eval "$(fnm env --use-on-cd)"
fnm install --lts
fnm ls
fnm use lts-latest

Flutter & Dart:

brew install cocoapods
brew tap leoafarias/fvm
brew install fvm
fvm install stable  # Installs latest stable version of flutter
fvm doctor
fvm global stable  # sets your default flutter to the installed stable version
vim ~/.zshrc:
#export PATH="$PATH:/Users/<YOUR_USER>/fvm/default/bin"
fvm flutter --version
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
sudo xcodebuild -runFirstLaunch
fvm flutter doctor
brew uninstall dart

Java:

brew install jenv
#And follow the caveats
#source ~/.zshrc
jenv doctor
jenv enable-plugin export # To ensure that JAVA_HOME is correct
jenv enable-plugin maven #Assuming Maven is used and to educate maven about Java version used
jenv enable-plugin gradle
brew install openjdk@11
#sudo ln -sfn /opt/homebrew/opt/openjdk@11/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk-11.jdk
#echo 'export PATH="/opt/homebrew/opt/openjdk@11/bin:$PATH"' >> /Users/miao/.bash_profile
#export CPPFLAGS="-I/opt/homebrew/opt/openjdk@11/include"
brew install openjdk@17
#sudo ln -sfn /opt/homebrew/opt/openjdk@17/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk-17.jdk
#echo 'export PATH="/opt/homebrew/opt/openjdk@17/bin:$PATH"' >> /Users/miao/.bash_profile
#export CPPFLAGS="-I/opt/homebrew/opt/openjdk@17/include"
brew install openjdk@21
#sudo ln -sfn /opt/homebrew/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk
#echo 'export PATH="/opt/homebrew/opt/openjdk/bin:$PATH"' >> /Users/miao/.bash_profile
#export CPPFLAGS="-I/opt/homebrew/opt/openjdk/include"
/usr/libexec/java_home -V
#jenv add /opt/homebrew/Cellar/openjdk/21.0.1/libexec/openjdk.jdk/Contents/Home
#jenv add /opt/homebrew/Cellar/openjdk@17/17.0.9/libexec/openjdk.jdk/Contents/Home
#jenv add /opt/homebrew/Cellar/openjdk@11/11.0.21/libexec/openjdk.jdk/Contents/Home
jenv versions
#jenv global openjdk64-21.0.1
java -version

Ruby:

brew install ruby-install chruby
#And foloow the caveats
source ~/.zshrc
#ruby-install ruby-3.2.3
ruby-install --latest ruby
chruby ruby-3.3.0

LaTex:

brew install --cask mactex
# new version for 2024 will release on 13mar.

Homebrew Casks

Softwares

1password
ticktick

alfred
bartender

keepingyouawake
stats
rectangle
alt-tab
cheatsheet
keka
kap
linearmouse
aldente
app-cleaner
brew tap localsend/localsend
brew install localsend
brew tap mac-cleanup/mac-cleanup-py
brew install mac-cleanup-py
brew install --cask shottr
brew install --cask shortcutdetective

folx
downie
permute

notion
calibre
iina

readdle-spark
spotify

tor-browser
telegram
signal
zoom
slack
discord
sublime-text

Code

brew install --cask docker
brew install --cask github
brew install --cask visual-studio-code
brew install --cask jetbrains-toolbox
# brew install --cask pycharm
# brew install --cask intellij-idea
# brew install --cask clion
# brew install --cask goland
# brew install --cask webstorm
# brew install --cask rustrover
# brew install --cask datagrip
# brew install --cask dataspell
# brew install --cask android-studio
brew install --cask postman

~/.tmux.conf:

set -g mouse on

setw -g mode-keys vi
bind-key h select-pane -L
bind-key j select-pane -D
bind-key k select-pane -U
bind-key l select-pane -R
bind-key -r C-h select-window -t :-
bind-key -r C-l select-window -t :+

#set -g prefix2 C-s

# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'dracula/tmux'
# available plugins: battery, cpu-usage, git, gpu-usage, ram-usage, tmux-ram-usage, network, network-bandwidth, network-ping, ssh-session, attached-clients, network-vpn, weather, time, mpc, spotify-tui, kubernetes-context, synchronize-panes
set -g @dracula-plugins "cpu-usage gpu-usage ram-usage"
set -g @dracula-show-powerline true

# Other examples:
# set -g @plugin 'github_username/plugin_name'
# set -g @plugin 'github_username/plugin_name#branch'
# set -g @plugin '[email protected]:user/plugin'
# set -g @plugin '[email protected]:user/plugin'

# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '/opt/homebrew/opt/tpm/share/tpm/tpm'

Commands:

#install tmux plugin manager:
brew install tpm

#kill all sessions:
tmux kill-server

# type this in terminal if tmux is already running
tmux source ~/.tmux.conf

# install plugin in tmux:
ctrl+b I

# update plugin in tmux:
ctrl+b U

Vim Comfig

~/.vimrc:

" Comments in Vimscript start with a `"`.

" If you open this file in Vim, it'll be syntax highlighted for you.

" Vim is based on Vi. Setting `nocompatible` switches from the default
" Vi-compatibility mode and enables useful Vim functionality. This
" configuration option turns out not to be necessary for the file named
" '~/.vimrc', because Vim automatically enters nocompatible mode if that file
" is present. But we're including it here just in case this config file is
" loaded some other way (e.g. saved as `foo`, and then Vim started with
" `vim -u foo`).
set nocompatible

" Turn on syntax highlighting.
syntax on

" Disable the default Vim startup message.
set shortmess+=I

" Show line numbers.
set number

" This enables relative line numbering mode. With both number and
" relativenumber enabled, the current line shows the true line number, while
" all other lines (above and below) are numbered relative to the current line.
" This is useful because you can tell, at a glance, what count is needed to
" jump up or down to a particular line, by {count}k to go up or {count}j to go
" down.
set relativenumber

" Always show the status line at the bottom, even if you only have one window open.
set laststatus=2

" The backspace key has slightly unintuitive behavior by default. For example,
" by default, you can't backspace before the insertion point set with 'i'.
" This configuration makes backspace behave more reasonably, in that you can
" backspace over anything.
set backspace=indent,eol,start

" By default, Vim doesn't let you hide a buffer (i.e. have a buffer that isn't
" shown in any window) that has unsaved changes. This is to prevent you from "
" forgetting about unsaved changes and then quitting e.g. via `:qa!`. We find
" hidden buffers helpful enough to disable this protection. See `:help hidden`
" for more information on this.
set hidden

" This setting makes search case-insensitive when all characters in the string
" being searched are lowercase. However, the search becomes case-sensitive if
" it contains any capital letters. This makes searching more convenient.
set ignorecase
set smartcase

" Enable searching as you type, rather than waiting till you press enter.
set incsearch

" Unbind some useless/annoying default key bindings.
nmap Q <Nop> " 'Q' in normal mode enters Ex mode. You almost never want this.

" Disable audible bell because it's annoying.
set noerrorbells visualbell t_vb=

" Enable mouse support. You should avoid relying on this too much, but it can
" sometimes be convenient.
set mouse+=a

" Try to prevent bad habits like using the arrow keys for movement. This is
" not the only possible bad habit. For example, holding down the h/j/k/l keys
" for movement, rather than using more efficient movement commands, is also a
" bad habit. The former is enforceable through a .vimrc, while we don't know
" how to prevent the latter.
" Do this in normal mode...
nnoremap <Left>  :echoe "Use h"<CR>
nnoremap <Right> :echoe "Use l"<CR>
nnoremap <Up>    :echoe "Use k"<CR>
nnoremap <Down>  :echoe "Use j"<CR>
" ...and in insert mode
" inoremap <Left>  <ESC>:echoe "Use h"<CR>
" inoremap <Right> <ESC>:echoe "Use l"<CR>
" inoremap <Up>    <ESC>:echoe "Use k"<CR>
" inoremap <Down>  <ESC>:echoe "Use j"<CR>

" fzf related:
set rtp+=/opt/homebrew/opt/fzf

Misc

If you want to change shell back to bash:

brew install bash
which bash
sudo vim /etc/shells
chsh -s /opt/homebrew/bin/bash

search files: mdfind, or fzf

search folders: cmd+option+space

References