Hacker News new | ask | show | jobs
by sandreas 648 days 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/*
2 comments

Shouldn'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.
Yeah 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.
Consult the documentation for your programs whether they already look in ~/.config and thus don't need a environment variable.
I don't want them in `.config` though :-) I'd like to specify the location to a personal git repository, that is not named `.config` :-)