您当前的位置: 首页 >  macos

liaowenxiong

暂无认证

  • 1浏览

    0关注

    1171博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

MacOS安装zsh插件zsh-autosuggestion(自动命令补全和建议)

liaowenxiong 发布时间:2021-10-29 21:04:19 ,浏览量:1

文章目录
  • 安装命令一
  • 安装命令二
  • 安装命令三
  • 使用

插件 zsh-autosuggestion 用于命令建议和补全。

GitHub主页:https://github.com/zsh-users/zsh-autosuggestions

安装命令一
cd ~/.oh-my-zsh/custom/plugins/ 
git clone https://github.com/zsh-users/zsh-autosuggestions

接着编辑隐藏文件 ~/.zshrc,找到 plugins=()

vi ~/.zshrc

找到 plugins,加上 zsh-autosuggestions 这个插件: 在这里插入图片描述

安装命令二
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
安装命令三
brew install zsh-autosuggestions

最终的效果: 在这里插入图片描述

如果补全命令的字体不太清晰,与背景颜色太过相近,可以自己调整一下字体颜色。

Preferences -> Profiles -> Colors 中的 Foreground 是标准字体颜色,ANSI Colors 中 Bright 的第一个是补全的字体颜色,如下所示: 在这里插入图片描述

使用

如果提示的是你要的那句命令,按右箭头(→ )就可以补全命令了。

关注
打赏
1661566967
查看更多评论
立即登录/注册

微信扫码登录

0.0478s