安装
详见 https://github.com/ohmyzsh/ohmyzsh
方法一
apt install zsh
wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh
sh install.sh
下载插件 zsh-autosuggestions
和 zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-autosuggestions.git ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions
// git clone git@github.com:zsh-users/zsh-autosuggestions.git ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting
// git clone git@github.com:zsh-users/zsh-syntax-highlighting.git ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting
配置 zshrc 文件
plugins=(git zsh-syntax-highlighting zsh-autosuggestions)
source ~/.zshrc
命令行输入 zsh
即可进入 zsh 界面。
方法二
apt install zsh
git clone git@github.com:ohmyzsh/ohmyzsh.git ~/.oh-my-zsh
git clone git@github.com:zsh-users/zsh-autosuggestions.git
git clone git@github.com:zsh-users/zsh-syntax-highlighting.git
cp -r zsh-autosuggestions zsh-syntax-highlighting ~/.oh-my-zsh/custom/plugins/
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
sed -i 's/plugins=(git)/plugins=(git zsh-autosuggestions zsh-syntax-highlighting)/g' .zshrc
chsh -s $(which zsh)
exec zsh
// source ~/.zshrc
快捷键
选中即复制,鼠标中键粘贴
ctrl + u:清空当前行
ctrl + a:移动到行首
ctrl + e:移动到行尾
ctrl + f:向前移动
ctrl + b:向后移动
ctrl + p:上一条命令
ctrl + n:下一条命令
ctrl + r:搜索历史命令
ctrl + y:召回最近用命令删除的文字
ctrl + h:删除光标之前的字符
ctrl + d:删除光标所指的字符
ctrl + w:删除光标之前的单词
ctrl + k:删除从光标到行尾的内容
ctrl + t:交换光标和之前的字符