Skip to content

Commit

Permalink
feat(sync): use latest user globals
Browse files Browse the repository at this point in the history
  • Loading branch information
olets committed Mar 1, 2020
1 parent 455dc75 commit 44b8281
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions zsh-abbr.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -531,17 +531,16 @@ _zsh_abbr() {
fi

user_updated="${TMPDIR:-/tmp}/zsh-user-abbreviations"_updated

typeset -p ZSH_ABBR_USER_COMMANDS > "${TMPDIR:-/tmp}/zsh-user-abbreviations"

rm "$user_updated" 2> /dev/null
touch "$user_updated"
chmod 600 "$user_updated"

typeset -p ZSH_ABBR_USER_COMMANDS > "${TMPDIR:-/tmp}/zsh-user-abbreviations"
for abbreviation expansion in ${(kv)ZSH_ABBR_USER_COMMANDS}; do
echo "abbr ${abbreviation}=\"$expansion\"" >> "$user_updated"
done

typeset -p ZSH_ABBR_USER_GLOBALS > "${TMPDIR:-/tmp}/zsh-user-global-abbreviations"
for abbreviation expansion in ${(kv)ZSH_ABBR_USER_GLOBALS}; do
echo "abbr -g ${abbreviation}=\"$expansion\"" >> "$user_updated"
done
Expand Down

0 comments on commit 44b8281

Please sign in to comment.