哦-my-zsh插件无法正常工作

k_w*_*ski 15 zsh zshrc

我刚刚发现了哦-my-zsh,但我无法让它发挥作用.虽然主题工作得非常完美,但插件却没有.我选择了一些插件,例如.macports,但我既没有端口命令完成也没有适当的别名工作.这是我的.zshrc:



    # Path to your oh-my-zsh configuration.
    export ZSH=$HOME/.oh-my-zsh

    # Set name of the theme to load.
    # Look in ~/.oh-my-zsh/themes/
    # Optionally, if you set this to "random", it'll load a random theme each
    # time that oh-my-zsh is loaded.
    export ZSH_THEME="steeef"

    # Set to this to use case-sensitive completion
    # export CASE_SENSITIVE="true"

    # Comment this out to disable weekly auto-update checks
    # export DISABLE_AUTO_UPDATE="true"

    # Uncomment following line if you want to disable colors in ls
    # export DISABLE_LS_COLORS="true"

    # Uncomment following line if you want to disable autosetting terminal title.
    # export DISABLE_AUTO_TITLE="true"

    # Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
    # Example format: plugins=(rails git textmate ruby lighthouse)
    plugins=(git osx github macports textmate svn)

    source $ZSH/oh-my-zsh.sh

    # Customize to your needs...
    export     PATH=/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/local/sbin/:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/local/sbin/:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11/bin:/usr/local/cuda/bin:/usr/local/cuda/bin:/opt/local/bin:/opt/local/sbin
Run Code Online (Sandbox Code Playgroud)

textmate和osx插件似乎也不起作用 - zsh只是抱怨未知命令并停止.git和svn有一些基本的完成,但我不确定它是由插件完成还是只是正常的zsh完成.我是否必须导出一些东西才能使用这些插件?或者如果没有,该怎么做才能解决这个问题?

T. *_*eus 25

在初始化zsh之前,请确保定义了plugins变量:

plugins=(git wd)
export ZSH=/home/<user>/.oh-my-zsh
source $ZSH/oh-my-zsh.sh
Run Code Online (Sandbox Code Playgroud)

  • 对我来说,解决方案是将 `source $ZSH/oh-my-zsh.sh` 移动到 .zshrc 的末尾,在我所有的用户配置之后。 (4认同)

doc*_*hat 10

我有点喜欢这个.

发生了什么事情是你手动安装手动安装的说明没有提到你需要PATH自己设置.

所以你最终得到了默认的PATH.自动设置代码的源复制您当前的路径并将其附加到.zshrc,如果您依赖非标准PATH条目(例如,您在Mac上运行Homebrew),这是不够的.

所以修复很简单:

启动旧shell及其配置文件,然后将值复制并粘贴$PATH~/.zshrc文件顶部.

再见!

  • 你知道*为什么*这会导致你的插件无法工作(zsh 在路径上需要什么?)我似乎无法让我的插件工作(在 arch linux 上)。 (3认同)