Skip to content

Commit

Permalink
Add watch/sudo as abbreviation modifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
henrebotha committed Sep 1, 2023
1 parent 7a5fd81 commit e8f11aa
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions zsh/.config/zsh/.zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -513,11 +513,21 @@ export abbr_abbreviations=(
[v]=vim
)

modifier_commands=(
sudo
watch
)

abbrs=$(abbr list-abbreviations)
for abbreviation phrase in ${(@kv)abbr_abbreviations}; do
if [[ ! "$abbrs" =~ "\"$abbreviation\"" ]]; then
abbr "$abbreviation"="$phrase"
fi
for modifier in $modifier_commands; do
if [[ ! "$abbrs" =~ "\"$modifier $abbreviation\"" ]]; then
abbr "$modifier $abbreviation"="$modifier $phrase"
fi
done
done
unset abbrs
unset abbr_abbreviations
Expand Down

0 comments on commit e8f11aa

Please sign in to comment.