4 ms·
I prefer using ONE symlinked ~/.zshrc -> ~/dotfiles/etc/zsh/.zshrc and then using ENV-Variables within the .zshrc to specifiy other config file locations: #
by sandreas 2y ago
I prefer using ONE symlinked ~/.zshrc -> ~/dotfiles/etc/zsh/.zshrc and then using ENV-Variables within the .zshrc to specifiy other config file locations:
# starship
export STARSHIP_CONFIG="$HOME/dotfiles/etc/starship/starship.toml"
# git
export GIT_CONFIG_GLOBAL="$HOME/dotfiles/etc/git/.gitconfig"
# vim
export MYVIMRC="$HOME/dotfiles/etc/vim/vimrc"
export VIMINIT='source $MYVIMRC'
# ...
So one symlink is enough :-) Something similar can be done for ssh config (this file can not be symlinked for security reasons, so be careful working around this "feature"):
# contents of $HOME/.ssh/config
Include ~/dotfiles/etc/ssh/hosts.d/*
- blueflow 2y agoConsult the documentation for your programs whether they already look in ~/.config and thus don't need a environment variable.
- sandreas 2y agoI don't want them in `.config` though :-) I'd like to specify the location to a personal git repository, that is not named `.config` :-)
- deleted 2y ago[deleted]
- retrodaredevil 2y agoShouldn't you at least put those environment variables in ~/.profile? You'd want to make sure applications like VS Code and whatnot pick up the configurations. ~/.zshrc would only be used for interactive zsh sessions, which not all applications would respect/use.
- sandreas 2y agoYeah I should, but since it only contains tools I tend to start from zsh, I did not care too much :-) thanks for the hint though, almost forgot that.