From f3b49f7a0df843f5a98b0b68b3531014e425eb6d Mon Sep 17 00:00:00 2001 From: Sidney Liebrand Date: Sun, 3 Sep 2017 23:44:06 +0200 Subject: [PATCH] updated ASDF examples --- Examples.md | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Examples.md b/Examples.md index 5fa8c9e..051932f 100644 --- a/Examples.md +++ b/Examples.md @@ -529,19 +529,21 @@ To search for windows and show which is currently active, add [ftwind](https://g ```sh # Install one or more versions of specified language # e.g. `vmi rust` # => fzf multimode, tab to mark, enter to install +# if no plugin is supplied (e.g. `vmi`), fzf will list them for you # Mnemonic [V]ersion [M]anager [I]nstall vmi() { local lang=${1} + if [[ ! $lang ]]; then + lang=$(asdf plugin-list | fzf) + fi + if [[ $lang ]]; then local versions=$(asdf list-all $lang | fzf -m) if [[ $versions ]]; then for version in $(echo $versions); do; asdf install $lang $version; done; fi - else - echo 'Please supply installed asdf plugin' - return 1 fi } ``` @@ -549,19 +551,21 @@ vmi() { ```sh # Remove one or more versions of specified language # e.g. `vmi rust` # => fzf multimode, tab to mark, enter to remove +# if no plugin is supplied (e.g. `vmi`), fzf will list them for you # Mnemonic [V]ersion [M]anager [C]lean vmc() { local lang=${1} + if [[ ! $lang ]]; then + lang=$(asdf plugin-list | fzf) + fi + if [[ $lang ]]; then local versions=$(asdf list $lang | fzf -m) if [[ $versions ]]; then for version in $(echo $versions); do; asdf uninstall $lang $version; done; fi - else - echo 'Please supply installed asdf plugin' - return 1 fi } ```