linux修改shell,以及安装zsh配置oh-my-zsh.md

查看当前shell

echo $SHELL

查看系统中有哪些shell

cat /etc/shells

修改shell,输入要切换的shell,例/bin/zsh

chsh -s /bin/zsh


安装zsh

yum install -y zsh

oh-my-zsh

  • 克隆zsh
    git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
  • github拉不下来的话去gitee
    git clone https://gitee.com/mirrors/oh-my-zsh.git ~/.oh-my-zsh

复制 .zshrc

cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc

修改主题,vim ~/.zshrc,修改以下这一行

ZSH_THEME="ys"

安装自动补全插件zsh-autosuggestions

  • 克隆zsh-autosuggestions
    git clone https://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions
  • 修改~/.zshrc,在plugins中添加zsh-autosuggestions

安装语法高亮插件zsh-syntax-highlighting

  • 克隆zsh-syntax-highlighting
    git clone https://github.com/zsh-users/zsh-syntax-highlighting ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting
  • 修改~/.zshrc,在plugins中添加zsh-syntax-highlighting
  • 如果要修改提示的颜色,就在~/.zshrc文件中新增一句ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=yellow'
    • 颜色仅支持:black, red, green, yellow, blue, magenta, cyan, white
posted @ 2024-04-29 15:08  武胜造纸农  阅读(110)  评论(0)    收藏  举报