Skip to content

Commit

Permalink
Use hash -d to allow completion of ~DIR
Browse files Browse the repository at this point in the history
  • Loading branch information
psprint committed Sep 29, 2022
1 parent 5be3b2a commit f74b030
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions zinit.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -144,18 +144,13 @@ ZINIT_2MAP=(
PZTM:: https://raw.githubusercontent.com/sorin-ionescu/prezto/master/modules/
)

# Global aliases for quick access to zinit dirs, use simply as e.g.: cd ZIDIR
alias -g ZIBIN=${ZINIT[BIN_DIR]} \
ZIDIR=${ZINIT[HOME_DIR]} ZIPLUGS=${ZINIT[PLUGINS_DIR]} \
ZISNIPS=${ZINIT[SNIPPETS_DIR]} ZICOMPS=${ZINIT[COMPLETIONS_DIR]} \
ZISERV=${ZINIT[SERVICES_DIR]} ZICACHE=$ZSH_CACHE_DIR \
ZPFX=$ZPFX

# ... and few global variables, Can be used as e.g.: ~DIR or $DIR, etc.
typeset -g ZIBIN=${ZINIT[BIN_DIR]} \
# Add a few named directories. Can be used as e.g.: ~DIR,
# and are completed.
hash -d ZIBIN=${ZINIT[BIN_DIR]} \
ZIDIR=${ZINIT[HOME_DIR]} ZIPLUGS=${ZINIT[PLUGINS_DIR]} \
ZISNIPS=${ZINIT[SNIPPETS_DIR]} ZICOMPS=${ZINIT[COMPLETIONS_DIR]} \
ZISERV=${ZINIT[SERVICES_DIR]} ZICACHE=$ZSH_CACHE_DIR
ZISERV=${ZINIT[SERVICES_DIR]} ZICACHE=$ZSH_CACHE_DIR \
ZPFX=$ZPFX

# ]]]

Expand Down

0 comments on commit f74b030

Please sign in to comment.