mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-03-18 22:06:02 +00:00
refactor(shell): replace version managers with mise activate
This commit is contained in:
@@ -347,22 +347,6 @@ export AWS_CONFIGURE_SESSION_MFA=true
|
|||||||
msg "Setting up Mason configuration"
|
msg "Setting up Mason configuration"
|
||||||
export MASON_HOME="$XDG_DATA_HOME/nvim/mason"
|
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
|
# Neovim environment variables
|
||||||
msg "Setting up Neovim configuration"
|
msg "Setting up Neovim configuration"
|
||||||
[ -z "${NVIM_STATE:-}" ] && export NVIM_STATE="$XDG_STATE_HOME/nvim"
|
[ -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_BASE="${XDG_CONFIG_HOME}/fzf"
|
||||||
export FZF_DEFAULT_OPTS='--height 40% --tmux bottom,40% --layout reverse --border top'
|
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
|
# GnuPG
|
||||||
# https://gnupg.org/documentation/manuals/gnupg/Invoking-GPG.html
|
# https://gnupg.org/documentation/manuals/gnupg/Invoking-GPG.html
|
||||||
msg "Setting up GnuPG configuration"
|
msg "Setting up GnuPG configuration"
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
source "$HOME/.local/share/cargo/env.fish"
|
|
||||||
@@ -22,20 +22,17 @@ if status is-interactive
|
|||||||
type -q op; and test -e "$HOME/.config/op/plugins.sh" &&
|
type -q op; and test -e "$HOME/.config/op/plugins.sh" &&
|
||||||
source "$HOME/.config/op/plugins.sh"
|
source "$HOME/.config/op/plugins.sh"
|
||||||
|
|
||||||
# version manager initializers
|
# mise version manager
|
||||||
type -q mise; and source (mise activate fish|psub)
|
type -q mise; and mise activate fish | source
|
||||||
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
|
|
||||||
|
|
||||||
# Initialize other tools if available
|
# Initialize other tools if available
|
||||||
type -q zoxide; and zoxide init fish | source
|
type -q zoxide; and zoxide init fish | source
|
||||||
|
|
||||||
# Start tmux if not already running and not in SSH
|
# Start tmux if not already running and not in SSH
|
||||||
#.t # defined in functions/.t.fish
|
#.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
|
end
|
||||||
|
|
||||||
# Added by LM Studio CLI (lms)
|
# Added by LM Studio CLI (lms)
|
||||||
|
|||||||
@@ -23,11 +23,6 @@ fish_add_path "$XDG_DATA_HOME/mise/shims"
|
|||||||
# Add cargo bin to path
|
# Add cargo bin to path
|
||||||
fish_add_path "$XDG_DATA_HOME/cargo/bin"
|
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
|
# Yarn configuration
|
||||||
set -q YARN_GLOBAL_FOLDER; or set -x YARN_GLOBAL_FOLDER "$XDG_DATA_HOME/yarn"
|
set -q YARN_GLOBAL_FOLDER; or set -x YARN_GLOBAL_FOLDER "$XDG_DATA_HOME/yarn"
|
||||||
fish_add_path "$YARN_GLOBAL_FOLDER/bin"
|
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_HIDE_LEGACY_COMMANDS; or set -x DOCKER_HIDE_LEGACY_COMMANDS true
|
||||||
set -q DOCKER_SCAN_SUGGEST; or set -x DOCKER_SCAN_SUGGEST false
|
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
|
# fzf configuration
|
||||||
set -q FZF_BASE; or set -x FZF_BASE "$XDG_CONFIG_HOME/fzf"
|
set -q FZF_BASE; or set -x FZF_BASE "$XDG_CONFIG_HOME/fzf"
|
||||||
set -q FZF_DEFAULT_OPTS; or set -x FZF_DEFAULT_OPTS \
|
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 GOPATH; or set -x GOPATH "$XDG_DATA_HOME/go"
|
||||||
set -q GOBIN; or set -x GOBIN "$XDG_BIN_HOME"
|
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
|
# 1Password configuration
|
||||||
set -q OP_CACHE; or set -x OP_CACHE "$XDG_STATE_HOME/1password"
|
set -q OP_CACHE; or set -x OP_CACHE "$XDG_STATE_HOME/1password"
|
||||||
|
|
||||||
# Python configuration
|
# Python configuration
|
||||||
set -q WORKON_HOME; or set -x WORKON_HOME "$XDG_DATA_HOME/virtualenvs"
|
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
|
# Poetry configuration
|
||||||
set -q POETRY_HOME; or set -x POETRY_HOME "$XDG_DATA_HOME/poetry"
|
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 -q RUSTUP_HOME; or set -x RUSTUP_HOME "$XDG_DATA_HOME/rustup"
|
||||||
set -x RUST_WITHOUT "clippy,docs,rls"
|
set -x RUST_WITHOUT "clippy,docs,rls"
|
||||||
fish_add_path "$CARGO_HOME/bin"
|
fish_add_path "$CARGO_HOME/bin"
|
||||||
fish_add_path "$XDG_DATA_HOME/bob/nvim-bin"
|
|
||||||
|
|
||||||
# screen configuration
|
# screen configuration
|
||||||
set -q SCREENRC; or set -x SCREENRC "$XDG_CONFIG_HOME/misc/screenrc"
|
set -q SCREENRC; or set -x SCREENRC "$XDG_CONFIG_HOME/misc/screenrc"
|
||||||
|
|||||||
@@ -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
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
function nvm
|
|
||||||
bass source $NVM_DIR/nvm.sh --no-use ';' nvm $argv
|
|
||||||
end
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
function nvm_find_nvmrc
|
|
||||||
bass source $NVM_DIR/nvm.sh --no-use ';' nvm_find_nvmrc
|
|
||||||
end
|
|
||||||
@@ -1,4 +1,2 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
eval "$(mise activate bash --shims)"
|
||||||
[[ -z "$NVM_DIR" ]] && export NVM_DIR="$HOME/.config/nvm"
|
|
||||||
[[ -s "$NVM_DIR/nvm.sh" ]] && \. "$NVM_DIR/nvm.sh" # This loads nvm
|
|
||||||
|
|||||||
@@ -27,8 +27,12 @@ if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
|||||||
end
|
end
|
||||||
vim.opt.rtp:prepend(lazypath)
|
vim.opt.rtp:prepend(lazypath)
|
||||||
|
|
||||||
-- ── Add ~/.local/bin to the PATH ────────────────────────────────────
|
-- ── Add mise shims and ~/.local/bin to the PATH ───────────────────────
|
||||||
vim.fn.setenv('PATH', vim.fn.expand '$HOME/.local/bin' .. ':' .. vim.fn.expand '$PATH')
|
vim.env.PATH = vim.env.HOME
|
||||||
|
.. '/.local/share/mise/shims:'
|
||||||
|
.. vim.env.HOME
|
||||||
|
.. '/.local/bin:'
|
||||||
|
.. vim.env.PATH
|
||||||
|
|
||||||
require 'options'
|
require 'options'
|
||||||
require 'autogroups'
|
require 'autogroups'
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
# $NVM_DIR/default-packages
|
|
||||||
|
|
||||||
yarn
|
|
||||||
neovim
|
|
||||||
corepack
|
|
||||||
@@ -71,7 +71,6 @@ x-set-env XDG_BIN_HOME "$HOME/.local/bin"
|
|||||||
x-path-prepend "/usr/local/bin"
|
x-path-prepend "/usr/local/bin"
|
||||||
x-path-prepend "/opt/homebrew/bin"
|
x-path-prepend "/opt/homebrew/bin"
|
||||||
x-path-prepend "$XDG_DATA_HOME/cargo/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 "$DOTFILES/local/bin"
|
||||||
x-path-prepend "$XDG_BIN_HOME"
|
x-path-prepend "$XDG_BIN_HOME"
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,9 @@
|
|||||||
"
|
"
|
||||||
" vim: ts=2 sw=2 expandtab
|
" vim: ts=2 sw=2 expandtab
|
||||||
" vint: +ProhibitAbbreviationOption +ProhibitSetNoCompatible
|
" vint: +ProhibitAbbreviationOption +ProhibitSetNoCompatible
|
||||||
|
|
||||||
|
" mise — add shims to PATH for tool discovery
|
||||||
|
let $PATH = $HOME . '/.local/share/mise/shims:' . $PATH
|
||||||
"*****************************************************************************
|
"*****************************************************************************
|
||||||
"" Vim-Plug core
|
"" Vim-Plug core
|
||||||
"*****************************************************************************
|
"*****************************************************************************
|
||||||
|
|||||||
@@ -18,7 +18,6 @@
|
|||||||
# Plugin configurations
|
# Plugin configurations
|
||||||
zstyle ':antidote:bundle' use-friendly-names 'yes'
|
zstyle ':antidote:bundle' use-friendly-names 'yes'
|
||||||
zstyle ':omz:update' mode reminder
|
zstyle ':omz:update' mode reminder
|
||||||
zstyle ':omz:plugins:nvm' autoload yes
|
|
||||||
|
|
||||||
# Pure prompt settings
|
# Pure prompt settings
|
||||||
export PURE_PROMPT_SYMBOL='➜'
|
export PURE_PROMPT_SYMBOL='➜'
|
||||||
|
|||||||
@@ -24,14 +24,10 @@ ohmyzsh/ohmyzsh path:plugins/fzf
|
|||||||
ohmyzsh/ohmyzsh path:plugins/git
|
ohmyzsh/ohmyzsh path:plugins/git
|
||||||
ohmyzsh/ohmyzsh path:plugins/golang
|
ohmyzsh/ohmyzsh path:plugins/golang
|
||||||
ohmyzsh/ohmyzsh path:plugins/gpg-agent
|
ohmyzsh/ohmyzsh path:plugins/gpg-agent
|
||||||
ohmyzsh/ohmyzsh path:plugins/nvm
|
|
||||||
ohmyzsh/ohmyzsh path:plugins/python
|
ohmyzsh/ohmyzsh path:plugins/python
|
||||||
# ohmyzsh/ohmyzsh path:plugins/tmux
|
# ohmyzsh/ohmyzsh path:plugins/tmux
|
||||||
ohmyzsh/ohmyzsh path:plugins/z
|
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
|
# Add core plugins that make Zsh a bit more like Fish
|
||||||
zdharma-continuum/fast-syntax-highlighting
|
zdharma-continuum/fast-syntax-highlighting
|
||||||
|
|
||||||
|
|||||||
@@ -61,7 +61,7 @@
|
|||||||
vcs # git status
|
vcs # git status
|
||||||
# command_execution_time # previous command duration
|
# command_execution_time # previous command duration
|
||||||
go
|
go
|
||||||
nvm
|
mise
|
||||||
aws
|
aws
|
||||||
# =========================[ Line #2 ]=========================
|
# =========================[ Line #2 ]=========================
|
||||||
newline # \n
|
newline # \n
|
||||||
@@ -121,8 +121,8 @@
|
|||||||
# Don't show context unless root or in SSH.
|
# Don't show context unless root or in SSH.
|
||||||
# typeset -g POWERLEVEL9K_CONTEXT_{DEFAULT,SUDO}_CONTENT_EXPANSION=
|
# typeset -g POWERLEVEL9K_CONTEXT_{DEFAULT,SUDO}_CONTENT_EXPANSION=
|
||||||
|
|
||||||
# aws, go and nvm versions colors.
|
# aws, go and mise versions colors.
|
||||||
typeset -g POWERLEVEL9K_{AWS,GO,NVM}_FOREGROUND=$grey
|
typeset -g POWERLEVEL9K_{AWS,GO,MISE}_FOREGROUND=$grey
|
||||||
|
|
||||||
# Show previous command duration only if it's >= 86400s = 24h.
|
# Show previous command duration only if it's >= 86400s = 24h.
|
||||||
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=86400
|
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=86400
|
||||||
|
|||||||
@@ -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
|
|
||||||
Reference in New Issue
Block a user