commit 23142066316853990613b9facf5313e8dd0d8151 parent 5c1a2f648bd93af2f7da94fe4c32f43110de34c2 Author: Szymon Mikulicz <szymon.mikulicz@posteo.net> Date: Mon, 20 Apr 2026 15:35:13 +0200 Mise tools Diffstat:
| M | zsh/.zshenv | | | 19 | ++++++++++++++++--- |
1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/zsh/.zshenv b/zsh/.zshenv @@ -1,9 +1,22 @@ skip_global_compinit=1 export PATH="$HOME/.local/bin:$HOME/.usr/local/bin:$PATH" -export EDITOR=nvim -export SUDO_EDITOR=nvim + +export MISE_Found="$(which mise &>/dev/null; echo $?)" +tools=( 'vivid' 'nvim' ) +declare -A tool_paths + +for tool in "${tools[@]}"; do + if [[ $MISE_Found == 0 ]] && tool_path="$(mise x -- which $tool)"; then + tool_paths[$tool]="$tool_path" + elif tool_path="$(which $tool)"; then + tool_paths[$tool]="$tool_path" + fi +done + +[ -n ${tool_paths[nvim]} ] && export EDITOR="${tool_paths[nvim]}" && export SUDO_EDITOR="$EDITOR" +[ -n ${tool_paths[vivid]} ] && export LS_COLORS="$(${tool_paths[vivid]} generate rose-pine-moon)" + export PERL5LIB="$HOME/.usr/local/lib/perl5/" export XDG_DATA_DIRS="$XDG_DATA_DIRS:$HOME/.usr/local/share" export PYTHONPATH="$HOME/.usr/local/lib/python3/dist-packages" -which vivid &>/dev/null && export LS_COLORS="$(vivid generate rose-pine-moon)" [ -f "$XDG_RUNTIME_DIR/arista-ssh/agent.sock" ] && export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/arista-ssh/agent.sock"