[Ubuntu] zsh

安装

详见 https://github.com/ohmyzsh/ohmyzsh

方法一

apt install zsh
wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh
sh install.sh

下载插件 zsh-autosuggestionszsh-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:交换光标和之前的字符

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值