CLI tools

  • atop: 监控系统资源使用情况(偏IRQ)
  • btop: 监控系统资源使用情况(好看)
  • fzf: 模糊查找

zsh

安装

1
brew install zsh

Oh My Zsh

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

powerlevel10k主题

定制PS1

1
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k

zsh-autosuggestions

自动建议,右键补全,alt+右键补单词

1
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

zsh-syntax-highlighting

This package provides syntax highlighting for the shell zsh. It enables highlighting of commands whilst they are typed at a zsh prompt into an interactive terminal. This helps in reviewing commands before running them, particularly in catching syntax errors.

1
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

autojump

  • j: 命令跳包含关键字的目录
  • jc: 命令跳包含关键字的目录, 偏好子目录
  • jo: 命令打开包含关键字的目录(finder/explorer)
  • jco: jc和jo的组合
1
brew install autojump

配置

zshrc

主要修改以下几行

1
2
3
4
5
6
7
8
9
10
11
12
13
# theme
ZSH_THEME="powerlevel10k/powerlevel10k"

# plugins
plugins=(git aliases tmux brew z python autojump sudo virtualenv zsh-syntax-highlighting zsh-autosuggestions history-substring-search)


#
# alt+left/right switch word
# see: https://stackoverflow.com/questions/12382499/looking-for-altleftarrowkey-solution-in-zsh/12403798#12403798
#
bindkey "^[^[[C" forward-word
bindkey "^[^[[D" backward-word

vscode

如果用了Unicode终端字体可以改为MesloLGS NF

1
"terminal.integrated.fontFamily": "'MesloLGS NF'"