Skip to content

Commit

Permalink
Don't interpolate environment variables in aliases
Browse files Browse the repository at this point in the history
A few aliases contain references to environment variables, but were
defined using double quotes. This caused zsh to interpolate the value of
those variables when the alias was defined instead of when it was
executed. In particular, any change to `PATH` (or `EDITOR` or `VISUAL`)
in `.zshrc.local`, which is sourced after `.aliases`, would not be
reflected in these aliases.

This commit defines these aliases using single quotes so that the
environment variables are evaluated when the alias is executed.
  • Loading branch information
reshleman committed Feb 3, 2015
1 parent b0fe7c0 commit 192729a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions aliases
Expand Up @@ -10,8 +10,8 @@ alias -g G='| grep'
alias -g M='| less'
alias -g L='| wc -l'
alias -g ONE="| awk '{ print \$1}'"
alias e="$EDITOR"
alias v="$VISUAL"
alias e='$EDITOR'
alias v='$VISUAL'

# git
alias gci="git pull --rebase && rake && git push"
Expand All @@ -29,7 +29,7 @@ alias rk="rake"
alias s="rspec"

# Pretty print the path
alias path="echo $PATH | tr -s ':' '\n'"
alias path='echo $PATH | tr -s ":" "\n"'

# Include custom aliases
[[ -f ~/.aliases.local ]] && source ~/.aliases.local

0 comments on commit 192729a

Please sign in to comment.