ShakaCode | ShakaCode Blog | Rails On Maui Blog | Rails | ReactJs | JavaScript | Webpack | Productivity |

Setup of my dotfiles


#1

Goals:

  1. Have a public repo of dotfiles to share with community.
  2. Have a private repo of dotfiles for personal configurations.

Tools:

  1. Symlinks and gnu stow to link some dotfiles to my home directory. You can install stow with brew install stow. Here’s a couple articles on stow: Simple article on stow and Stow for more complex things.
  2. A couple ENV vars for my public and private dotfile setups.

Let’s run stow with options -n -v to see what it plans to do:

➜  ~/dotfiles/justin808-dotfiles (master u=) ✗ stow -t ~/ -n -v home                                                                                                                                                                                           ✖ ✭ [22:23:28]
LINK: .gemrc => dotfiles/justin808-dotfiles/home/.gemrc
LINK: .gitignore_global => dotfiles/justin808-dotfiles/home/.gitignore_global
LINK: .irbc => dotfiles/justin808-dotfiles/home/.irbc
LINK: .pryrc => dotfiles/justin808-dotfiles/home/.pryrc
LINK: .tmux.conf => dotfiles/justin808-dotfiles/home/.tmux.conf
LINK: .vimrc => dotfiles/justin808-dotfiles/home/.vimrc
LINK: .zshrc => dotfiles/justin808-dotfiles/home/.zshrc
WARNING: in simulation mode so not modifying filesystem.

Then after running the command again, from the directory above home:

stow -t ~/ -v home

Here’s a nifty find command to list the symlinks in the home directory:

find ~ -maxdepth 1 -type l | xargs ls -al

Here’s the output:

➜  ~/dotfiles/justin808-dotfiles (master u=) ✗ find ~ -maxdepth 1 -type l | xargs ls -al                                                                                                                                                                       ✖ ✭ [22:26:14]
lrwxr-xr-x  1 justin  staff  39 Oct 18 22:25 /Users/justin/.gemrc -> dotfiles/justin808-dotfiles/home/.gemrc
lrwxr-xr-x  1 justin  staff  50 Oct 18 22:25 /Users/justin/.gitignore_global -> dotfiles/justin808-dotfiles/home/.gitignore_global
lrwxr-xr-x  1 justin  staff  38 Oct 18 22:25 /Users/justin/.irbc -> dotfiles/justin808-dotfiles/home/.irbc
lrwxr-xr-x  1 justin  staff  39 Oct 18 22:25 /Users/justin/.pryrc -> dotfiles/justin808-dotfiles/home/.pryrc
lrwxr-xr-x  1 justin  staff  43 Oct 18 22:25 /Users/justin/.tmux.conf -> dotfiles/justin808-dotfiles/home/.tmux.conf
lrwxr-xr-x  1 justin  staff  39 Oct 18 22:25 /Users/justin/.vimrc -> dotfiles/justin808-dotfiles/home/.vimrc
lrwxr-xr-x  1 justin  staff  39 Oct 18 22:25 /Users/justin/.zshrc -> dotfiles/justin808-dotfiles/home/.zshrc