项目作者: michaelschwobe

项目描述 :
A macOS setup guide specific to front-end development.
高级语言: Shell
项目地址: git://github.com/michaelschwobe/mac-dev-setup.git
创建时间: 2017-10-14T21:39:34Z
项目社区:https://github.com/michaelschwobe/mac-dev-setup

开源协议:MIT License

下载


Mac dev setup

A macOS setup guide specific to front-end development.

Guided Setup

For a guided setup, open up Terminal.app and run the following command:

  1. Save repo to ~/Downloads folder:
    1. git clone https://github.com/michaelschwobe/mac-dev-setup.git ~/Downloads/mac-dev-setup && \
    2. cd ~/Downloads/mac-dev-setup/scripts
  2. Run the installer script.
    1. sh install.sh
    OR Run the installer scripts individually:
    1. sh defaults.sh
    2. sh tools.sh
    3. sh casks.sh
    4. sh optimizations.sh
    5. sh summary.sh

🔥 The scripts auto-skip prompts for items already installed. Recommended: Rerun as many times as needed.

✨ And thats it! For additional CLI and IDE customizations, refer to the related Manual Setup section below.

Manual Setup

For those who prefer à la carte, this section contains everything that the Guided Setup attempts to do including CLI and IDE customizations.

  1. If you haven’t already, save repo to ~/Downloads folder:
    1. git clone https://github.com/michaelschwobe/mac-dev-setup.git ~/Downloads/mac-dev-setup && \
    2. cd ~/Downloads/mac-dev-setup/scripts
  2. Continue with setup below.

Defaults

Create Dock spacers:
  1. defaults write com.apple.dock persistent-apps -array-add '{"tile-type"="spacer-tile";}' && \
  2. defaults write com.apple.dock persistent-apps -array-add '{"tile-type"="spacer-tile";}' && \
  3. defaults write com.apple.dock persistent-apps -array-add '{"tile-type"="spacer-tile";}' && \
  4. killall Dock
Autohide Dock:
  1. defaults write com.apple.dock autohide -boolean true && \
  2. killall Dock
Display hidden Finder files/folders:
  1. defaults write com.apple.finder AppleShowAllFiles -boolean true && \
  2. killall Finder
Create ~/Developer folder:
  1. mkdir -p ~/Developer
Create ~/Sandbox folder:
  1. mkdir -p ~/Sandbox
Installing xcode-select (CLI tools):
  1. xcode-select --install
Installing brew (Homebrew):

If: Apple Silicon/ARM Architecture:

  1. /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" && \
  2. echo 'eval "$(/opt/homebrew/bin/brew shellenv)"'>>$HOME/.zprofile && \
  3. eval "$(/opt/homebrew/bin/brew shellenv)" && \
  4. brew doctor

If Intel Architecture:

  1. /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" && \
  2. brew doctor

Tools

Install watchman:
  1. brew install watchman
Install trash:
  1. brew install trash
Install git:
  1. brew install git
Install zsh:
  1. brew install zsh
Install oh-my-zsh:
  1. sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
Install oh-my-posh (CLI theming):
  1. brew install jandedobbeleer/oh-my-posh/oh-my-posh
  2. echo '# Theme configuration: Oh My Posh' >> ~/.zshrc
  3. echo 'if [ "$TERM_PROGRAM" != "Apple_Terminal" ]; then' >> ~/.zshrc
  4. echo ' if [ -f ~/.moonlight.omp.json ]; then' >> ~/.zshrc
  5. echo ' eval "$(oh-my-posh init zsh --config ~/.moonlight.omp.json)"' >> ~/.zshrc
  6. echo ' else' >> ~/.zshrc
  7. echo ' eval "$(oh-my-posh init zsh --config $(brew --prefix oh-my-posh)/themes/jandedobbeleer.omp.json)"' >> ~/.zshrc
  8. echo ' fi' >> ~/.zshrc
  9. echo 'fi' >> ~/.zshrc

Copy my Oh My Posh settings:

  1. cp ~/Downloads/mac-dev-setup/.moonlight.omp.json ~/.moonlight.omp.json

Restart your CLI for this to take effect.

Install powerlevel10k (CLI theming):
  1. brew install powerlevel10k && \
  2. echo '# Theme configuration: PowerLevel10K' >> ~/.zshrc && \
  3. echo 'source $(brew --prefix)/share/powerlevel10k/powerlevel10k.zsh-theme' >> ~/.zshrc && \
  4. echo '# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.' >> ~/.zshrc && \
  5. echo '[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh' >> ~/.zshrc

Copy my PowerLevel10K settings:

  1. cp ~/Downloads/mac-dev-setup/.p10k.zsh ~/.p10k.zsh

Or customize your own settings:

  1. p10k configure

Restart your CLI for this to take effect.

Install zsh-autosuggestions:
  1. brew install zsh-autosuggestions && \
  2. echo "# Fish shell-like fast/unobtrusive autosuggestions for Zsh." >> ~/.zshrc && \
  3. echo "source $(brew --prefix)/share/zsh-autosuggestions/zsh-autosuggestions.zsh" >> ~/.zshrc

Restart your CLI for this to take effect.

Install zsh-syntax-highlighting:
  1. brew install zsh-syntax-highlighting && \
  2. echo "# Fish shell-like syntax highlighting for Zsh." >> ~/.zshrc && \
  3. echo "# Warning: Must be last sourced!" >> ~/.zshrc && \
  4. echo "source $(brew --prefix)/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ~/.zshrc

Restart your CLI for this to take effect.
Note the source command must be at the end of ~/.zshrc.

Install node (Node via Homebrew):
  1. brew install node
Install n (Node via n):
  1. brew install n
Install nvm (Node via nvm):
  1. curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
Install yarn:
  1. brew install yarn
Install pnpm:
  1. brew install pnpm
Upgrade npm (globally via npm):
  1. npm install -g npm@latest
Install/Upgrade serve (globally via npm):
  1. npm install -g serve@latest

Applications/Casks

Install JetBrainsMono Nerd Font:
  1. brew tap homebrew/cask-fonts # You only need to do this once!
  2. brew install font-jetbrains-mono-nerd-font
Install 1Password:
  1. brew install --cask 1password
Install Brave Browser:
  1. brew install --cask brave-browser
Install Bruno:
  1. brew install --cask bruno
Install Discord:
  1. brew install --cask discord
Install Figma:
  1. brew install --cask figma
Install Ghostty:
  1. brew install --cask ghostty
  1. Copy the theme:
    1. mkdir -p ~/.config/ghostty/ && \
    2. cp ~/Downloads/mac-dev-setup/Moonlight.ghostty.config ~/.config/ghostty/config
  2. Check the theme by going to:
    • “Settings…”
  3. Reload Ghostty and resolve any remaining issues.
    • “Reload Configuration”
Install Google Chrome:
  1. brew install --cask google-chrome
Install iTerm:
  1. brew install --cask iterm2
  1. Copy my iTerm settings:
    1. cp ~/Downloads/mac-dev-setup/.zshrc ~/
  2. Set the theme by going to:
    • “Settings… → Profiles → Colors → Color Presets… → Import…”
    • Theme location: ~/Downloads/mac-dev-setup/Moonlight.itermcolors
  3. Set the font by going to:
    • “Settings… → Profiles → Text → Font”
    • Font name: “JetBrainsMono NFM” or “JetBrainsMono Nerd Font Mono”
  4. Restart iTerm and resolve any remaining issues.
Install Rectangle:
  1. brew install --cask rectangle
Install Slack:
  1. brew install --cask slack
Install Sourcetree:
  1. brew install --cask sourcetree
  1. Set the font by going to:
    • “Settings… → Diff → Internal Diff Visualization → Diff View font”
    • Font name: “JetBrainsMono NFM” or “JetBrainsMono Nerd Font Mono”
  2. Restart Sourcetree and resolve any remaining issues.
Install Spotify:
  1. brew install --cask spotify
Update Terminal:
  1. Set the theme and font by going to:
    • “Settings… → Profiles → Import…” (bottom left next to the “+/-“ buttons)
    • Theme location: ~/Downloads/mac-dev-setup/Moonlight.terminal
    • Font name: “JetBrainsMono NFM” or “JetBrainsMono Nerd Font Mono”
  2. Restart Terminal and resolve any remaining issues.
Install Visual Studio Code:
  1. brew install --cask visual-studio-code
  1. Install my Extensions:
    1. code --install-extension alefragnani.project-manager
    2. code --install-extension atomiks.moonlight
    3. code --install-extension bradlc.vscode-tailwindcss
    4. code --install-extension christian-kohler.npm-intellisense
    5. code --install-extension christian-kohler.path-intellisense
    6. code --install-extension codeforge.remix-forge
    7. code --install-extension dbaeumer.vscode-eslint
    8. code --install-extension eamodio.gitlens
    9. code --install-extension editorconfig.editorconfig
    10. code --install-extension esbenp.prettier-vscode
    11. code --install-extension formulahendry.auto-rename-tag
    12. code --install-extension github.copilot
    13. code --install-extension github.copilot-chat
    14. code --install-extension github.vscode-github-actions
    15. code --install-extension gruntfuggly.todo-tree
    16. code --install-extension l13rary.l13-diff
    17. code --install-extension mikestead.dotenv
    18. code --install-extension ms-azuretools.vscode-docker
    19. code --install-extension orta.vscode-twoslash-queries
    20. code --install-extension prisma.prisma
    21. code --install-extension qwtel.sqlite-viewer
    22. code --install-extension stylelint.vscode-stylelint
    23. code --install-extension tyriar.sort-lines
    24. code --install-extension unifiedjs.vscode-mdx
    25. code --install-extension vscode-icons-team.vscode-icons
    26. code --install-extension yoavbls.pretty-ts-errors
    27. code --install-extension zignd.html-css-class-completion
  2. Copy my Visual Studio Code User settings:
    1. cp ~/Downloads/mac-dev-setup/Code/* ~/Library/Application\ Support/Code/User
  3. Restart Visual Studio Code and resolve any remaining issues.
Install Warp:
  1. brew install --cask warp
  1. Copy the theme:
    1. mkdir -p ~/.warp/themes/ && \
    2. cp ~/Downloads/mac-dev-setup/Moonlight.warp.yaml ~/.warp/themes/
  2. Set the theme and font by going to:
    • “Settings… → Appearance… → Themes”
    • Theme name: “Moonlight”
    • Font name: “JetBrainsMono NFM” or “JetBrainsMono Nerd Font Mono”
  3. Restart Warp and resolve any remaining issues.
Install Zoom.us:
  1. brew install --cask zoom

Optimizations

Re-sort Launchpad applications:
  1. defaults write com.apple.dock ResetLaunchPad -boolean true; killall Dock
Updating oh-my-zsh:
  1. omz update
Optimizing Homebrew:
  1. brew update && brew upgrade && brew doctor && brew cleanup