如何为我的 .zshrc 文件指定自定义路径? [英] How to specify a custom path for my .zshrc file?
本文介绍了如何为我的 .zshrc 文件指定自定义路径?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试将 .zshrc 移动到我将此类文件与 Github 同步的文件夹中.
I'm trying to move .zshrc to a folder where I keep this kind of files synced with Github.
但是现在每当我启动 zsh 会话时,它都不会使用该配置文件.
But now whenever I start a zsh session it doesn't use that config file.
假设我将文件更改为 ~/.dotfiles,如何将 ~/.dotfiles/.zshrc 添加到 PATH(?!) 以使 zsh 以该配置开始?
Assuming I changed the file to ~/.dotfiles how can I add ~/.dotfiles/.zshrc to the PATH(?!) to make zsh start with that config?
执行 source ~./dotfiles/.zshrc 仅适用于该会话.如果我关闭终端就不再工作了.
Doing source ~./dotfiles/.zshrc only works for that session. Doesn't work anymore if I close the terminal.
推荐答案
您可以symlink
:
ln -s /path/to/original /path/to/symlink
对于 zshrc
,您可以执行以下操作:
For the zshrc
you can do something like:
ln -s ~/.dotiles/.zshrc ~/.zshrc
这篇关于如何为我的 .zshrc 文件指定自定义路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文