Skip to content

shell 命令行搭建

📅 发表于 2025/06/09
🔄 更新于 2025/06/09
👁️ -- 次访问
📝 0 字
0 分钟
shell
#oh-my-zsh

oh-my-zsh

安装zsh/oh-my-zsh

shell
shell
# 如果没有zsh,先安装一下zsh
brew install zsh
chsh -s $(which zsh)

# clone oh-my-zsh
git clone https://github.com/ohmyzsh/ohmyzsh.git

# 进入文件夹,并安装
./tools/install.sh

实用插件

一般内置在 ohmyzsh-plugin-wiki里面寻找即可,部分插件依赖前置安装,按照wiki说明即可。

插件配置
shell
plugins=(aliases git autojump conda pip tmux web-search vscode zsh-navigation-tools zsh-interactive-cd zsh-autosuggestions zsh-syntax-highlighting)

# 配置gnu-ls
zstyle ':omz:lib:theme-and-appearance' gnu-ls yes

我的重点是autojumpzsh-autosuggestionszsh-syntax-highlighting。这三个安装和配置有些许差异。

安装和配置
shell
# autojump,官网没说要安装,直接配置就行了

# zsh-autosuggestions git安装,brew也可以吧,只需选中,无需额外配置,在plugins上写上名称即可
git clone https://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

# zsh-syntax-highlighting 
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

# 需要在.zshrc的末尾,进行source配置
source ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

zsh-navigation-tools 这个插件慢慢琢磨一下。

颜色及主题配置

颜色配置
shell
# clone
git clone https://github.com/trapd00r/LS_COLORS.git

source ~/app/LS_COLORS/lscolors.sh 

# 注意,需要在zshrc里配置,也就是使用gnu-ls,否则需要alias
zstyle ':omz:lib:theme-and-appearance' gnu-ls yes

# dracula 主题
git clone https://github.com/dracula/zsh.git
ln -s /Users/plm/app/zsh/dracula.zsh-theme $ZSH/themes/dracula.zsh-theme
总访客数:   ·   总访问量:
PLM's Blog @ 2016 - 2026