my xfce4 dotfiles
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
958 B

3 years ago
  1. if (( ! $+commands[fnm] )); then
  2. return
  3. fi
  4. # TODO: 2021-12-28: remove this block
  5. # Handle $0 according to the standard:
  6. # https://zdharma-continuum.github.io/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html
  7. 0="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}"
  8. 0="${${(M)0:#/*}:-$PWD/$0}"
  9. # remove old generated files
  10. command rm -f "${0:A:h}/_fnm" "$ZSH_CACHE_DIR/fnm_version"
  11. # TODO: 2021-12-28: remove this bit of code as it exists in oh-my-zsh.sh
  12. # Add completions folder in $ZSH_CACHE_DIR
  13. command mkdir -p "$ZSH_CACHE_DIR/completions"
  14. (( ${fpath[(Ie)"$ZSH_CACHE_DIR/completions"]} )) || fpath=("$ZSH_CACHE_DIR/completions" $fpath)
  15. # If the completion file doesn't exist yet, we need to autoload it and
  16. # bind it to `fnm`. Otherwise, compinit will have already done that.
  17. if [[ ! -f "$ZSH_CACHE_DIR/completions/_fnm" ]]; then
  18. typeset -g -A _comps
  19. autoload -Uz _fnm
  20. _comps[fnm]=_fnm
  21. fi
  22. fnm completions --shell=zsh >| "$ZSH_CACHE_DIR/completions/_fnm" &|