Updated fish project manager for better paths.

This commit is contained in:
2026-04-24 08:44:41 +02:00
parent 5fd44ca1d1
commit b594bb3057
+9 -10
View File
@@ -9,8 +9,8 @@ set -gx EDITOR nvim
set -gx VISUAL nvim set -gx VISUAL nvim
set -gx MANPAGER "nvim +Man!" set -gx MANPAGER "nvim +Man!"
set -gx BROWSER firefox set -gx BROWSER firefox
set -gx TERM "xterm-256color" set -gx TERM xterm-256color
set -gx COLORTERM "truecolor" set -gx COLORTERM truecolor
set -gx LANG "en_US.UTF-8" set -gx LANG "en_US.UTF-8"
set -gx LC_ALL "en_US.UTF-8" set -gx LC_ALL "en_US.UTF-8"
@@ -42,17 +42,16 @@ set -gx FZF_DEFAULT_COMMAND 'fdfind --exclude={.git,.cache,.xmake,.zig-cache,bui
# Fish's 'fish_add_path' is smart: it checks if the dir exists and prevents duplicates. # Fish's 'fish_add_path' is smart: it checks if the dir exists and prevents duplicates.
fish_add_path "$HOME/.local/bin" fish_add_path "$HOME/.local/bin"
fish_add_path "$HOME/bin" fish_add_path "$HOME/bin"
fish_add_path "/usr/local/bin" fish_add_path /usr/local/bin
fish_add_path "$HOME/.local/apps/nvim/bin" fish_add_path "$HOME/.local/apps/nvim/bin"
fish_add_path "$HOME/.npm-global/bin" fish_add_path "$HOME/.npm-global/bin"
fish_add_path "/var/lib/flatpak/exports/bin" fish_add_path /var/lib/flatpak/exports/bin
fish_add_path "$HOME/.local/share/flatpak/exports/bin" fish_add_path "$HOME/.local/share/flatpak/exports/bin"
fish_add_path "/usr/local/go/bin" fish_add_path /usr/local/go/bin
fish_add_path $GOPATH/bin fish_add_path $GOPATH/bin
fish_add_path "$HOME/.local/bin" fish_add_path "$HOME/.local/bin"
fish_add_path "$HOME/bin" fish_add_path "$HOME/bin"
# ============================================================================== # ==============================================================================
# ALIASES & ABBREVIATIONS # ALIASES & ABBREVIATIONS
# ============================================================================== # ==============================================================================
@@ -105,24 +104,24 @@ function pp
touch "$project_file" touch "$project_file"
end end
if count $argv > /dev/null if count $argv >/dev/null
# Case 1: Path provided - Add to list # Case 1: Path provided - Add to list
set -l absolute_path (realpath $argv[1]) set -l absolute_path (realpath $argv[1])
if grep -Fxq "$absolute_path" "$project_file" if grep -Fxq "$absolute_path" "$project_file"
echo "Project already exists in list." echo "Project already exists in list."
else else
echo "$absolute_path" >> "$project_file" echo "$absolute_path" >>"$project_file"
echo "Added: $absolute_path" echo "Added: $absolute_path"
end end
else else
# Case 2: No arguments - Select and Open # Case 2: No arguments - Select and Open
set -l selection (cat "$project_file" | fzf --height 40% --reverse --header="Select Project") set -l selection (cat "$project_file" | awk -F'/' '{print $NF "\t" $0}' | fzf --height 40% --reverse --header="Select Project" --with-nth=1 --delimiter=(printf '\t') | cut -f2)
if test -n "$selection" if test -n "$selection"
cd "$selection" cd "$selection"
commandline -f repaint # Ensures the prompt updates after cd commandline -f repaint # Ensures the prompt updates after cd
nvim hx
end end
end end
end end