dotfiles

My favorite bash aliases and personal CLI config files

View the Project on GitHub matt-heindel/dotfiles

Dotfiles

Why Track Dotfiles?

Dotfiles (like ~/.vimrc, ~/.bashrc, etc. in your home directory) manage the configurations, themes, and settings that you customize within your command line environment. Storing them in a GitHub repository ensures all your favorite configurations are safe and sound in a central place. If you ever want to revert back to a previous configuration, your hard drive gets damaged, or you want to replicate and sync your environment on another machine, you can do so with just a few simple steps.

Dotfiles Tracked in this Repo

My Favorite Configurations

$ gml
* f074c20 2021-07-07 | Update `README` image links (HEAD -> main, origin/main) [Matt Heindel]
* 2d32e40 2021-07-05 | Add alias functions for managing server ports [Matt Heindel]
* ac0df26 2021-07-04 | Add welcome message that displays suggested files on opening bash [Matt Heindel]
* f728b13 2021-07-04 | New alias `cl` combines `cd` and `ls` commands [Matt Heindel]
* 9462a79 2021-07-04 | Modify alias `l` to sort files by most recent modification [Matt Heindel]

Complete Guide

If you’d like to track your dotfiles, check out this helpful blog post for a full guide.

Syncing from this Repository

When adding the configuration files here to a new machine, enter the following commands into bash.

cd ~
git clone https://github.com/matt-heindel/dotfiles.git
cd ~/dotfiles
chmod +x makesymlinks.sh
./makesymlinks.sh

Updating Tracked Dotfiles

Any time you change a tracked dotfile, make sure to:

  1. git push from the machine with updates
  2. git pull to any other machines you work on

Adding / Removing a Tracked Dotfile

When tracking a new file or removing a file from tracking, a few extra step are required.

  1. Open the makesymlinks.sh file in vim

     vim ~/dotfiles/makesymlinks.sh  
    
  2. Scroll to the Variables section and update the line files="..." to be a space separated list of all dotfiles in the specified directory

########## Variables

dir=~/dotfiles                    # dotfiles directory
olddir=~/dotfiles_old             # old dotfiles backup directory
# update files to match dir
files="bashrc vimrc bash_profile bash_aliases gitconfig"    # list of files/folders to symlink in homedir

##########

Remember in vim pressing i enters insert mode

  1. Close and save with Esc then :wq
  2. git commit with a descriptive message of changes
  3. git push

References