Skip to content

WillChilds-Klein/dotfiles

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dotfiles

This repository represents my dotfiles stuff integrated with the great work done by Ben Alman. I added my stuff, and kept that of his which I liked (a lot, including 95% of this README) from his original repository, which can be found here.

How the "dotfiles" command works

When [dotfiles][dotfiles] is run for the first time, it does a few things:

  1. In Ubuntu, Git is installed if necessary via APT (it's already there in OSX).
  2. This repo is cloned into your user directory, under ~/.dotfiles.
  3. Files in /copy are copied into ~/. (read more)
  4. Files in /link are symlinked into ~/. (read more)
  5. You are prompted to choose scripts in /init to be executed. The installer attempts to only select relevant scripts, based on the detected OS and the script filename.
  6. Your chosen init scripts are executed (in alphanumeric order, hence the funky names). (read more)

On subsequent runs, step 1 is skipped, step 2 just updates the already-existing repo, and step 5 remembers what you selected the last time. The other steps are the same.

The "copy" step

Any file in the /copy subdirectory will be copied into ~/. Any file that needs to be modified with personal information (like copy/.gitconfig which contains an email address and private key) should be copied into ~/. Because the file you'll be editing is no longer in ~/.dotfiles, it's less likely to be accidentally committed into your public dotfiles repo.

The "link" step

Any file in the /link subdirectory gets symlinked into ~/ with ln -s. Edit one or the other, and you change the file in both places. Don't link files containing sensitive data, or you might accidentally commit that data! If you're linking a directory that might contain sensitive data (like ~/.ssh) add the sensitive files to your .gitignore file!

The "init" step

Scripts in the /init subdirectory will be executed. A whole bunch of things will be installed, but only if they aren't already.

Other subdirectories

  • The /backups directory gets created when necessary. Any files in ~/ that would have been overwritten by files in /copy or /link get backed up there.
  • The /bin directory contains executable shell scripts (including the dotfiles script) and symlinks to executable shell scripts. This directory is added to the path.
  • The /caches directory contains cached files, used by some scripts or functions.
  • The /source directory contains files that are sourced whenever a new shell is opened (in alphanumeric order, hence the funky names).

Aliases and Functions

To keep things easy, the ~/.bashrc and ~/.bash_profile files are extremely simple, and should never need to be modified. Instead, add your aliases, functions, settings, etc into one of the files in the source subdirectory, or add a new file. They're all automatically sourced when a new shell is opened. Take a look, I have a lot of aliases and functions. I even have a fancy prompt that shows the current directory, time and current git/svn repo status.

Inspiration

https://github.com/cowboy/dotfiles/ https://github.com/gf3/dotfiles
https://github.com/mathiasbynens/dotfiles

About

My OS X / Ubuntu dotfiles.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 65.9%
  • Vim Script 9.3%
  • Perl 9.1%
  • Ruby 8.4%
  • Python 7.3%