zsh

How to specify a custom path for my .zshrc file?


I'm trying to move .zshrc to a folder where I keep this kind of files synced with Github.

But now whenever I start a zsh session it doesn't use that config file.

Assuming I changed the file to ~/.dotfiles how can I add ~/.dotfiles/.zshrc to the PATH(?!) to make zsh start with that config?

Doing source ~./dotfiles/.zshrc only works for that session. Doesn't work anymore if I close the terminal.


Solution

  • You can symlink:

    ln -s /path/to/original /path/to/symlink
    

    For the zshrc you can do something like:

    ln -s ~/.dotiles/.zshrc ~/.zshrc