A command line configuration utility to ensure a consistent experience across every terminal.
-
git clone https://github.com/imyourmanzi/FigTree.git ~/.fig
-
(Optional) Exclude certain seeds:
cp ~/.fig/default.noseed ~/.fig/.noseed
and then uncomment the ones to exclude -
~/.fig/plant
FIG_DEBUG=true ~/.fig/plant
for debugging detailFIG_TRACE=true ~/.fig/plant
for even more detail
-
Start a new shell to see it work
- Running
fig
will take you to your installation of Fig Tree
- Running
-
Run
fig update
to pull latest changes from your upstream -
Run
fig repot
to rerunplant
on an existing installation
Fig Tree defines these custom (and potentially useful) environment variables in your shell's environment.
FIG_HOME
: where Fig Tree was planted (including where the plant script lives)
If available, use bat
instead of cat
.
Simple alias of x
to exit current shell session. Ctrl-D might be faster for some but I've always liked single letter aliases.
Set your Golang install location to be $HOME/.go
, which I found helped with things, particularly on macOS.
Set up conveniences for Homebrew that you probably want anyway (e.g. update $PATH
, tab completion).
My preferred defaults for the ip
command (there was a time when I was using this a lot).
If available, use eza and alias to ls
/etc. to it.
Otherwise, just provide some of my preferred defaults for vanilla ls
.
Enjoy some silly SFW aliases.
kk
imdone
Improvements I made to nvm
. Get the full details here.
For your .zshrc file:
# use this string to change the Node version placeholder for pre-nvm init
# (note: escape sequences may not be supported by your theme)
#DEFAULT_NVM_CURRENT=""
# use this array to add to the default list of commands that require Node
#INIT_NVM_COMMANDS=('mynospacecommand')
Play nicely with Oh My Zsh.
In .zshrc, all Oh My Zsh configuration variables should be set before the source ...
line for Fig Tree.
Use OMZ_THEME_RANDOM_CANDIDATES
for the ZSH_THEME_RANDOM_CANDIDATES
variable.
By default, these plugins are enabled:
git
fzf
(used for history and recursive search)
Use OMZ_PLUGINS
in the same way you'd define the plugins
variable to override the defaults.
If you need to keep your macOS system from sleeping/idling, now you'll be able to do that with infinite more cool-factor, and you can avoid burn-in.
My preferred defaults for pwd
.
My preferred default configuration for pyenv.
Set your Rust install location to be $HOME/.go
, which I found helped with things, particularly on macOS.
My preferred configuration defaults for shell history (Bash only).
My preferred default shell prompt (Bash only).
macOS alias to quickly show or hide hidden files in Finder.
My preferred configuration defaults for Swift developments.
Shortcut for cd ..[/..[/..[ ... ]]]
.
Usage: up
or up <n>
(e.g. up 2
to go up two directories instead of the default 1).
My preferred defaults for using Vim.
Allow Opt–Left/Opt-Right navigation around words in your current command.
Special Case: Grown Perennials
Perennials that are "grown" are ones that copy in an existing configuration file (if present) and modify it. Then, they link that final (grown) version back to where it needs to be.
The only way to update a grown perennial with changes from an upstream repository (i.e. with changes that were not directly made to the .grown file) is to re-run the plant script.
Will prompt you for input and ask for root permissions to run apt install
.
If Homebrew is installed, that will be the preferred package manager and this perennial will not run.
Packages installed:
- cmatrix
- eza (aliased to
ls
) - bat (may be
batcat
, aliased tocat
) - ripgrep (
rg
) - fd-find (
fdfind
) - fzf
Will prompt you for input if Homebrew is installed.
This is the favored package manager. Even if your system has multiple installed/available, only Homebrew will be used.
Packages installed:
- cmatrix
- eza (aliased to
ls
) - bat (aliased to
cat
) - btop
- ripgrep (
rg
) - fd
- fzf
Make Bash on macOS work more like a Linux shell and ensure that .bash_profile calls the .bashrc.
Install Nerd Fonts so you can have fancy icons/etc., needed for various Oh My Zsh themes.
My preferred Git configurations.
May prompt you for input.
A few iTerm2 profiles that might be handy and look cool.
- Fig Tree (Double Line): simple profile with some preselected Oh My Zsh themes, light & dark mode colors from Monokai Pro, and macOS-style keybindings that have two-line prompts (shortcut: Ctrl-Cmd-W)
- Fig Tree (Node): simple profile with some preselected Oh My Zsh themes, light & dark mode colors from Monokai Pro, and macOS-style keybindings that are handy for Node.js development (shortcut: Ctrl-Cmd-N)
- Fig Tree (Single Line): simple profile with some preselected Oh My Zsh themes, light & dark mode colors from Monokai Pro, and macOS-style keybindings that have one-line prompts (shortcut: Ctrl-Cmd-S)
Requires manual steps.
My preferred defaults for Rectangle.
Default to using an ED25519 SSH key for github.com
.
Simple dark theme profile for the built-in macOS Terminal application.
My preferred defaults for using Vim.
A variety of Xcode themes.
- cHAoS: exactly how it sounds—give it a try!
- mz (Dark): simple dark theme
- mz (Light): simple light theme
- mz Presentation (Dark): simple dark theme with large fonts
- mz Presentation (Light): simple light theme with large fonts
- mzDefault: my default Xcode theme
- Quiet Light: mimicking the VS Code built-in theme "Quiet Light"
- Red: mimicking the VS Code built-in theme "Red"
Warning
Lots of extended analogies!
The garden is a shell-specific file that is used to load mix-ins (see below) which is the central file that is called to load in pluggable configurations.
The entire point of the garden is to be the construct that metaphorically holds the shell environment (soil) together.
The shell session's environment is the soil that exists to hold the annual and perennial seeds (configurations). Although shell sessions are removed and recreated, the analogy assumes that the soil is never actually removed.
There are different kinds of configurations that Fig Tree needs to support.
- Perennials — Configurations that only need to be installed (i.e. planted) once and, while installed, will reference a resource in the
.fig
directory.- The roots of perennial plants that survive in the earth throughout winter are akin to the configuration files that live in the
.fig
directory and get called upon when there is a link to them in the proper location for that configuration (usually somewhere in the user’s home directory). Also in this way, these configurations do not need to be re-instantiated by the shell every login. - Each perennial includes a
provided.sh
file that accompanies it, which handles tasks like linking the perennial to its target directory and filename or otherwise handling the installation of the perennial.- Perennial installation scripts are all written in
bash
, since they are only run during theplant
script.
- Perennial installation scripts are all written in
- To plant perennials, run the
plant
script, which will determine which perennials have already been planted and which still need to be planted. - Example:
.vimrc
is a configuration file thatvim
reads from the user's$HOME
directory. As a perennial, the file in the user's$HOME
is actually a symbolic link to the actual.vimrc
(the roots) in the.fig/perennials/vim
directory.
- The roots of perennial plants that survive in the earth throughout winter are akin to the configuration files that live in the
- Annuals — Configurations that live only within an actively logged in shell (must be an
interactive
shell instance) and thus need to have shell startup scripts that set them for each session.- The seeds that annuals rely on dropping before winter to bloom in spring are similar to the shell commands run at the startup to guarantee the current session but do not make any assumptions about future sessions.
- Example: the
ll
alias is set in a.bashrc
file that needs to run every time a newbash
shell starts, otherwise the alias will not exist for that shell. - Any pluggable feature that can be added to a shell configuration should live in an amendments directory that the
garden.*rc
file looks inside. Once in that directory, thegarden.*rc
can load those amendments, thus enriching the garden and benefiting the seeds in it.
The plant
script can also read from a .noseed
configuration file (ignore
-style) that is a simple text file containing all of the seeds that should not be planted.
The bed.sh
file for perennials does not need to be ignored with the .noseed
file because they are not treated as seeds.
Supported file matching is that of bash
glob pattern matching, for example:
ohmyzsh
dir/ripgrep
#vimrc <-- commented out, so it still gets planted
Every seed in the perennials
and annuals
will be planted unless it's in the .noseed
file (and not commented out).