by dolni · 2y ago · 0 comments
Or how about when you want to symlink an entire directory? For example something like neovim, considering that you may want to split config into separate files for organization. My neovim configuration has an "autoload setup" so any lua files inside the config directory are automatically required.
Lastly, this approach does not appear to support running commands. My dotfile install script ensures that tmux plugins are installed, the terminal font I use is available, and some other stuff that you need to invoke a command or script to achieve.
I like that the approach is simple, but I do not think it can support even relatively common use cases very well.
# 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/*Symlinking a directory - admittedly didn't come up for my dotfiles, maybe `.ln` files with a similar format in dir roots.
Commands - yes, I still keep a set of shell scripts alongside my config files.