DEV Community

Discussion on: Dotfiles - How to Configure your Shell (intro)

Collapse
 
technoplato profile image
Michael Lustig - halfjew22@gmail.com

Hey Mike, not sure if you mention it down the line, but I HIGHLY recommend yadm to manage all of your dotfiles. Makes everything a cinch, even for the not so gritty hackers.

Collapse
 
michaelcurrin profile image
Michael Currin

Heya thanks for sharing. I've added a link to one of its pages in this post.

I am interested to see how it works. I added an explanation at the end above of how my setup works.

Collapse
 
technoplato profile image
Michael Lustig - halfjew22@gmail.com

Very cool man. Just followed!

It sounds like your setup is exactly what yadm does, so looks like we're on the same page. I'm newly getting into customizing my dots and even caring about the level of customizability that brings, so for me as a beginner, it was simple enough.

Thread Thread
 
michaelcurrin profile image
Michael Currin • Edited

Glad to hear.

I added a setup script in my repo which does this essentially. It adds the symlinks for me so it is easy to run across machines when I make changes.

SHELL_CONFIGS_DIR=~/repos/shell-dev-configs

# Bash array
CONFIGS=(
  .aliases
  .profile
  .commonrc .bashrc .zshrc
  .vimrc
  .gitconfig .gitignore
)


# Symlink repo's .foo as a new file ~/.foo
for CONFIG in ${CONFIGS[@]}; do
  ln -sf "$SHELL_CONFIGS_DIR/$CONFIG" "$CONFIG"
done

The -f will overwrite existing symlinks in case they broke.

I also do a check to see if the files are text files to remind me to move their content out.