diff --git a/config/fish/config.fish b/config/fish/config.fish index 50963732..a0712055 100644 --- a/config/fish/config.fish +++ b/config/fish/config.fish @@ -11,15 +11,45 @@ set -gx fish_complete_path "$XDG_CONFIG_HOME/fish/completions" $fish_complete_pa set -gx FZF_DEFAULT_OPTS "--height 40% --layout=reverse --border" set -gx FZF_DEFAULT_COMMAND "fd --type f" -function yazicd - set tmp (mktemp -t "yazi-cwd.XXXXXX") - yazi $argv --cwd-file="$tmp" - if read -z cwd < "$tmp"; and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ] - builtin z -- "$cwd" && eza -a --icons --group-directories-first - end - rm -f -- "$tmp" >/dev/null 2>&1 +# Functions +function cd + if test (count $argv) -eq 0 + builtin cd ~ + else + builtin cd $argv + end + eza -a --icons --group-directories-first end +function lfcd + set tmp (mktemp -uq) + lf -last-dir-path="$tmp" $argv + if test -f "$tmp" + set dir (cat "$tmp") + if test -d "$dir" -a "$dir" != (pwd) + cd "$dir" + end + end +end + +function yazicd + set tmp (mktemp -t "yazi-cwd.XXXXXX") + yazi $argv --cwd-file="$tmp" + set cwd (cat "$tmp") + if test -n "$cwd" -a "$cwd" != "$PWD" + cd "$cwd" + eza -a --icons --group-directories-first + end + rm -f "$tmp" +end + +# Keybindings +fish_vi_key_bindings + + +# Source other files +# if test -f "$HOME/.local/share/../bin/env" +# source "$HOME/.local/share/../bin/env" # # PATH configuration # fish_add_path $BUN_INSTALL/bin # fish_add_path $HOME/.local/bin