月度归档:2023年08月

安装ZSH

linux中的安装指令:

sudo apt install zsh

以上的安装只是安装基础组件,还需要配合oh my zsh,才是完美的,安装指令如下:

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

linux中一般默认配置的bash,而不是zsh
查看当前系统的命令解释器使用

cat /etc/shells

更改默认shell

chsh -s /usr/bin/zsh

再安装两个插件

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-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

对了安装两个插件后,配置文件也要改下,
vi ~/.zshrc
找到并注释掉 “plugins=(git)”
添加如下字段

plugins=(
git
zsh-autosuggestions
zsh-syntax-highlighting
vi-mode
)