From 8b96e46d97db576d77c79e46b18380a103cdda46 Mon Sep 17 00:00:00 2001 From: Ismo Vuorinen Date: Wed, 18 Mar 2026 04:03:06 +0200 Subject: [PATCH] refactor(shell): replace version managers with mise activate --- config/exports | 24 ----------------- config/fish/conf.d/rustup.fish | 1 - config/fish/config.fish | 13 ++++------ config/fish/exports.fish | 19 -------------- config/fish/functions/load_nvm.fish | 16 ------------ config/fish/functions/nvm.fish | 3 --- config/fish/functions/nvm_find_nvmrc.fish | 3 --- config/husky/init.sh | 4 +-- config/nvim/init.lua | 8 ++++-- config/nvm/default-packages | 5 ---- config/shared.sh | 1 - config/vim/vimrc | 3 +++ config/zsh/antidote.zsh | 1 - config/zsh/antidote_plugins.txt | 4 --- config/zsh/p10k.zsh | 6 ++--- .../nvm-auto-use/nvm-auto-use.plugin.zsh | 26 ------------------- 16 files changed, 18 insertions(+), 119 deletions(-) delete mode 100644 config/fish/conf.d/rustup.fish delete mode 100644 config/fish/functions/load_nvm.fish delete mode 100644 config/fish/functions/nvm.fish delete mode 100644 config/fish/functions/nvm_find_nvmrc.fish delete mode 100644 config/nvm/default-packages delete mode 100644 config/zsh/plugins/nvm-auto-use/nvm-auto-use.plugin.zsh diff --git a/config/exports b/config/exports index 70814f5..bb732bd 100644 --- a/config/exports +++ b/config/exports @@ -347,22 +347,6 @@ export AWS_CONFIGURE_SESSION_MFA=true msg "Setting up Mason configuration" export MASON_HOME="$XDG_DATA_HOME/nvim/mason" -# Neovim environment variables — optional overrides for external tools. -# Neovim itself uses vim.fn.stdpath() and does not read these. -msg "Setting up Neovim configuration" -[ -z "${NVIM_STATE:-}" ] && export NVIM_STATE="$XDG_STATE_HOME/nvim" -[ -z "${NVIM_CONFIG_HOME:-}" ] && export NVIM_CONFIG_HOME="$XDG_CONFIG_HOME/nvim" -[ -z "${NVIM_DATA_HOME:-}" ] && export NVIM_DATA_HOME="$XDG_DATA_HOME/nvim" -[ -z "${NVIM_CACHE_HOME:-}" ] && export NVIM_CACHE_HOME="$XDG_CACHE_HOME/nvim" -[ -z "${NVIM_LOG_PATH:-}" ] && export NVIM_LOG_PATH="$NVIM_STATE/log" -[ -z "${NVIM_SESSION_PATH:-}" ] && export NVIM_SESSION_PATH="$NVIM_STATE/session" -[ -z "${NVIM_SHADA_PATH:-}" ] && export NVIM_SHADA_PATH="$NVIM_STATE/shada" -[ -z "${NVIM_UNDO_PATH:-}" ] && export NVIM_UNDO_PATH="$NVIM_STATE/undo" - -# Mason (nvim package manager) -msg "Setting up Mason configuration" -export MASON_HOME="$XDG_DATA_HOME/nvim/mason" - # Neovim environment variables msg "Setting up Neovim configuration" [ -z "${NVIM_STATE:-}" ] && export NVIM_STATE="$XDG_STATE_HOME/nvim" @@ -414,14 +398,6 @@ export DIRENV_LOG_FORMAT="" export FZF_BASE="${XDG_CONFIG_HOME}/fzf" export FZF_DEFAULT_OPTS='--height 40% --tmux bottom,40% --layout reverse --border top' -# FNM (Fast Node Manager) -msg "Setting up FNM configuration" -export FNM_DIR="$XDG_DATA_HOME/fnm" -export FNM_VERSION_FILE_STRATEGY="recursive" -export FNM_USE_ON_CD=true -export FNM_COREPACK_ENABLED=true -export FNM_RESOLVE_ENGINES=true - # GnuPG # https://gnupg.org/documentation/manuals/gnupg/Invoking-GPG.html msg "Setting up GnuPG configuration" diff --git a/config/fish/conf.d/rustup.fish b/config/fish/conf.d/rustup.fish deleted file mode 100644 index f9cc0b9..0000000 --- a/config/fish/conf.d/rustup.fish +++ /dev/null @@ -1 +0,0 @@ -source "$HOME/.local/share/cargo/env.fish" diff --git a/config/fish/config.fish b/config/fish/config.fish index a9afc99..6ad245b 100644 --- a/config/fish/config.fish +++ b/config/fish/config.fish @@ -22,20 +22,17 @@ if status is-interactive type -q op; and test -e "$HOME/.config/op/plugins.sh" && source "$HOME/.config/op/plugins.sh" - # version manager initializers - type -q mise; and source (mise activate fish|psub) - type -q rbenv; and source (rbenv init -|psub) - type -q pyenv; and source (pyenv init -|psub) - type -q pyenv; and source (pyenv virtualenv-init -|psub) - type -q goenv; and source (goenv init -|psub) - # type -q fnm; and fnm env --use-on-cd --shell fish | source - type -q load_nvm; and load_nvm >/dev/stderr + # mise version manager + type -q mise; and mise activate fish | source # Initialize other tools if available type -q zoxide; and zoxide init fish | source # Start tmux if not already running and not in SSH #.t # defined in functions/.t.fish +else + # Non-interactive shells (IDE subprocesses) use shims for tool discovery + type -q mise; and mise activate fish --shims | source end # Added by LM Studio CLI (lms) diff --git a/config/fish/exports.fish b/config/fish/exports.fish index 61146e8..af3b8c0 100644 --- a/config/fish/exports.fish +++ b/config/fish/exports.fish @@ -23,11 +23,6 @@ fish_add_path "$XDG_DATA_HOME/mise/shims" # Add cargo bin to path fish_add_path "$XDG_DATA_HOME/cargo/bin" -# NPM/NVM configuration -set -q NVM_DIR; or set -x NVM_DIR "$XDG_DATA_HOME/nvm" -fish_add_path "$NVM_DIR/bin" -fish_add_path "$XDG_CONFIG_HOME/nvm" - # Yarn configuration set -q YARN_GLOBAL_FOLDER; or set -x YARN_GLOBAL_FOLDER "$XDG_DATA_HOME/yarn" fish_add_path "$YARN_GLOBAL_FOLDER/bin" @@ -93,14 +88,6 @@ x-dc "$DOCKER_CONFIG" set -q DOCKER_HIDE_LEGACY_COMMANDS; or set -x DOCKER_HIDE_LEGACY_COMMANDS true set -q DOCKER_SCAN_SUGGEST; or set -x DOCKER_SCAN_SUGGEST false -# FNM / Node.js configuration -set -q FNM_DIR; or set -x FNM_DIR "$XDG_DATA_HOME/fnm" -fish_add_path "$FNM_DIR" -set -q FNM_VERSION_FILE_STRATEGY; or set -x FNM_VERSION_FILE_STRATEGY recursive -set -q FNM_USE_ON_CD; or set -x FNM_USE_ON_CD true -set -q FNM_COREPACK_ENABLED; or set -x FNM_COREPACK_ENABLED true -set -q FNM_RESOLVE_ENGINES; or set -x FNM_RESOLVE_ENGINES true - # fzf configuration set -q FZF_BASE; or set -x FZF_BASE "$XDG_CONFIG_HOME/fzf" set -q FZF_DEFAULT_OPTS; or set -x FZF_DEFAULT_OPTS \ @@ -113,16 +100,11 @@ set -q GNUPGHOME; or set -x GNUPGHOME "$XDG_DATA_HOME/gnupg" set -q GOPATH; or set -x GOPATH "$XDG_DATA_HOME/go" set -q GOBIN; or set -x GOBIN "$XDG_BIN_HOME" -set -q GOENV_ROOT; or set -x GOENV_ROOT "$XDG_DATA_HOME/goenv" -set -q GOENV_RC_FILE; or set -x GOENV_RC_FILE "$XDG_CONFIG_HOME/goenv/goenvrc.fish" - # 1Password configuration set -q OP_CACHE; or set -x OP_CACHE "$XDG_STATE_HOME/1password" # Python configuration set -q WORKON_HOME; or set -x WORKON_HOME "$XDG_DATA_HOME/virtualenvs" -set -q PYENV_ROOT; or set -x PYENV_ROOT "$XDG_DATA_HOME/pyenv" -fish_add_path "$PYENV_ROOT/bin" # Poetry configuration set -q POETRY_HOME; or set -x POETRY_HOME "$XDG_DATA_HOME/poetry" @@ -134,7 +116,6 @@ set -q CARGO_BIN_HOME; or set -x CARGO_BIN_HOME "$XDG_BIN_HOME" set -q RUSTUP_HOME; or set -x RUSTUP_HOME "$XDG_DATA_HOME/rustup" set -x RUST_WITHOUT "clippy,docs,rls" fish_add_path "$CARGO_HOME/bin" -fish_add_path "$XDG_DATA_HOME/bob/nvim-bin" # screen configuration set -q SCREENRC; or set -x SCREENRC "$XDG_CONFIG_HOME/misc/screenrc" diff --git a/config/fish/functions/load_nvm.fish b/config/fish/functions/load_nvm.fish deleted file mode 100644 index 3205b88..0000000 --- a/config/fish/functions/load_nvm.fish +++ /dev/null @@ -1,16 +0,0 @@ -function load_nvm --on-variable="PWD" - set -l default_node_version (nvm version default) - set -l node_version (nvm version) - set -l nvmrc_path (nvm_find_nvmrc) - if test -n "$nvmrc_path" - set -l nvmrc_node_version (nvm version (cat $nvmrc_path)) - if test "$nvmrc_node_version" = N/A - nvm install (cat $nvmrc_path) - else if test "$nvmrc_node_version" != "$node_version" - nvm use $nvmrc_node_version - end - else if test "$node_version" != "$default_node_version" - echo "Reverting to default Node version" - nvm use default - end -end diff --git a/config/fish/functions/nvm.fish b/config/fish/functions/nvm.fish deleted file mode 100644 index 97d790e..0000000 --- a/config/fish/functions/nvm.fish +++ /dev/null @@ -1,3 +0,0 @@ -function nvm - bass source $NVM_DIR/nvm.sh --no-use ';' nvm $argv -end diff --git a/config/fish/functions/nvm_find_nvmrc.fish b/config/fish/functions/nvm_find_nvmrc.fish deleted file mode 100644 index 14d616e..0000000 --- a/config/fish/functions/nvm_find_nvmrc.fish +++ /dev/null @@ -1,3 +0,0 @@ -function nvm_find_nvmrc - bass source $NVM_DIR/nvm.sh --no-use ';' nvm_find_nvmrc -end diff --git a/config/husky/init.sh b/config/husky/init.sh index a2770b5..caa03ba 100755 --- a/config/husky/init.sh +++ b/config/husky/init.sh @@ -1,4 +1,2 @@ #!/usr/bin/env bash - -[[ -z "$NVM_DIR" ]] && export NVM_DIR="$HOME/.config/nvm" -[[ -s "$NVM_DIR/nvm.sh" ]] && \. "$NVM_DIR/nvm.sh" # This loads nvm +eval "$(mise activate bash --shims)" diff --git a/config/nvim/init.lua b/config/nvim/init.lua index e90e5bf..bbfb13d 100644 --- a/config/nvim/init.lua +++ b/config/nvim/init.lua @@ -27,8 +27,12 @@ if not (vim.uv or vim.loop).fs_stat(lazypath) then end vim.opt.rtp:prepend(lazypath) --- ── Add ~/.local/bin to the PATH ──────────────────────────────────── -vim.fn.setenv('PATH', vim.fn.expand '$HOME/.local/bin' .. ':' .. vim.fn.expand '$PATH') +-- ── Add mise shims and ~/.local/bin to the PATH ─────────────────────── +vim.env.PATH = vim.env.HOME + .. '/.local/share/mise/shims:' + .. vim.env.HOME + .. '/.local/bin:' + .. vim.env.PATH require 'options' require 'autogroups' diff --git a/config/nvm/default-packages b/config/nvm/default-packages deleted file mode 100644 index 0f572fc..0000000 --- a/config/nvm/default-packages +++ /dev/null @@ -1,5 +0,0 @@ -# $NVM_DIR/default-packages - -yarn -neovim -corepack diff --git a/config/shared.sh b/config/shared.sh index ffeedea..0a5fe21 100755 --- a/config/shared.sh +++ b/config/shared.sh @@ -71,7 +71,6 @@ x-set-env XDG_BIN_HOME "$HOME/.local/bin" x-path-prepend "/usr/local/bin" x-path-prepend "/opt/homebrew/bin" x-path-prepend "$XDG_DATA_HOME/cargo/bin" -x-path-prepend "$XDG_DATA_HOME/bob/nvim-bin" x-path-prepend "$DOTFILES/local/bin" x-path-prepend "$XDG_BIN_HOME" diff --git a/config/vim/vimrc b/config/vim/vimrc index 7f2ce80..6e02f6a 100644 --- a/config/vim/vimrc +++ b/config/vim/vimrc @@ -3,6 +3,9 @@ " " vim: ts=2 sw=2 expandtab " vint: +ProhibitAbbreviationOption +ProhibitSetNoCompatible + +" mise — add shims to PATH for tool discovery +let $PATH = $HOME . '/.local/share/mise/shims:' . $PATH "***************************************************************************** "" Vim-Plug core "***************************************************************************** diff --git a/config/zsh/antidote.zsh b/config/zsh/antidote.zsh index 983435d..b125445 100755 --- a/config/zsh/antidote.zsh +++ b/config/zsh/antidote.zsh @@ -18,7 +18,6 @@ # Plugin configurations zstyle ':antidote:bundle' use-friendly-names 'yes' zstyle ':omz:update' mode reminder -zstyle ':omz:plugins:nvm' autoload yes # Pure prompt settings export PURE_PROMPT_SYMBOL='➜' diff --git a/config/zsh/antidote_plugins.txt b/config/zsh/antidote_plugins.txt index 1433cc2..31019e4 100644 --- a/config/zsh/antidote_plugins.txt +++ b/config/zsh/antidote_plugins.txt @@ -24,14 +24,10 @@ ohmyzsh/ohmyzsh path:plugins/fzf ohmyzsh/ohmyzsh path:plugins/git ohmyzsh/ohmyzsh path:plugins/golang ohmyzsh/ohmyzsh path:plugins/gpg-agent -ohmyzsh/ohmyzsh path:plugins/nvm ohmyzsh/ohmyzsh path:plugins/python # ohmyzsh/ohmyzsh path:plugins/tmux ohmyzsh/ohmyzsh path:plugins/z -# Automatically activate nvm if .nvmrc file is present -ivuorinen/nvm-auto-use - # Add core plugins that make Zsh a bit more like Fish zdharma-continuum/fast-syntax-highlighting diff --git a/config/zsh/p10k.zsh b/config/zsh/p10k.zsh index 575abe3..093d433 100644 --- a/config/zsh/p10k.zsh +++ b/config/zsh/p10k.zsh @@ -61,7 +61,7 @@ vcs # git status # command_execution_time # previous command duration go - nvm + mise aws # =========================[ Line #2 ]========================= newline # \n @@ -121,8 +121,8 @@ # Don't show context unless root or in SSH. # typeset -g POWERLEVEL9K_CONTEXT_{DEFAULT,SUDO}_CONTENT_EXPANSION= - # aws, go and nvm versions colors. - typeset -g POWERLEVEL9K_{AWS,GO,NVM}_FOREGROUND=$grey + # aws, go and mise versions colors. + typeset -g POWERLEVEL9K_{AWS,GO,MISE}_FOREGROUND=$grey # Show previous command duration only if it's >= 86400s = 24h. typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=86400 diff --git a/config/zsh/plugins/nvm-auto-use/nvm-auto-use.plugin.zsh b/config/zsh/plugins/nvm-auto-use/nvm-auto-use.plugin.zsh deleted file mode 100644 index b0c11d7..0000000 --- a/config/zsh/plugins/nvm-auto-use/nvm-auto-use.plugin.zsh +++ /dev/null @@ -1,26 +0,0 @@ -# shellcheck disable=SC1071,SC1103,SC2148 -# Source: https://github.com/nvm-sh/nvm#zsh -# place this after nvm initialization! -autoload -U add-zsh-hook - -load-nvmrc() { - local nvmrc_path - nvmrc_path="$(nvm_find_nvmrc)" - - if [ -n "$nvmrc_path" ]; then - local nvmrc_node_version - nvmrc_node_version=$(nvm version "$(cat "${nvmrc_path}")") - - if [ "$nvmrc_node_version" = "N/A" ]; then - nvm install - elif [ "$nvmrc_node_version" != "$(nvm version)" ]; then - nvm use - fi - elif [ -n "$(PWD=$OLDPWD nvm_find_nvmrc)" ] && [ "$(nvm version)" != "$(nvm version default)" ]; then - echo "Reverting to nvm default version" - nvm use default - fi -} - -add-zsh-hook chpwd load-nvmrc -load-nvmrc