Review the install script. Running zsh install
will get things rolling.
NOTE: This repo uses the 1Password CLI to inject secret keys into files from templates.
install
- sets up PATH, exports, symlinks, functions, and symlinksbin
to your home directory. This can and should be run regularly.new_machine
- this is only needed when you have a new machine and want to setup the basics.
NOTE: "hidden files" (files that have a dot in front of their name like
.personal-token
) are git-ignored by default.
The aliases directory contains the aliases/index.sh that sources all other alias files, and is called by the .zshrc
file located in symlinks/zsh/zshrc.sh.
- All files in the root of exports get sourced by
~/.zshrc
except for theexports/path/
directory. - All environment variables are managed in exports, and hidden files are gitignored in case you want to keep secrets in environment variables.
- The exports/path directory is used to create the PATH variable when you run
zsh install
. The output is saved in the~/dotfiles/exports/path/PATH.sh
and is sourced by all shells.PATH.sh
is gitignored. - You can sort PATH directories by numbering the files in exports/path like 01_default.sh, 02_homebrew.sh, etc.
- The contents of these files may include multiple directories on new lines:
# exports/path/01_default.sh
/bin
/sbin
/usr/local/bin
/usr/bin
/usr/sbin
- The exports/path/install.sh script is only executed when you run the ~/dotfiles/install script.
- The
~/.zshrc
in ~/dotfiles/symlinks/zsh/zshrc.sh sources the~/dotfiles/exports/path/PATH.sh
by callingsource ~/dotfiles/exports/path/PATH.sh
.
Usepathadd
to quickly add a new directory to your PATH from the command-line. When you runpathadd /some/directory
it gets added to the PATH, then gets added to a file called exports/path/99_tmp.sh for you to sort or commit.
Functions are loaded into your shell when the .zshrc
file located in symlinks/zsh/zshrc.sh calls source ~/dotfiles/functions/index.sh
. Any function created here is available anywhere.
Symlinks are setup in symlinks/install.sh which is only executed when you run the ~/dotfiles/install script.
The entire symlinks/bin directory gets symlinked to the user's $HOME/bin
directory, and each sub-directory is then added to the ~/dotfiles/exports/path/PATH.sh
when you run the ~/dotfiles/install script.
op
requiresop signin
stree
requireschown-ing
/usr/local/bin
to the current user before it will install the command line tools. They have no user-elevation privilege functionality (apparently?)sudo chown $(whoami): /usr/local/bin
then SourceTree --> Preferences --> Install Command-Line Tools --> thensudo chown root: /usr/local/bin
to set it back. Not sure if this is the best approach, but it seems to work for now.