Skip to content

Commit

Permalink
squash! Further changes to enable zsh configuration splitting
Browse files Browse the repository at this point in the history
* Add back missing EDITOR and VISUAL variables: these aliases were lost
  when reconciling changes from #426's changes to `zshrc`.

* 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`
  • Loading branch information
geoffharcourt committed Oct 31, 2015
1 parent 8ad7c90 commit bf20ba4
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 6 deletions.
2 changes: 2 additions & 0 deletions zsh/completion/_g
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#compdef g
compdef g=git
2 changes: 2 additions & 0 deletions zsh/configs/editor.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export VISUAL=vim
export EDITOR=$VISUAL
File renamed without changes.
10 changes: 10 additions & 0 deletions zsh/configs/post/path.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# ensure dotfiles bin directory is loaded first
export PATH="$HOME/.bin:/usr/local/sbin:$PATH"

# load rbenv if available
if command -v rbenv >/dev/null; then
eval "$(rbenv init - --no-rehash)"
fi

# mkdir .git/safe in the root of repositories you trust
export PATH=".git/safe/../../bin:$PATH"
3 changes: 0 additions & 3 deletions zsh/functions/g
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,3 @@ g() {
git status
fi
}

# Complete g like git
compdef g=git
6 changes: 3 additions & 3 deletions zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ for function in ~/.zsh/functions/*; do
source $function
done

# aliases
[[ -f ~/.aliases ]] && source ~/.aliases

# extra files in ~/.zsh/configs/pre , ~/.zsh/configs , and ~/.zsh/configs/post
# these are loaded first, second, and third, respectively.
_load_settings() {
Expand Down Expand Up @@ -42,5 +39,8 @@ _load_settings() {
}
_load_settings "$HOME/.zsh/configs"

# aliases
[[ -f ~/.aliases ]] && source ~/.aliases

# Local config
[[ -f ~/.zshrc.local ]] && source ~/.zshrc.local

0 comments on commit bf20ba4

Please sign in to comment.