feat: set up asdf

Amolith created

Change summary

dot_config/private_fish/config.fish.tmpl | 15 +++++++++++++++
1 file changed, 15 insertions(+)

Detailed changes

dot_config/private_fish/config.fish.tmpl 🔗

@@ -22,6 +22,7 @@ set -gx ZIM_HOME "$XDG_CONFIG_HOME"/.zim
 set -gx GHCUP_USE_XDG_DIRS "ishouldjustbeabletoexportthisnotsetit"
 set -gx NODE_PATH "$XDG_DATA_HOME/npm-packages/lib/node_modules"
 set -gx CARGO_HOME "$XDG_DATA_HOME"/cargo
+set -gx ASDF_DATA_DIR "$XDG_DATA_HOME/asdf"
 
 alias wget="wget --hsts-file=\"$XDG_DATA_HOME/wget-hsts\""
 alias svn="svn --config-dir $XDG_CONFIG_HOME/subversion"
@@ -85,6 +86,13 @@ set -gx OPENAI_API_KEY "$OPENROUTER_API_KEY"
 # PATHs
 fish_add_path "$XDG_DATA_HOME/npm-packages/bin"
 
+# ASDF configuration
+if test -z $ASDF_DATA_DIR
+    set _asdf_shims "$HOME/.asdf/shims"
+else
+    set _asdf_shims "$ASDF_DATA_DIR/shims"
+end
+
 if status is-interactive
     # Bunch of aliases
     alias joe="joe-gitignore"
@@ -114,3 +122,10 @@ if status is-interactive
     atuin init --disable-up-arrow fish | source
     enable_transience
 end
+
+# Do not use fish_add_path (added in Fish 3.2) because it
+# potentially changes the order of items in PATH
+if not contains $_asdf_shims $PATH
+    set -gx --prepend PATH $_asdf_shims
+end
+set --erase _asdf_shims