summaryrefslogtreecommitdiff
path: root/plugins/fnm/fnm.plugin.zsh
diff options
context:
space:
mode:
authorŽiga Šebenik <sebenik@users.noreply.github.com>2021-07-23 12:39:51 +0200
committerGitHub <noreply@github.com>2021-07-23 12:39:51 +0200
commitd9ad99531f74df8b0d6622feeab5e253528b43d0 (patch)
treecfcf3612f49fb670711c5a3c7fc37049f55bb001 /plugins/fnm/fnm.plugin.zsh
parentdac3314c76e799cddbbe5cf63870d31861626059 (diff)
downloadzsh-d9ad99531f74df8b0d6622feeab5e253528b43d0.tar.gz
zsh-d9ad99531f74df8b0d6622feeab5e253528b43d0.tar.bz2
zsh-d9ad99531f74df8b0d6622feeab5e253528b43d0.zip
feat(plugins): add fnm plugin (#9864)
Co-authored-by: Ziga Sebenik <ziga.sebenik@oryxgaming.com>
Diffstat (limited to 'plugins/fnm/fnm.plugin.zsh')
-rw-r--r--plugins/fnm/fnm.plugin.zsh12
1 files changed, 12 insertions, 0 deletions
diff --git a/plugins/fnm/fnm.plugin.zsh b/plugins/fnm/fnm.plugin.zsh
new file mode 100644
index 000000000..5ce558dcb
--- /dev/null
+++ b/plugins/fnm/fnm.plugin.zsh
@@ -0,0 +1,12 @@
+# COMPLETION FUNCTION
+if (( $+commands[fnm] )); then
+ if [[ ! -f $ZSH_CACHE_DIR/fnm_version ]] \
+ || [[ "$(fnm --version)" != "$(< "$ZSH_CACHE_DIR/fnm_version")" ]] \
+ || [[ ! -f $ZSH/plugins/fnm/_fnm ]]; then
+ fnm completions --shell=zsh > $ZSH/plugins/fnm/_fnm
+ fnm --version > $ZSH_CACHE_DIR/fnm_version
+ fi
+ autoload -Uz _fnm
+ _comps[fnm]=_fnm
+fi
+