Loading... # 安装zsh和git ```bash apt-get install zsh git ``` # 安装oh my zsh ```bash sh -c "$(wget https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)" ``` # 修改主题 在 `.zshrc`文件中,修改`ZSH_THEME`,主题展示可见官方[themes](https://github.com/ohmyzsh/ohmyzsh/wiki/Themes) ```bash #找到对应行改为你喜欢的主题 ZSH_THEME="agnoster" ``` # 添加插件 ## sudo 这个插件的作用是:连按两次Esc添加或去掉sudo 这个插件官方已经集成,直接在`.zshrc`中开启 ``` plugins=( git sudo zsh-syntax-highlighting ) ``` ## zsh-syntax-highlighting 这个插件作用是:高亮可用命令 首先下载插件 ```bash git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting ``` 修改`.zshrc`文件 ```bash plugins=( git sudo zsh-syntax-highlighting ) ``` ## zsh-autosuggestions 这个插件作用是:记录上一条命令,并自动建议 同样的需要下载插件 ```bash git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions ``` 然后修改`.zshrc`文件 ```bash plugins=( git sudo zsh-syntax-highlighting zsh-autosuggestions ) ``` ## extract 自带插件,不用再使用复杂的tar来解压压缩包了 激活: 添加到~/.zshrc的plugins列表 ```bash plugins=( git sudo zsh-syntax-highlighting zsh-autosuggestions extract ) ``` # 参考资料 1.[oh my zsh 官网](https://ohmyz.sh/) 2.[oh my zsh 主题仓库](https://github.com/ohmyzsh/ohmyzsh/wiki/Themes) 3.[oh my zsh 源码仓库](https://github.com/ohmyzsh/ohmyzsh/) 最后修改:2022 年 12 月 20 日 © 允许规范转载 打赏 赞赏作者 支付宝微信 赞 0 如果觉得我的文章对你有用,请随意赞赏