❤️Wsl终端优化配置❤️.md 1.9 KB


notion-id: 821575e8-eb79-4a0e-a40c-274d4083cb

终端输入: sudo apt install zsh 安装zsh安装包 cat /etc/shells 查看已安装终端 chsh -s /bin/zsh 切换成zsh终端 安装Oh My Zsh,注意此安装实在当前用户下安装,root和非root需要安装2次

sh -c "$(curl -fsSL https://gitee.com/mirrors/oh-my-zsh/raw/master/tools/install.sh)"

编辑文档nano ~/.zshrc 修改成ZSH_THEME**=**"random" 关闭终端,重新进入查看是否生效。 使用指令 cd ~/.oh-my-zsh/themes**&&**ls 查看已有主题。 使用指令,安装Powerlevel10k主题

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

编辑文档nano ~/.zshrc 修改成ZSH_THEME="powerlevel10k/powerlevel10k" p10k configure 设置主题 配置插件,插件位置为:~/.oh-my-zsh/custom/plugins 自动补充

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

语法高亮

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

历史搜索

git clone https://github.com/zsh-users/zsh-history-substring-search ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-history-substring-search
open ~/.zshrc
修改
plugins=(git zsh-autosuggestions zsh-syntax-highlighting zsh-history-substring-search)

参考文献: https://www.dotran.top/index.php/2022/07/13/优化命令行shell(windows)/ https://zhuanlan.zhihu.com/p/35283688 https://zhuanlan.zhihu.com/p/265525597 https://github.com/romkatv/powerlevel10k