aboutsummaryrefslogtreecommitdiff
path: root/.config/fish/functions/_nvm_list.fish
diff options
context:
space:
mode:
Diffstat (limited to '.config/fish/functions/_nvm_list.fish')
-rw-r--r--.config/fish/functions/_nvm_list.fish11
1 files changed, 11 insertions, 0 deletions
diff --git a/.config/fish/functions/_nvm_list.fish b/.config/fish/functions/_nvm_list.fish
new file mode 100644
index 0000000..fb5ab0e
--- /dev/null
+++ b/.config/fish/functions/_nvm_list.fish
@@ -0,0 +1,11 @@
+function _nvm_list
+ set --local versions $nvm_data/*
+ set --query versions[1] &&
+ string match --entire --regex -- (string match --regex -- "v\d.+" $versions |
+ string escape --style=regex |
+ string join "|"
+ ) <$nvm_data/.index
+
+ command --all node |
+ string match --quiet --invert --regex -- "^$nvm_data" && echo system
+end