4 ms·
What happens when you need to link a file that does not support comments like that? For example, something which stores its config as plain JSON. Or how about
by dolni 2y ago
What happens when you need to link a file that does not support comments like that? For example, something which stores its config as plain JSON.
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.
- dansalias 2y agoThe JSON hiccup occured to me - I don't have any JSON dotfiles but I guess I'd store it as hjson (https://hjson.github.io/ https://hjson.github.io/) and add a conversion step. 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.
- arcanemachiner 2y agoHuh. Seems like an interesting alternative to JSONC.
- blueflow 2y agoI'm not using a dotfiles manager, i track my ~/.config in git and have a script that globs for ~/.config/*/dot.* files to create symlinks for them. Like ~/.config/bash/dot.bashrc . Works with directories.
- sandreas 2y agoI 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.
- MrDresden 2y agoSounds like a job for a personal Ansible playbook.