To install, run ./setup.sh from within the local dotfiles directory. Quit and re-launch the terminal.
git clone https://github.com/timtr/dotfiles.git
cd dotfiles
./setup.sh
Once installed, you can always run dotfiles.sh from the PATH to reset your config. For instance, simply delete the ~/local.sh file and then run dotfiles.sh to restore it to the default config. You can also run help.sh to see additional functionality. If the above install fails on macOS ensure you have Xcode installed.
More detailed documentation is available as a work in progress.
This is the personal collection of setup scripts for macOS and Linux (WIP). It includes settings for zsh, macOS Terminal, Xcode, Swift, and other tools and apps. This set will also install Homebrew and a recent version of Ruby.
The setup will assume your settings are configured directly within the dotfiles directory where you cloned this repo. It will also add ~/Bin and /opt/homebrew/bin to the PATH for local scripts and Homebrew support.
Amost the most important pieces is the dotfiles/Config/dot-gitignore file that installs into ~/.gitignore since that filters out build and other temporary files.
The Config directory includes a dot-gitconfig-work file that is installed to control the Git behavior for respositories in the ~/Work directory. In this case, it is setting up to do code signing at commit time, and changing the username and email for those commits. This general approach can work for any sub-directory custom configuration, especially for custom email addresses depending on the directory they are stored in on disk. Feel free to edit to match your workflow and configuration.
local.sh - A file called ~/local.sh is installed (if doesn’t exist) that you can customize with settings that do not belong checked into GitHub, for instance set certain keys, or environment variables. This is also the file to add things like feature flags during development, define a Swift toolchain, or to enable secret build settings. Re-running dotfiles.sh will never override this file, so if you want to restart from scratch, just delete the file and the re-install dotfiles to get a fresh setup.
dotfiles.sh - run this at any time to reset all settings (it is in $PATH).
ZSH dotfiles - set up the prompt, $PATH, and other basic settings. The .zshenv file sets up $PATH so it works even when there is no interactive terminal session, and .zshrc will source this file as well.
Dropbox - Optional symlink in $HOME points to ~/Library/CloudStorage/Dropbox if Dropbox is installed on the computer. This is often commented out.
You can download new Swift toolchains from Swift.org and set them to be used by default. The ~/local.sh file is perfect to place to configure these settings per-machine, rather than configure in the main Dotfiles repo.
Once installed, you can install Homebrew and run demos. For example, run demo-homebrew.sh from the Dotfiles/Demos to show a Terminal screen of software being downloaded, built, installed, and erased (in a repeating loop). Hit CONTROL-Z to quit that demo.
You can also open the Dotfiles/Demos/demo-safari-cycle.html file to launch Safari and begin cycling through many web pages, simulating an automated web test harness.
Documentation (or the start of docs) can be found here. Note that the docs directory must be in lower-case for GitHub Pages support. Capital Docs will fail.
Which zsh files contain which settings: CodeSpaces and Dotfiles
Docs on using setup.sh with GitHub CodeSpaces and Dotfiles
For reference, zsh config files are loaded in the following order:
.zshenv -- global (even non-interactive), useful for PATH and tooling variables
.zshrc -- loaded from the interactive shell (e.g. a Terminal window)
.zprofile -- if login (not using this file in current setup)
// end of file.