I am setting up ZSH with oh-my-zsh, and I want to preserve my .bashrc and .bash_aliases configurations.

From ~/.zshrc I read that:

Aliases can be placed here, though oh-my-zsh users are encouraged to define aliases within the ZSH_CUSTOM folder.

In the $ZSH_CUSTOM folder I find an example.zsh file that says:

You can put files here to add functionality separated per file, which will be ignored by git. Files on the custom/ directory will be automatically loaded by the init script, in alphabetical order.

Sounds great! Let's copy my bash files in there.

BUT it's not working! If I try one of my aliases I get:

zsh: command not found

I tried removing the dot from the files' names but no change.

What's happening?

(If I source the files manually it works.)

  • Why not just put the aliases in ~/.zshrc and skip the oh-my-zsh baggage? – thrig Sep 7 '16 at 14:54
  • Are you using oh-my-zsh or not? ZSH_CUSTOM is an oh-my-zsh thing. – Gilles 'SO- stop being evil' Sep 7 '16 at 22:52
  • @Gilles yes I am using oh-my-zsh, will edit to clarify. – MasterScrat Sep 8 '16 at 9:30
  • @thrig that's what I'm doing right now but I'd prefer to do it the way it is intended. – MasterScrat Sep 8 '16 at 9:30
  • 1
    Did you add the .zsh extension to your files? – Wieland Sep 8 '16 at 11:01

Files you create in $ZSH_CUSTOM need to have a file extension of .zsh, according to the documentation:

oh-my-zsh's internals are defined in its lib directory. To change them, just create a file inside the custom directory (its name doesn't matter, as long as it has a .zsh ending)

If you just copied .bashrc and .bash_aliases into it, oh-my-zsh will therefore ignore them.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.