问小白 wenxiaobai
资讯
历史
科技
环境与自然
成长
游戏
财经
文学与艺术
美食
健康
家居
文化
情感
汽车
三农
军事
旅行
运动
教育
生活
星座命理

推荐 6 个超好用的 iterm2 zsh 插件

创作时间:
作者:
@小白创作中心

推荐 6 个超好用的 iterm2 zsh 插件

引用
CSDN
1.
https://blog.csdn.net/oliver940910/article/details/138670561

本文将介绍6个实用的iterm2 zsh插件,这些插件可以显著提高命令行使用效率。每个插件都经过精心挑选,能够解决日常开发中常见的痛点。

zsh-autosuggestions

插件地址https://github.com/zsh-users/zsh-autosuggestions

效果展示:当你输入命令时,插件会基于之前执行过的命令自动给出提示,非常实用。

安装方法

  1. 通过Git克隆到$ZSH_CUSTOM/plugins目录:

    git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
    
  2. 或者使用Homebrew安装:

    brew install zsh-autosuggestions
    
  3. .zshrc中配置:

    plugins=(
        # other plugins...
        zsh-autosuggestions
    )
    
  4. 如果使用Homebrew安装,还需要在.zshrc最后增加激活插件的命令:

    source $(brew --prefix)/share/zsh-autosuggestions/zsh-autosuggestions.zsh
    

autojump

插件地址https://github.com/wting/autojump

效果展示:autojump允许你通过简短的命令快速跳转到常用目录。例如,从根目录直接跳转到temp目录只需输入j temp

安装方法

  1. 使用Homebrew安装:

    brew install autojump
    
  2. 或者手动安装:

    git https://github.com/wting/autojump $ZSH_CUSTOM/plugins/autojump
    cd $ZSH_CUSTOM/plugins/autojump
    ./install.py
    
  3. .zshrc中配置:

    plugins=(
        # other plugins...
        autojump
    )
    

zsh-better-npm-completion

插件地址https://github.com/lukechilds/zsh-better-npm-completion

效果展示:输入npm run后按下tab键,可以自动弹出项目中的所有scripts,支持使用tabctrl + nctrl + p进行选择。

安装方法

  1. 克隆插件代码到zsh插件目录:

    git clone https://github.com/lukechilds/zsh-better-npm-completion ~/.oh-my-zsh/custom/plugins/zsh-better-npm-completion
    
  2. .zshrc中配置:

    plugins=(
        # other plugins...
        zsh-better-npm-completion
    )
    

zsh-syntax-highlighting

插件地址https://github.com/zsh-users/zsh-syntax-highlighting

效果展示:该插件为关键字提供高亮显示,错误命令也会报红,使命令输入更加直观。

安装方法

  1. 克隆项目到zsh插件目录:

    git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
    
  2. .zshrc中配置:

    plugins=(
        # other plugins...
        zsh-syntax-highlighting
    )
    

zsh-vi-mode

插件地址https://github.com/jeffreytse/zsh-vi-mode

效果展示:该插件允许你在命令行中使用vi模式进行编辑,对于熟悉vim的用户非常友好。

安装方法

  1. 克隆插件到zsh插件目录:

    git clone https://github.com/jeffreytse/zsh-vi-mode $ZSH_CUSTOM/plugins/zsh-vi-mode
    
  2. .zshrc中配置:

    plugins=(
        # other plugins...
        zsh-vi-mode
    )
    

copypath和copybuffer

这两个是zsh自带的插件,不需要额外配置:

  • copypath:将当前目录快速复制到剪切板。
  • copybuffer:映射到ctrl + o快捷键,用于复制当前终端显示的命令。

you-should-use

插件地址https://github.com/MichaelAquilina/zsh-you-should-use

效果展示:在你输入命令时,插件会自动给出更好的命令建议。

安装方法

  1. 克隆插件到zsh插件目录:

    git clone https://github.com/MichaelAquilina/zsh-you-should-use.git $ZSH_CUSTOM/plugins/you-should-use
    
  2. .zshrc中配置:

    plugins=(
        # other plugins...
        you-should-use
    )
    

总结

以上插件都是作者在日常使用中觉得非常实用的zsh插件。使用命令行操作不仅很酷,而且很多时候比用鼠标操作更高效。如果你有其他好用的插件或提效工具,欢迎分享。

本文原文来自CSDN

© 2023 北京元石科技有限公司 ◎ 京公网安备 11010802042949号