diff --git a/.bashrc b/.bashrc index c99c39b..d2b6da5 100644 --- a/.bashrc +++ b/.bashrc @@ -1,5 +1,3 @@ -# Fig pre block. Keep at the top of this file. -[[ -f "$HOME/.fig/shell/bashrc.pre.bash" ]] && builtin source "$HOME/.fig/shell/bashrc.pre.bash" # # ~/.bashrc # @@ -199,6 +197,3 @@ export NVM_DIR="$HOME/.nvm" export SDKMAN_DIR="/home/plague/.sdkman" [[ -s "/home/plague/.sdkman/bin/sdkman-init.sh" ]] && source "/home/plague/.sdkman/bin/sdkman-init.sh" . "$HOME/.cargo/env" - -# Fig post block. Keep at the bottom of this file. -[[ -f "$HOME/.fig/shell/bashrc.post.bash" ]] && builtin source "$HOME/.fig/shell/bashrc.post.bash" diff --git a/.profile.d/graalvm.sh b/.profile.d/graalvm.sh index 296e88c..b993ff2 100644 --- a/.profile.d/graalvm.sh +++ b/.profile.d/graalvm.sh @@ -1 +1 @@ -export GRAALVM_HOME="${SDKMAN_DIR}/candidates/java/22.3.1.r19-grl" +export GRAALVM_HOME="${SDKMAN_CANDIDATES_DIR}/java/21.0.1-graal" diff --git a/.zshenv b/.zshenv index 8a213e5..2cd80b4 100644 --- a/.zshenv +++ b/.zshenv @@ -9,6 +9,7 @@ function appendpath() { appendpath "$GOPATH/bin" appendpath "$HOME/.local/bin" +appendpath "$GRAALVM_HOME/bin" appendpath $HOME/.local/share/gem/ruby/3.0.0/bin unset appendpath diff --git a/.zshrc b/.zshrc index 9fe60dc..0d2696e 100644 --- a/.zshrc +++ b/.zshrc @@ -1,6 +1,3 @@ -# Fig pre block. Keep at the top of this file. -[[ -f "$HOME/.fig/shell/zshrc.pre.zsh" ]] && builtin source "$HOME/.fig/shell/zshrc.pre.zsh" - # If you come from bash you might have to change your $PATH. # export PATH=$HOME/bin:/usr/local/bin:$PATH @@ -109,7 +106,6 @@ plugins=( web-search zsh-completions zsh-navigation-tools - #zsh_reload ) source $ZSH/oh-my-zsh.sh @@ -131,6 +127,8 @@ source $ZSH/oh-my-zsh.sh # Compilation flags # export ARCHFLAGS="-arch x86_64" +[[ ! -f ~/.zshenv ]] || source ~/.zshenv + # Set personal aliases, overriding those provided by oh-my-zsh libs, # plugins, and themes. Aliases can be placed here, though oh-my-zsh # users are encouraged to define aliases within the ZSH_CUSTOM folder. @@ -143,15 +141,19 @@ source $ZSH/oh-my-zsh.sh # Setup emacs keymap bindkey -e +fpath=(~/.zsh $fpath) + unalias run-help autoload run-help -autoload -U compinit && compinit +autoload -Uz compinit && compinit -u source "$ZSH_HIGHLIGHT_DIR/zsh-syntax-highlighting.zsh" # To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh +source <(kind completion zsh) + # pyenv configuration eval "$(pyenv init -)" eval "$(pyenv virtualenv-init -)" @@ -162,6 +164,3 @@ test -e "${HOME}/.iterm2_shell_integration.zsh" && source "${HOME}/.iterm2_shell export NVM_DIR="$HOME/.nvm" [ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && \. "/opt/homebrew/opt/nvm/nvm.sh" # This loads nvm [ -s "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" ] && \. "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion - -# Fig post block. Keep at the bottom of this file. -[[ -f "$HOME/.fig/shell/zshrc.post.zsh" ]] && builtin source "$HOME/.fig/shell/zshrc.post.zsh" diff --git a/fish/completions/fisher.fish b/fish/completions/fisher.fish new file mode 100644 index 0000000..6d23ce4 --- /dev/null +++ b/fish/completions/fisher.fish @@ -0,0 +1,7 @@ +complete --command fisher --exclusive --long help --description "Print help" +complete --command fisher --exclusive --long version --description "Print version" +complete --command fisher --exclusive --condition __fish_use_subcommand --arguments install --description "Install plugins" +complete --command fisher --exclusive --condition __fish_use_subcommand --arguments update --description "Update installed plugins" +complete --command fisher --exclusive --condition __fish_use_subcommand --arguments remove --description "Remove installed plugins" +complete --command fisher --exclusive --condition __fish_use_subcommand --arguments list --description "List installed plugins matching regex" +complete --command fisher --exclusive --condition "__fish_seen_subcommand_from update remove" --arguments "(fisher list)" diff --git a/fish/completions/fnm.fish b/fish/completions/fnm.fish new file mode 100644 index 0000000..7005e7e --- /dev/null +++ b/fish/completions/fnm.fish @@ -0,0 +1,169 @@ +complete -c fnm -n "__fish_use_subcommand" -l node-dist-mirror -d 'https://nodejs.org/dist/ mirror' -r +complete -c fnm -n "__fish_use_subcommand" -l fnm-dir -d 'The root directory of fnm installations' -r -F +complete -c fnm -n "__fish_use_subcommand" -l multishell-path -d 'Where the current node version link is stored. This value will be populated automatically by evaluating `fnm env` in your shell profile. Read more about it using `fnm help env`' -r -F +complete -c fnm -n "__fish_use_subcommand" -l log-level -d 'The log level of fnm commands' -r -f -a "{quiet ,error ,info }" +complete -c fnm -n "__fish_use_subcommand" -l arch -d 'Override the architecture of the installed Node binary. Defaults to arch of fnm binary' -r +complete -c fnm -n "__fish_use_subcommand" -l version-file-strategy -d 'A strategy for how to resolve the Node version. Used whenever `fnm use` or `fnm install` is called without a version, or when `--use-on-cd` is configured on evaluation' -r -f -a "{local Use the local version of Node defined within the current directory,recursive Use the version of Node defined within the current directory and all parent directories}" +complete -c fnm -n "__fish_use_subcommand" -l corepack-enabled -d 'Enable corepack support for each new installation. This will make fnm call `corepack enable` on every Node.js installation. For more information about corepack see https://nodejs.org/api/corepack.html' +complete -c fnm -n "__fish_use_subcommand" -l resolve-engines -d 'Resolve `engines.node` field in `package.json` whenever a `.node-version` or `.nvmrc` file is not present. +Experimental: This feature is subject to change. +Note: `engines.node` can be any semver range, with the latest satisfying version being resolved.' +complete -c fnm -n "__fish_use_subcommand" -s h -l help -d 'Print help (see more with \'--help\')' +complete -c fnm -n "__fish_use_subcommand" -s V -l version -d 'Print version' +complete -c fnm -n "__fish_use_subcommand" -f -a "list-remote" -d 'List all remote Node.js versions' +complete -c fnm -n "__fish_use_subcommand" -f -a "list" -d 'List all locally installed Node.js versions' +complete -c fnm -n "__fish_use_subcommand" -f -a "install" -d 'Install a new Node.js version' +complete -c fnm -n "__fish_use_subcommand" -f -a "use" -d 'Change Node.js version' +complete -c fnm -n "__fish_use_subcommand" -f -a "env" -d 'Print and set up required environment variables for fnm' +complete -c fnm -n "__fish_use_subcommand" -f -a "completions" -d 'Print shell completions to stdout' +complete -c fnm -n "__fish_use_subcommand" -f -a "alias" -d 'Alias a version to a common name' +complete -c fnm -n "__fish_use_subcommand" -f -a "unalias" -d 'Remove an alias definition' +complete -c fnm -n "__fish_use_subcommand" -f -a "default" -d 'Set a version as the default version' +complete -c fnm -n "__fish_use_subcommand" -f -a "current" -d 'Print the current Node.js version' +complete -c fnm -n "__fish_use_subcommand" -f -a "exec" -d 'Run a command within fnm context' +complete -c fnm -n "__fish_use_subcommand" -f -a "uninstall" -d 'Uninstall a Node.js version' +complete -c fnm -n "__fish_use_subcommand" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' +complete -c fnm -n "__fish_seen_subcommand_from list-remote" -l node-dist-mirror -d 'https://nodejs.org/dist/ mirror' -r +complete -c fnm -n "__fish_seen_subcommand_from list-remote" -l fnm-dir -d 'The root directory of fnm installations' -r -F +complete -c fnm -n "__fish_seen_subcommand_from list-remote" -l log-level -d 'The log level of fnm commands' -r -f -a "{quiet ,error ,info }" +complete -c fnm -n "__fish_seen_subcommand_from list-remote" -l arch -d 'Override the architecture of the installed Node binary. Defaults to arch of fnm binary' -r +complete -c fnm -n "__fish_seen_subcommand_from list-remote" -l version-file-strategy -d 'A strategy for how to resolve the Node version. Used whenever `fnm use` or `fnm install` is called without a version, or when `--use-on-cd` is configured on evaluation' -r -f -a "{local Use the local version of Node defined within the current directory,recursive Use the version of Node defined within the current directory and all parent directories}" +complete -c fnm -n "__fish_seen_subcommand_from list-remote" -l corepack-enabled -d 'Enable corepack support for each new installation. This will make fnm call `corepack enable` on every Node.js installation. For more information about corepack see https://nodejs.org/api/corepack.html' +complete -c fnm -n "__fish_seen_subcommand_from list-remote" -l resolve-engines -d 'Resolve `engines.node` field in `package.json` whenever a `.node-version` or `.nvmrc` file is not present. +Experimental: This feature is subject to change. +Note: `engines.node` can be any semver range, with the latest satisfying version being resolved.' +complete -c fnm -n "__fish_seen_subcommand_from list-remote" -s h -l help -d 'Print help (see more with \'--help\')' +complete -c fnm -n "__fish_seen_subcommand_from list" -l node-dist-mirror -d 'https://nodejs.org/dist/ mirror' -r +complete -c fnm -n "__fish_seen_subcommand_from list" -l fnm-dir -d 'The root directory of fnm installations' -r -F +complete -c fnm -n "__fish_seen_subcommand_from list" -l log-level -d 'The log level of fnm commands' -r -f -a "{quiet ,error ,info }" +complete -c fnm -n "__fish_seen_subcommand_from list" -l arch -d 'Override the architecture of the installed Node binary. Defaults to arch of fnm binary' -r +complete -c fnm -n "__fish_seen_subcommand_from list" -l version-file-strategy -d 'A strategy for how to resolve the Node version. Used whenever `fnm use` or `fnm install` is called without a version, or when `--use-on-cd` is configured on evaluation' -r -f -a "{local Use the local version of Node defined within the current directory,recursive Use the version of Node defined within the current directory and all parent directories}" +complete -c fnm -n "__fish_seen_subcommand_from list" -l corepack-enabled -d 'Enable corepack support for each new installation. This will make fnm call `corepack enable` on every Node.js installation. For more information about corepack see https://nodejs.org/api/corepack.html' +complete -c fnm -n "__fish_seen_subcommand_from list" -l resolve-engines -d 'Resolve `engines.node` field in `package.json` whenever a `.node-version` or `.nvmrc` file is not present. +Experimental: This feature is subject to change. +Note: `engines.node` can be any semver range, with the latest satisfying version being resolved.' +complete -c fnm -n "__fish_seen_subcommand_from list" -s h -l help -d 'Print help (see more with \'--help\')' +complete -c fnm -n "__fish_seen_subcommand_from install" -l node-dist-mirror -d 'https://nodejs.org/dist/ mirror' -r +complete -c fnm -n "__fish_seen_subcommand_from install" -l fnm-dir -d 'The root directory of fnm installations' -r -F +complete -c fnm -n "__fish_seen_subcommand_from install" -l log-level -d 'The log level of fnm commands' -r -f -a "{quiet ,error ,info }" +complete -c fnm -n "__fish_seen_subcommand_from install" -l arch -d 'Override the architecture of the installed Node binary. Defaults to arch of fnm binary' -r +complete -c fnm -n "__fish_seen_subcommand_from install" -l version-file-strategy -d 'A strategy for how to resolve the Node version. Used whenever `fnm use` or `fnm install` is called without a version, or when `--use-on-cd` is configured on evaluation' -r -f -a "{local Use the local version of Node defined within the current directory,recursive Use the version of Node defined within the current directory and all parent directories}" +complete -c fnm -n "__fish_seen_subcommand_from install" -l lts -d 'Install latest LTS' +complete -c fnm -n "__fish_seen_subcommand_from install" -l latest -d 'Install latest version' +complete -c fnm -n "__fish_seen_subcommand_from install" -l corepack-enabled -d 'Enable corepack support for each new installation. This will make fnm call `corepack enable` on every Node.js installation. For more information about corepack see https://nodejs.org/api/corepack.html' +complete -c fnm -n "__fish_seen_subcommand_from install" -l resolve-engines -d 'Resolve `engines.node` field in `package.json` whenever a `.node-version` or `.nvmrc` file is not present. +Experimental: This feature is subject to change. +Note: `engines.node` can be any semver range, with the latest satisfying version being resolved.' +complete -c fnm -n "__fish_seen_subcommand_from install" -s h -l help -d 'Print help (see more with \'--help\')' +complete -c fnm -n "__fish_seen_subcommand_from use" -l node-dist-mirror -d 'https://nodejs.org/dist/ mirror' -r +complete -c fnm -n "__fish_seen_subcommand_from use" -l fnm-dir -d 'The root directory of fnm installations' -r -F +complete -c fnm -n "__fish_seen_subcommand_from use" -l log-level -d 'The log level of fnm commands' -r -f -a "{quiet ,error ,info }" +complete -c fnm -n "__fish_seen_subcommand_from use" -l arch -d 'Override the architecture of the installed Node binary. Defaults to arch of fnm binary' -r +complete -c fnm -n "__fish_seen_subcommand_from use" -l version-file-strategy -d 'A strategy for how to resolve the Node version. Used whenever `fnm use` or `fnm install` is called without a version, or when `--use-on-cd` is configured on evaluation' -r -f -a "{local Use the local version of Node defined within the current directory,recursive Use the version of Node defined within the current directory and all parent directories}" +complete -c fnm -n "__fish_seen_subcommand_from use" -l install-if-missing -d 'Install the version if it isn\'t installed yet' +complete -c fnm -n "__fish_seen_subcommand_from use" -l silent-if-unchanged -d 'Don\'t output a message identifying the version being used if it will not change due to execution of this command' +complete -c fnm -n "__fish_seen_subcommand_from use" -l corepack-enabled -d 'Enable corepack support for each new installation. This will make fnm call `corepack enable` on every Node.js installation. For more information about corepack see https://nodejs.org/api/corepack.html' +complete -c fnm -n "__fish_seen_subcommand_from use" -l resolve-engines -d 'Resolve `engines.node` field in `package.json` whenever a `.node-version` or `.nvmrc` file is not present. +Experimental: This feature is subject to change. +Note: `engines.node` can be any semver range, with the latest satisfying version being resolved.' +complete -c fnm -n "__fish_seen_subcommand_from use" -s h -l help -d 'Print help (see more with \'--help\')' +complete -c fnm -n "__fish_seen_subcommand_from env" -l shell -d 'The shell syntax to use. Infers when missing' -r -f -a "{bash ,zsh ,fish ,power-shell }" +complete -c fnm -n "__fish_seen_subcommand_from env" -l node-dist-mirror -d 'https://nodejs.org/dist/ mirror' -r +complete -c fnm -n "__fish_seen_subcommand_from env" -l fnm-dir -d 'The root directory of fnm installations' -r -F +complete -c fnm -n "__fish_seen_subcommand_from env" -l log-level -d 'The log level of fnm commands' -r -f -a "{quiet ,error ,info }" +complete -c fnm -n "__fish_seen_subcommand_from env" -l arch -d 'Override the architecture of the installed Node binary. Defaults to arch of fnm binary' -r +complete -c fnm -n "__fish_seen_subcommand_from env" -l version-file-strategy -d 'A strategy for how to resolve the Node version. Used whenever `fnm use` or `fnm install` is called without a version, or when `--use-on-cd` is configured on evaluation' -r -f -a "{local Use the local version of Node defined within the current directory,recursive Use the version of Node defined within the current directory and all parent directories}" +complete -c fnm -n "__fish_seen_subcommand_from env" -l json -d 'Print JSON instead of shell commands' +complete -c fnm -n "__fish_seen_subcommand_from env" -l multi -d 'Deprecated. This is the default now' +complete -c fnm -n "__fish_seen_subcommand_from env" -l use-on-cd -d 'Print the script to change Node versions every directory change' +complete -c fnm -n "__fish_seen_subcommand_from env" -l corepack-enabled -d 'Enable corepack support for each new installation. This will make fnm call `corepack enable` on every Node.js installation. For more information about corepack see https://nodejs.org/api/corepack.html' +complete -c fnm -n "__fish_seen_subcommand_from env" -l resolve-engines -d 'Resolve `engines.node` field in `package.json` whenever a `.node-version` or `.nvmrc` file is not present. +Experimental: This feature is subject to change. +Note: `engines.node` can be any semver range, with the latest satisfying version being resolved.' +complete -c fnm -n "__fish_seen_subcommand_from env" -s h -l help -d 'Print help (see more with \'--help\')' +complete -c fnm -n "__fish_seen_subcommand_from completions" -l shell -d 'The shell syntax to use. Infers when missing' -r -f -a "{bash ,zsh ,fish ,power-shell }" +complete -c fnm -n "__fish_seen_subcommand_from completions" -l node-dist-mirror -d 'https://nodejs.org/dist/ mirror' -r +complete -c fnm -n "__fish_seen_subcommand_from completions" -l fnm-dir -d 'The root directory of fnm installations' -r -F +complete -c fnm -n "__fish_seen_subcommand_from completions" -l log-level -d 'The log level of fnm commands' -r -f -a "{quiet ,error ,info }" +complete -c fnm -n "__fish_seen_subcommand_from completions" -l arch -d 'Override the architecture of the installed Node binary. Defaults to arch of fnm binary' -r +complete -c fnm -n "__fish_seen_subcommand_from completions" -l version-file-strategy -d 'A strategy for how to resolve the Node version. Used whenever `fnm use` or `fnm install` is called without a version, or when `--use-on-cd` is configured on evaluation' -r -f -a "{local Use the local version of Node defined within the current directory,recursive Use the version of Node defined within the current directory and all parent directories}" +complete -c fnm -n "__fish_seen_subcommand_from completions" -l corepack-enabled -d 'Enable corepack support for each new installation. This will make fnm call `corepack enable` on every Node.js installation. For more information about corepack see https://nodejs.org/api/corepack.html' +complete -c fnm -n "__fish_seen_subcommand_from completions" -l resolve-engines -d 'Resolve `engines.node` field in `package.json` whenever a `.node-version` or `.nvmrc` file is not present. +Experimental: This feature is subject to change. +Note: `engines.node` can be any semver range, with the latest satisfying version being resolved.' +complete -c fnm -n "__fish_seen_subcommand_from completions" -s h -l help -d 'Print help (see more with \'--help\')' +complete -c fnm -n "__fish_seen_subcommand_from alias" -l node-dist-mirror -d 'https://nodejs.org/dist/ mirror' -r +complete -c fnm -n "__fish_seen_subcommand_from alias" -l fnm-dir -d 'The root directory of fnm installations' -r -F +complete -c fnm -n "__fish_seen_subcommand_from alias" -l log-level -d 'The log level of fnm commands' -r -f -a "{quiet ,error ,info }" +complete -c fnm -n "__fish_seen_subcommand_from alias" -l arch -d 'Override the architecture of the installed Node binary. Defaults to arch of fnm binary' -r +complete -c fnm -n "__fish_seen_subcommand_from alias" -l version-file-strategy -d 'A strategy for how to resolve the Node version. Used whenever `fnm use` or `fnm install` is called without a version, or when `--use-on-cd` is configured on evaluation' -r -f -a "{local Use the local version of Node defined within the current directory,recursive Use the version of Node defined within the current directory and all parent directories}" +complete -c fnm -n "__fish_seen_subcommand_from alias" -l corepack-enabled -d 'Enable corepack support for each new installation. This will make fnm call `corepack enable` on every Node.js installation. For more information about corepack see https://nodejs.org/api/corepack.html' +complete -c fnm -n "__fish_seen_subcommand_from alias" -l resolve-engines -d 'Resolve `engines.node` field in `package.json` whenever a `.node-version` or `.nvmrc` file is not present. +Experimental: This feature is subject to change. +Note: `engines.node` can be any semver range, with the latest satisfying version being resolved.' +complete -c fnm -n "__fish_seen_subcommand_from alias" -s h -l help -d 'Print help (see more with \'--help\')' +complete -c fnm -n "__fish_seen_subcommand_from unalias" -l node-dist-mirror -d 'https://nodejs.org/dist/ mirror' -r +complete -c fnm -n "__fish_seen_subcommand_from unalias" -l fnm-dir -d 'The root directory of fnm installations' -r -F +complete -c fnm -n "__fish_seen_subcommand_from unalias" -l log-level -d 'The log level of fnm commands' -r -f -a "{quiet ,error ,info }" +complete -c fnm -n "__fish_seen_subcommand_from unalias" -l arch -d 'Override the architecture of the installed Node binary. Defaults to arch of fnm binary' -r +complete -c fnm -n "__fish_seen_subcommand_from unalias" -l version-file-strategy -d 'A strategy for how to resolve the Node version. Used whenever `fnm use` or `fnm install` is called without a version, or when `--use-on-cd` is configured on evaluation' -r -f -a "{local Use the local version of Node defined within the current directory,recursive Use the version of Node defined within the current directory and all parent directories}" +complete -c fnm -n "__fish_seen_subcommand_from unalias" -l corepack-enabled -d 'Enable corepack support for each new installation. This will make fnm call `corepack enable` on every Node.js installation. For more information about corepack see https://nodejs.org/api/corepack.html' +complete -c fnm -n "__fish_seen_subcommand_from unalias" -l resolve-engines -d 'Resolve `engines.node` field in `package.json` whenever a `.node-version` or `.nvmrc` file is not present. +Experimental: This feature is subject to change. +Note: `engines.node` can be any semver range, with the latest satisfying version being resolved.' +complete -c fnm -n "__fish_seen_subcommand_from unalias" -s h -l help -d 'Print help (see more with \'--help\')' +complete -c fnm -n "__fish_seen_subcommand_from default" -l node-dist-mirror -d 'https://nodejs.org/dist/ mirror' -r +complete -c fnm -n "__fish_seen_subcommand_from default" -l fnm-dir -d 'The root directory of fnm installations' -r -F +complete -c fnm -n "__fish_seen_subcommand_from default" -l log-level -d 'The log level of fnm commands' -r -f -a "{quiet ,error ,info }" +complete -c fnm -n "__fish_seen_subcommand_from default" -l arch -d 'Override the architecture of the installed Node binary. Defaults to arch of fnm binary' -r +complete -c fnm -n "__fish_seen_subcommand_from default" -l version-file-strategy -d 'A strategy for how to resolve the Node version. Used whenever `fnm use` or `fnm install` is called without a version, or when `--use-on-cd` is configured on evaluation' -r -f -a "{local Use the local version of Node defined within the current directory,recursive Use the version of Node defined within the current directory and all parent directories}" +complete -c fnm -n "__fish_seen_subcommand_from default" -l corepack-enabled -d 'Enable corepack support for each new installation. This will make fnm call `corepack enable` on every Node.js installation. For more information about corepack see https://nodejs.org/api/corepack.html' +complete -c fnm -n "__fish_seen_subcommand_from default" -l resolve-engines -d 'Resolve `engines.node` field in `package.json` whenever a `.node-version` or `.nvmrc` file is not present. +Experimental: This feature is subject to change. +Note: `engines.node` can be any semver range, with the latest satisfying version being resolved.' +complete -c fnm -n "__fish_seen_subcommand_from default" -s h -l help -d 'Print help (see more with \'--help\')' +complete -c fnm -n "__fish_seen_subcommand_from current" -l node-dist-mirror -d 'https://nodejs.org/dist/ mirror' -r +complete -c fnm -n "__fish_seen_subcommand_from current" -l fnm-dir -d 'The root directory of fnm installations' -r -F +complete -c fnm -n "__fish_seen_subcommand_from current" -l log-level -d 'The log level of fnm commands' -r -f -a "{quiet ,error ,info }" +complete -c fnm -n "__fish_seen_subcommand_from current" -l arch -d 'Override the architecture of the installed Node binary. Defaults to arch of fnm binary' -r +complete -c fnm -n "__fish_seen_subcommand_from current" -l version-file-strategy -d 'A strategy for how to resolve the Node version. Used whenever `fnm use` or `fnm install` is called without a version, or when `--use-on-cd` is configured on evaluation' -r -f -a "{local Use the local version of Node defined within the current directory,recursive Use the version of Node defined within the current directory and all parent directories}" +complete -c fnm -n "__fish_seen_subcommand_from current" -l corepack-enabled -d 'Enable corepack support for each new installation. This will make fnm call `corepack enable` on every Node.js installation. For more information about corepack see https://nodejs.org/api/corepack.html' +complete -c fnm -n "__fish_seen_subcommand_from current" -l resolve-engines -d 'Resolve `engines.node` field in `package.json` whenever a `.node-version` or `.nvmrc` file is not present. +Experimental: This feature is subject to change. +Note: `engines.node` can be any semver range, with the latest satisfying version being resolved.' +complete -c fnm -n "__fish_seen_subcommand_from current" -s h -l help -d 'Print help (see more with \'--help\')' +complete -c fnm -n "__fish_seen_subcommand_from exec" -l using -d 'Either an explicit version, or a filename with the version written in it' -r +complete -c fnm -n "__fish_seen_subcommand_from exec" -l node-dist-mirror -d 'https://nodejs.org/dist/ mirror' -r +complete -c fnm -n "__fish_seen_subcommand_from exec" -l fnm-dir -d 'The root directory of fnm installations' -r -F +complete -c fnm -n "__fish_seen_subcommand_from exec" -l log-level -d 'The log level of fnm commands' -r -f -a "{quiet ,error ,info }" +complete -c fnm -n "__fish_seen_subcommand_from exec" -l arch -d 'Override the architecture of the installed Node binary. Defaults to arch of fnm binary' -r +complete -c fnm -n "__fish_seen_subcommand_from exec" -l version-file-strategy -d 'A strategy for how to resolve the Node version. Used whenever `fnm use` or `fnm install` is called without a version, or when `--use-on-cd` is configured on evaluation' -r -f -a "{local Use the local version of Node defined within the current directory,recursive Use the version of Node defined within the current directory and all parent directories}" +complete -c fnm -n "__fish_seen_subcommand_from exec" -l using-file -d 'Deprecated. This is the default now' +complete -c fnm -n "__fish_seen_subcommand_from exec" -l corepack-enabled -d 'Enable corepack support for each new installation. This will make fnm call `corepack enable` on every Node.js installation. For more information about corepack see https://nodejs.org/api/corepack.html' +complete -c fnm -n "__fish_seen_subcommand_from exec" -l resolve-engines -d 'Resolve `engines.node` field in `package.json` whenever a `.node-version` or `.nvmrc` file is not present. +Experimental: This feature is subject to change. +Note: `engines.node` can be any semver range, with the latest satisfying version being resolved.' +complete -c fnm -n "__fish_seen_subcommand_from exec" -s h -l help -d 'Print help (see more with \'--help\')' +complete -c fnm -n "__fish_seen_subcommand_from uninstall" -l node-dist-mirror -d 'https://nodejs.org/dist/ mirror' -r +complete -c fnm -n "__fish_seen_subcommand_from uninstall" -l fnm-dir -d 'The root directory of fnm installations' -r -F +complete -c fnm -n "__fish_seen_subcommand_from uninstall" -l log-level -d 'The log level of fnm commands' -r -f -a "{quiet ,error ,info }" +complete -c fnm -n "__fish_seen_subcommand_from uninstall" -l arch -d 'Override the architecture of the installed Node binary. Defaults to arch of fnm binary' -r +complete -c fnm -n "__fish_seen_subcommand_from uninstall" -l version-file-strategy -d 'A strategy for how to resolve the Node version. Used whenever `fnm use` or `fnm install` is called without a version, or when `--use-on-cd` is configured on evaluation' -r -f -a "{local Use the local version of Node defined within the current directory,recursive Use the version of Node defined within the current directory and all parent directories}" +complete -c fnm -n "__fish_seen_subcommand_from uninstall" -l corepack-enabled -d 'Enable corepack support for each new installation. This will make fnm call `corepack enable` on every Node.js installation. For more information about corepack see https://nodejs.org/api/corepack.html' +complete -c fnm -n "__fish_seen_subcommand_from uninstall" -l resolve-engines -d 'Resolve `engines.node` field in `package.json` whenever a `.node-version` or `.nvmrc` file is not present. +Experimental: This feature is subject to change. +Note: `engines.node` can be any semver range, with the latest satisfying version being resolved.' +complete -c fnm -n "__fish_seen_subcommand_from uninstall" -s h -l help -d 'Print help (see more with \'--help\')' +complete -c fnm -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from list-remote; and not __fish_seen_subcommand_from list; and not __fish_seen_subcommand_from install; and not __fish_seen_subcommand_from use; and not __fish_seen_subcommand_from env; and not __fish_seen_subcommand_from completions; and not __fish_seen_subcommand_from alias; and not __fish_seen_subcommand_from unalias; and not __fish_seen_subcommand_from default; and not __fish_seen_subcommand_from current; and not __fish_seen_subcommand_from exec; and not __fish_seen_subcommand_from uninstall; and not __fish_seen_subcommand_from help" -f -a "list-remote" -d 'List all remote Node.js versions' +complete -c fnm -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from list-remote; and not __fish_seen_subcommand_from list; and not __fish_seen_subcommand_from install; and not __fish_seen_subcommand_from use; and not __fish_seen_subcommand_from env; and not __fish_seen_subcommand_from completions; and not __fish_seen_subcommand_from alias; and not __fish_seen_subcommand_from unalias; and not __fish_seen_subcommand_from default; and not __fish_seen_subcommand_from current; and not __fish_seen_subcommand_from exec; and not __fish_seen_subcommand_from uninstall; and not __fish_seen_subcommand_from help" -f -a "list" -d 'List all locally installed Node.js versions' +complete -c fnm -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from list-remote; and not __fish_seen_subcommand_from list; and not __fish_seen_subcommand_from install; and not __fish_seen_subcommand_from use; and not __fish_seen_subcommand_from env; and not __fish_seen_subcommand_from completions; and not __fish_seen_subcommand_from alias; and not __fish_seen_subcommand_from unalias; and not __fish_seen_subcommand_from default; and not __fish_seen_subcommand_from current; and not __fish_seen_subcommand_from exec; and not __fish_seen_subcommand_from uninstall; and not __fish_seen_subcommand_from help" -f -a "install" -d 'Install a new Node.js version' +complete -c fnm -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from list-remote; and not __fish_seen_subcommand_from list; and not __fish_seen_subcommand_from install; and not __fish_seen_subcommand_from use; and not __fish_seen_subcommand_from env; and not __fish_seen_subcommand_from completions; and not __fish_seen_subcommand_from alias; and not __fish_seen_subcommand_from unalias; and not __fish_seen_subcommand_from default; and not __fish_seen_subcommand_from current; and not __fish_seen_subcommand_from exec; and not __fish_seen_subcommand_from uninstall; and not __fish_seen_subcommand_from help" -f -a "use" -d 'Change Node.js version' +complete -c fnm -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from list-remote; and not __fish_seen_subcommand_from list; and not __fish_seen_subcommand_from install; and not __fish_seen_subcommand_from use; and not __fish_seen_subcommand_from env; and not __fish_seen_subcommand_from completions; and not __fish_seen_subcommand_from alias; and not __fish_seen_subcommand_from unalias; and not __fish_seen_subcommand_from default; and not __fish_seen_subcommand_from current; and not __fish_seen_subcommand_from exec; and not __fish_seen_subcommand_from uninstall; and not __fish_seen_subcommand_from help" -f -a "env" -d 'Print and set up required environment variables for fnm' +complete -c fnm -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from list-remote; and not __fish_seen_subcommand_from list; and not __fish_seen_subcommand_from install; and not __fish_seen_subcommand_from use; and not __fish_seen_subcommand_from env; and not __fish_seen_subcommand_from completions; and not __fish_seen_subcommand_from alias; and not __fish_seen_subcommand_from unalias; and not __fish_seen_subcommand_from default; and not __fish_seen_subcommand_from current; and not __fish_seen_subcommand_from exec; and not __fish_seen_subcommand_from uninstall; and not __fish_seen_subcommand_from help" -f -a "completions" -d 'Print shell completions to stdout' +complete -c fnm -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from list-remote; and not __fish_seen_subcommand_from list; and not __fish_seen_subcommand_from install; and not __fish_seen_subcommand_from use; and not __fish_seen_subcommand_from env; and not __fish_seen_subcommand_from completions; and not __fish_seen_subcommand_from alias; and not __fish_seen_subcommand_from unalias; and not __fish_seen_subcommand_from default; and not __fish_seen_subcommand_from current; and not __fish_seen_subcommand_from exec; and not __fish_seen_subcommand_from uninstall; and not __fish_seen_subcommand_from help" -f -a "alias" -d 'Alias a version to a common name' +complete -c fnm -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from list-remote; and not __fish_seen_subcommand_from list; and not __fish_seen_subcommand_from install; and not __fish_seen_subcommand_from use; and not __fish_seen_subcommand_from env; and not __fish_seen_subcommand_from completions; and not __fish_seen_subcommand_from alias; and not __fish_seen_subcommand_from unalias; and not __fish_seen_subcommand_from default; and not __fish_seen_subcommand_from current; and not __fish_seen_subcommand_from exec; and not __fish_seen_subcommand_from uninstall; and not __fish_seen_subcommand_from help" -f -a "unalias" -d 'Remove an alias definition' +complete -c fnm -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from list-remote; and not __fish_seen_subcommand_from list; and not __fish_seen_subcommand_from install; and not __fish_seen_subcommand_from use; and not __fish_seen_subcommand_from env; and not __fish_seen_subcommand_from completions; and not __fish_seen_subcommand_from alias; and not __fish_seen_subcommand_from unalias; and not __fish_seen_subcommand_from default; and not __fish_seen_subcommand_from current; and not __fish_seen_subcommand_from exec; and not __fish_seen_subcommand_from uninstall; and not __fish_seen_subcommand_from help" -f -a "default" -d 'Set a version as the default version' +complete -c fnm -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from list-remote; and not __fish_seen_subcommand_from list; and not __fish_seen_subcommand_from install; and not __fish_seen_subcommand_from use; and not __fish_seen_subcommand_from env; and not __fish_seen_subcommand_from completions; and not __fish_seen_subcommand_from alias; and not __fish_seen_subcommand_from unalias; and not __fish_seen_subcommand_from default; and not __fish_seen_subcommand_from current; and not __fish_seen_subcommand_from exec; and not __fish_seen_subcommand_from uninstall; and not __fish_seen_subcommand_from help" -f -a "current" -d 'Print the current Node.js version' +complete -c fnm -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from list-remote; and not __fish_seen_subcommand_from list; and not __fish_seen_subcommand_from install; and not __fish_seen_subcommand_from use; and not __fish_seen_subcommand_from env; and not __fish_seen_subcommand_from completions; and not __fish_seen_subcommand_from alias; and not __fish_seen_subcommand_from unalias; and not __fish_seen_subcommand_from default; and not __fish_seen_subcommand_from current; and not __fish_seen_subcommand_from exec; and not __fish_seen_subcommand_from uninstall; and not __fish_seen_subcommand_from help" -f -a "exec" -d 'Run a command within fnm context' +complete -c fnm -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from list-remote; and not __fish_seen_subcommand_from list; and not __fish_seen_subcommand_from install; and not __fish_seen_subcommand_from use; and not __fish_seen_subcommand_from env; and not __fish_seen_subcommand_from completions; and not __fish_seen_subcommand_from alias; and not __fish_seen_subcommand_from unalias; and not __fish_seen_subcommand_from default; and not __fish_seen_subcommand_from current; and not __fish_seen_subcommand_from exec; and not __fish_seen_subcommand_from uninstall; and not __fish_seen_subcommand_from help" -f -a "uninstall" -d 'Uninstall a Node.js version' +complete -c fnm -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from list-remote; and not __fish_seen_subcommand_from list; and not __fish_seen_subcommand_from install; and not __fish_seen_subcommand_from use; and not __fish_seen_subcommand_from env; and not __fish_seen_subcommand_from completions; and not __fish_seen_subcommand_from alias; and not __fish_seen_subcommand_from unalias; and not __fish_seen_subcommand_from default; and not __fish_seen_subcommand_from current; and not __fish_seen_subcommand_from exec; and not __fish_seen_subcommand_from uninstall; and not __fish_seen_subcommand_from help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' diff --git a/fish/completions/sdk.fish b/fish/completions/sdk.fish new file mode 100644 index 0000000..54693df --- /dev/null +++ b/fish/completions/sdk.fish @@ -0,0 +1,243 @@ +# Defines autocompletion for SDKMAN! + +# Copyright (c) 2018-2023 Raphael Reitzig +# MIT License (MIT) +# https://github.com/reitzig/sdkman-for-fish + +# Guard: SDKMAN! needs to be installed +if not test -f "$SDKMAN_DIR/bin/sdkman-init.sh" + exit 0 +end + +# # # # # # +# Completion trigger predicates +# # # # # # + +# Test if there is no command +function __fish_sdkman_no_command + set cmd (commandline -opc) + + if [ (count $cmd) -eq 1 ] + return 0 + end + return 1 +end + +# Test if the main command matches one of the parameters +function __fish_sdkman_using_command + set cmd (commandline -opc) + + if [ (count $cmd) -eq 2 ] + if contains $cmd[2] $argv + return 0 + end + end + return 1 +end + +function __fish_sdkman_specifying_candidate + set cmd (commandline -opc) + + if [ (count $cmd) -eq 3 ] # currently, sdk does not support multiple versions + if contains $cmd[2] $argv + return 0 + end + end + return 1 +end + +function __fish_sdkman_command_has_enough_parameters + set cmd (commandline -opc) + + if [ (count $cmd) -ge (math $argv[1] + 2) ]; and contains $cmd[2] $argv[2..-1] + return 0 + end + return 1 +end + +# # # # # # +# Data collectors +# # # # # # + +function __fish_sdkman_candidates + cat "$SDKMAN_DIR"/var/candidates | string replace -a -r ',' '\n' +end + +function __fish_sdkman_candidates_with_versions + set regexpHome (string replace -a '/' '\\/' "$HOME/") + + find "$SDKMAN_DIR"/candidates/ -mindepth 2 -maxdepth 2 -name '*current' \ + | awk -F '/' '{ print $(NF-1) }' \ + | sort -u +end + +function __fish_sdkman_installed_versions + set cmd (commandline -opc) + if [ -d "$SDKMAN_DIR"/candidates/$cmd[3]/current ] + ls -v1 "$SDKMAN_DIR"/candidates/$cmd[3] | grep -v current + end +end + +# # # # # # +# Completion specification +# # # # # # + +# install +complete -c sdk -f -n '__fish_sdkman_no_command' \ + -a 'i install' \ + -d 'Install new version' +complete -c sdk -f -n '__fish_sdkman_using_command i install' \ + -a "(__fish_sdkman_candidates)" +# TODO complete available versions --> issue #4 +complete -c sdk -f -n '__fish_sdkman_specifying_candidate i install' \ + -a 'a.b.c' \ + -d "version list unavailable" +complete -c sdk -f -n '__fish_sdkman_specifying_candidate i install' \ + -a 'x.y.z' \ + -d "Specify path to install custom version." +# Implicit: complete files as fourth parameter +complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 3 i install' + # block + +# uninstall +complete -c sdk -f -n '__fish_sdkman_no_command' \ + -a 'rm uninstall' -d 'Uninstall version' +complete -c sdk -f -n '__fish_sdkman_using_command rm uninstall' \ + -a "(__fish_sdkman_candidates_with_versions)" +complete -c sdk -f -n '__fish_sdkman_specifying_candidate rm uninstall' \ + -a "(__fish_sdkman_installed_versions)" +complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 2 rm uninstall' + # block + +# list +complete -c sdk -f -n '__fish_sdkman_no_command' \ + -a 'ls list' \ + -d 'List versions' +complete -c sdk -f -n '__fish_sdkman_using_command ls list' \ + -a "(__fish_sdkman_candidates)" +complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 1 ls list' + # block + +# use +complete -c sdk -f -n '__fish_sdkman_no_command' \ + -a 'u use' \ + -d 'Use specific version' +complete -c sdk -f -n '__fish_sdkman_using_command u use' \ + -a "(__fish_sdkman_candidates_with_versions)" +complete -c sdk -f -n '__fish_sdkman_specifying_candidate u use' \ + -a "(__fish_sdkman_installed_versions)" +complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 2 u use' + # block + +# default +complete -c sdk -f -n '__fish_sdkman_no_command' \ + -a 'd default' \ + -d 'Set default version' +complete -c sdk -f -n '__fish_sdkman_using_command d default' \ + -a "(__fish_sdkman_candidates_with_versions)" +complete -c sdk -f -n '__fish_sdkman_specifying_candidate d default' \ + -a "(__fish_sdkman_installed_versions)" +complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 2 d default' + # block + +# current +complete -c sdk -f -n '__fish_sdkman_no_command' \ + -a 'c current' \ + -d 'Display current version' +complete -c sdk -f -n '__fish_sdkman_using_command c current' \ + -a "(__fish_sdkman_candidates)" +complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 1 c current' + # block + +# upgrade +complete -c sdk -f -n '__fish_sdkman_no_command' \ + -a 'ug upgrade' \ + -d 'Display what is outdated' +complete -c sdk -f -n '__fish_sdkman_using_command ug upgrade' \ + -a "(__fish_sdkman_candidates_with_versions)" +complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 1 ug upgrade' + # block + +# version +complete -c sdk -f -n '__fish_sdkman_no_command' \ + -a 'v version' \ + -d 'Display version' +complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 0 v version' + # block + +# help +complete -c sdk -f -n '__fish_sdkman_no_command' \ + -a 'help' \ + -d 'Display help message' +complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 0 h help' + # block + +# offline +complete -c sdk -f -n '__fish_sdkman_no_command' \ + -a 'offline' \ + -d 'Set offline status' +complete -c sdk -f -n '__fish_sdkman_using_command offline' \ + -a 'enable' \ + -d 'Make sdk work while offline' +complete -c sdk -f -n '__fish_sdkman_using_command offline' \ + -a 'disable' \ + -d 'Turn on all features' +complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 1 offline' + # block + +# selfupdate +complete -c sdk -f -n '__fish_sdkman_no_command' \ + -a 'selfupdate' \ + -d 'Update sdk' +complete -c sdk -f -n '__fish_sdkman_using_command selfupdate' \ + -a 'force' \ + -d 'Force re-install of current version' +complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 1 selfupdate' + # block + +# update +complete -c sdk -f -n '__fish_sdkman_no_command' \ + -a 'update' \ + -d 'Reload the candidate list' +complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 0 update' + # block + +# flush +complete -c sdk -f -n '__fish_sdkman_no_command' \ + -a 'flush' \ + -d 'Clear out archives and temporary storage folders' +complete -c sdk -f -n '__fish_sdkman_using_command flush' \ + -a 'temp' \ + -d 'Clear out staging work folder' +complete -c sdk -f -n '__fish_sdkman_using_command flush' \ + -a 'version' \ + -d 'Flush version file' +complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 1 flush' + # block + +# env +complete -c sdk -f -n '__fish_sdkman_no_command' \ + -a 'e env' \ + -d 'Load environment from .sdkmanrc file' +complete -c sdk -f -n '__fish_sdkman_using_command e env' \ + -a 'init' \ + -d 'Initialize .sdkmanrc file' +complete -c sdk -f -n '__fish_sdkman_using_command e env' \ + -a 'install' \ + -d 'Install all candidate versions listed in .sdkmanrc' +complete -c sdk -f -n '__fish_sdkman_using_command e env' \ + -a 'clear' \ + -d 'Unload currently loaded environment' +complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 1 e env' + # block + +# home +complete -c sdk -f -n '__fish_sdkman_no_command' \ + -a 'h home' \ + -d 'Show installation folder of given candidate' +complete -c sdk -f -n '__fish_sdkman_using_command h home' \ + -a "(__fish_sdkman_candidates_with_versions)" +complete -c sdk -f -n '__fish_sdkman_specifying_candidate h home' \ + -a "(__fish_sdkman_installed_versions)" +complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 2 h home' + # block diff --git a/fish/conf.d/done.fish b/fish/conf.d/done.fish new file mode 100644 index 0000000..6ff631c --- /dev/null +++ b/fish/conf.d/done.fish @@ -0,0 +1,335 @@ +# MIT License + +# Copyright (c) 2016 Francisco Lourenço & Daniel Wehner + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +if not status is-interactive + exit +end + +set -g __done_version 1.19.2 + +function __done_run_powershell_script + set -l powershell_exe (command --search "powershell.exe") + + if test $status -ne 0 + and command --search wslvar + + set -l powershell_exe (wslpath (wslvar windir)/System32/WindowsPowerShell/v1.0/powershell.exe) + end + + if string length --quiet "$powershell_exe" + and test -x "$powershell_exe" + + set cmd (string escape $argv) + + eval "$powershell_exe -Command $cmd" + end +end + +function __done_windows_notification -a title -a message + if test "$__done_notify_sound" -eq 1 + set soundopt "