Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

oh-my-zsh plugins not working

Tags:

zsh

zshrc

I've just discovered oh-my-zsh, but I can't get it to work. While themes work just perfectly, plugins do not. I have some plugins selected, eg. macports, but neither I get port command completion nor do appropriate aliases work. Here's my .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

textmate and osx plugins also do not seem to work - zsh just complains about unknown command and stops. git and svn have some basic completion but I'm not sure whether it's done by plugin or just a normal zsh completion. Do I have to export something to use those plugins? Or if not, what to do to have that fixed?

like image 523
k_wisniewski Avatar asked Jul 23 '11 14:07

k_wisniewski


People also ask

Where are zsh plugins stored?

Custom plugins can be installed at ~/. oh-my-zsh/custom/plugins . To use a plugin, you can simply add it to the plugins list in your ~/. zshrc file.

How do you update oh my zsh plugins?

Usage. Add autoupdate to the plugins=() list in your ~/. zshrc file and you're done. The updates will be executed automatically as soon as the oh-my-zsh updater is started.

What do oh my zsh plugins do?

oh-my-zsh is a community-driven framework for managing your ZSH configuration. Includes 120+ optional plugins (rails, git , macOS, hub , capistrano , brew , ant , macports, etc), over 120 themes to spice up your morning, and an auto-update tool that makes it easy to keep up with the latest updates from the community.


4 Answers

Make sure that you define your plugins variable before you initialize zsh:

plugins=(git wd) export ZSH=/home/<user>/.oh-my-zsh source $ZSH/oh-my-zsh.sh 
like image 139
T. Arboreus Avatar answered Nov 17 '22 20:11

T. Arboreus


I got bitten by this.

What happened is you did a manual install and the instructions for the manual install don't mention that you need to set the PATH yourself.

So you end up with the default PATH. The source for the automatic setup code copies your current path and appends it to the .zshrc, which isn't enough if you depend on non-standard PATH entries (e.g. you run Homebrew on a Mac).

So the fix is simple:

Fire up your old shell and its configuration file and then copy and paste the value of $PATH into the top of your ~/.zshrc file.

Ciao!

like image 25
docwhat Avatar answered Nov 17 '22 21:11

docwhat


I had the same problem just now! There was a package called grml-zsh-config installed in my Archlinux. I removed this package and oh-my-zsh themes started to work.

like image 34
Fabio Montefuscolo Avatar answered Nov 17 '22 22:11

Fabio Montefuscolo


In my case, in ~/.zshrc I had repeated plugins variable

plugins=(git)
.
.
.
plugins=(git autojump zsh-syntax-highlighting zsh-autosuggestions)

Check to see if this is the case with you because with this only your git plugin will be used.

Remove the first plugins variable and it should work.

like image 36
Satya Prakash Avatar answered Nov 17 '22 22:11

Satya Prakash