/dotfiles

Primary LanguageShellMIT LicenseMIT

baobaozi dotfiles

dotfiles

Your dotfiles are how you personalize your system. These are mine. I stole them from Tyson. Who stole them from Holman.

I was a little tired of having long alias files and everything strewn about (which is extremely common on other dotfiles projects, too). That led to this project being much more topic-centric. I realized I could split a lot of things up into the main areas I used (Ruby, git, system libraries, and so on), so I structured the project accordingly.

If you're interested in the philosophy behind why projects like these are awesome, you might want to read Zach Holman’s post on the subject.

install

Open Terminal, pre-install things:

  1. Make sure git is installed (should be)
  2. Make sure brew is installed (/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" or check Brew website for the command)

Run this:

git clone https://github.com/roubaobaozi/dotfiles.git ~/.dotfiles
cd ~/.dotfiles
script/bootstrap

I thought I had split Brewfiles working but maybe I didn't. Anyway, you can just do:

brew bundle

.. to install the default Brewfile, and

brew bundle --file Brewfile-home

.. to install a particular Brewfile.

Then:

  1. Restart computer. Open iTerm2 and ignore Terminal forever.
  2. In Preferences > Profiles > Default (already selected) > General > Command, enter /bin/zsh

Now whenever you open iTerm2, it will run zsh.

This will symlink the appropriate files in .dotfiles to your home directory. Everything is configured and tweaked within ~/.dotfiles.

The main file you'll want to change right off the bat is zsh/zshrc.symlink, which sets up a few paths that'll be different on your particular machine.

dot is a simple script that installs some dependencies, sets sane OS X defaults, and so on. Tweak this script, and occasionally run dot from time to time to keep your environment fresh and up-to-date. You can find this script in bin/.

M1 mac troubleshooting

  1. touch /opt/homebrew/etc/grc.bashrc
  2. /opt/homebrew/opt/zplug/cache/
  3. touch command.zsh defer_1_plugin.zsh defer_2_plugin.zsh defer_3_plugin.zsh fpath.zsh lazy_plugin.zsh theme.zsh
  4. exec zsh or restart iTerm

topical

Everything's built around topic areas. If you're adding a new area to your forked dotfiles — say, "Java" — you can simply add a java directory and put files in there. Anything with an extension of .zsh will get automatically included into your shell. Anything with an extension of .symlink will get symlinked without extension into $HOME when you run script/bootstrap.

what's inside

A lot of stuff. Seriously, a lot of stuff. Check them out in the file browser above and see what components may mesh up with you. Fork it, remove what you don't use, and build on what you do use.

components

There's a few special files in the hierarchy.

  • bin/: Anything in bin/ will get added to your $PATH and be made available everywhere.
  • Brewfile: This is a list of applications for Homebrew Cask to install: things like Chrome and 1Password and stuff. Might want to edit this file before running any initial setup.
  • topic/*.zsh: Any files ending in .zsh get loaded into your environment.
  • topic/path.zsh: Any file named path.zsh is loaded first and is expected to setup $PATH or similar.
  • topic/completion.zsh: Any file named completion.zsh is loaded last and is expected to setup autocomplete.
  • topic/install.sh: Any file named install.sh is executed when you run script/install. To avoid being loaded automatically, its extension is .sh, not .zsh.
  • topic/*.symlink: Any files ending in *.symlink get symlinked into your $HOME. This is so you can keep all of those versioned in your dotfiles but still keep those autoloaded files in your home directory. These get symlinked in when you run script/bootstrap.