This allows people to incorporate the thoughtbot dotfiles into their own dotfiles in a more fine-grained manner. I left some things in zshrc that we should eventually handle more precisely: - Load `.zsh/functions/*`. This could instead be replaced with: `mv .zsh/functions/* .zsh/configs`. - Load `.aliases`. This could instead be replaced with: `mv .aliases .zsh/configs/aliases.zsh`. - Load `.zshrc.local`. This file can realistically go away entirely, with people adding their own files to `.zsh/configs`. A further refactoring, which I have done locally, is to introduce a `~/.sh/configs` directory, in which people can put POSIX-specific configuration that can be shared between GNU Bash, zsh, ksh, etc: aliases, functions, paths, prompts, and so on. But one step at a time. Other changes: * Move aliases setup to occur after loading other config, as some of our aliases depend on environment variables having been set, so alias loading must come last after we've sourced `zsh/configs`. * Move autocompletion for `g` function from the function definition to to `zsh/completions/_g` * Move `PATH` setup to `zsh/configs/post` to ensure it happens after other configuration that might alter the `PATH`
9 lines
137 B
Text
9 lines
137 B
Text
# No arguments: `git status`
|
|
# With arguments: acts like `git`
|
|
g() {
|
|
if [[ $# -gt 0 ]]; then
|
|
git "$@"
|
|
else
|
|
git status
|
|
fi
|
|
}
|