Skip to content

iTerm 配置

约 312 字大约 1 分钟

MacOS

2020-07-02

安装 Oh My Zsh

sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

agnoster主题设置

  • 安装字体Meslo LG M Regular for Powerline字体, github下载地址

  • 设置Appearance Theme为Minimal(Appearance->General->Theme) image 20250308230948

  • 设置Solarized Dark(Profiles->Colors->Color Presers) image 20250308231345

  • 设置Meslo LG M Regular for Powerline字体(Profiles->Text->Font) image 20250308231416

  • 修改主题为agnoster

# 文件位置 $HOME/.zshrc
ZSH_THEME="agnoster" # 主题
  • 默认终端设置

iTerm2 -> Make iTerm2 Default Term

iTerm插件

  • 语法高亮
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $ZSH_CUSTOM/plugins/zsh-syntax-highlighting
  • 安装zsh-autosuggestions插件
git clone https://github.com/zsh-users/zsh-autosuggestions.git $ZSH_CUSTOM/plugins/zsh-autosuggestions

iTerm配置文件

# 自定义oh-my-zsh位置
export ZSH="$HOME/Environment/.oh-my-zsh" 

ZSH_THEME="agnoster"
# ZSH_THEME="steeef"

plugins=(
    git
    zsh-syntax-highlighting
    zsh-autosuggestions
)

source $ZSH/oh-my-zsh.sh

# 自定义配置
prompt_context() {
  if [[ "$USERNAME" != "$DEFAULT_USER" || -n "$SSH_CLIENT" ]]; then
    prompt_segment black default "%m 👍"
  fi
}

# Homebrew
export PATH=/opt/homebrew/bin/:$PATH

# Go
export GOROOT=$HOME/Environment/go/Sdk/go1.23.6
export PATH=$GOROOT/bin:$PATH
export GOPATH=$HOME/Environment/go/go
export PATH=$GOPATH/bin:$PATH

# proto
export PATH=$HOME/Environment/ProtocolBuffers/protoc-29.3-osx-aarch_64/bin:$PATH

# Java
export JAVA_HOME=$HOME/Environment/Java/azul-21.0.6/Contents/Home
export PATH=$JAVA_HOME/bin:$PATH

# nodejs
export PATH=$HOME/Environment/Nodejs/Sdk/node-v22.14.0-darwin-arm64/bin:$PATH

# Flutter
export PATH="$PATH:$HOME/Environment/Flutter/flutter_3.13.6/bin"
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn

# adb
export PATH="$PATH:$HOME/Environment/Android/sdk/platform-tools"
# scrcpy
export PATH=/opt/homebrew/Cellar/scrcpy/2.0_1/bin:$PATH

# OLLAMA
export OLLAMA_HOST=0.0.0.0:11434
export OLLAMA_MODELS='/Volumes/NM620/Application Support/.ollama/models'

alias tu='tailscale up'
alias td='tailscale down'
alias ts='tailscale status'
# alias python='/opt/homebrew/bin/python3'
# alias pip='/Library/Frameworks/Python.framework/Versions/3.11/bin/pip3'