--- /dev/null
+# Autocompletion for fish shell.
+#
+# You may put this file to a directory in $fish_complete_path variable:
+#
+# mkdir -p ~/.config/fish/completions
+# ln -s "/path/to/lf.fish" ~/.config/fish/completions
+#
+
+complete -c lf -o command -r -d 'command to execute on client initialization'
+complete -c lf -o config -r -d 'path to the config file (instead of the usual paths)'
+complete -c lf -o cpuprofile -r -d 'path to the file to write the CPU profile'
+complete -c lf -o doc -d 'show documentation'
+complete -c lf -o last-dir-path -r -d 'path to the file to write the last dir on exit (to use for cd)'
+complete -c lf -o log -r -d 'path to the log file to write messages'
+complete -c lf -o memprofile -r -d 'path to the file to write the memory profile'
+complete -c lf -o print-last-dir -d 'print the last dir to stdout on exit (to use for cd)'
+complete -c lf -o print-selection -d 'print the selected files to stdout on open (to use as open file dialog)'
+complete -c lf -o remote -x -d 'send remote command to server'
+complete -c lf -o selection-path -r -d 'path to the file to write selected files on open (to use as open file dialog)'
+complete -c lf -o server -d 'start server (automatic)'
+complete -c lf -o single -d 'start a client without server'
+complete -c lf -o version -d 'show version'
+complete -c lf -o help -d 'show help'
+
SETUVAR fish_pager_color_prefix:normal\x1e\x2d\x2dbold\x1e\x2d\x2dunderline
SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan
SETUVAR fish_pager_color_selected_background:\x2dr
-SETUVAR fish_user_paths:/home/andy/Applications\x1e/home/andy/go/bin\x1e/home/andy/\x2ecargo/bin\x1e/home/andy/\x2elocal/bin\x1e/home/andy/\x2espicetify
+SETUVAR fish_user_paths:/media/source/dart\x2dsass\x1e/home/andy/Applications\x1e/home/andy/go/bin\x1e/home/andy/\x2ecargo/bin\x1e/home/andy/\x2elocal/bin\x1e/home/andy/\x2espicetify
--- /dev/null
+function cdg --wraps='cd (git rev-parse --show-toplevel)' --description 'alias cdg cd (git rev-parse --show-toplevel)'
+ cd (git rev-parse --show-toplevel) $argv
+
+end
--- /dev/null
+# Change working dir in fish to last dir in lf on exit (adapted from ranger).
+#
+# You may put this file to a directory in $fish_function_path variable:
+#
+# mkdir -p ~/.config/fish/functions
+# ln -s "/path/to/lfcd.fish" ~/.config/fish/functions
+#
+# You may also like to assign a key (Ctrl-O) to this command:
+#
+# bind \co 'set old_tty (stty -g); stty sane; lfcd; stty $old_tty; commandline -f repaint'
+#
+# You may put this in a function called fish_user_key_bindings.
+
+function lfcd --wraps="lf" --description="lf - Terminal file manager (changing directory on exit)"
+ # `command` is needed in case `lfcd` is aliased to `lf`.
+ # Quotes will cause `cd` to not change directory if `lf` prints nothing to stdout due to an error.
+ cd "$(command lf -print-last-dir $argv)"
+end
+
--- /dev/null
+function y
+ set tmp (mktemp -t "yazi-cwd.XXXXXX")
+ yazi $argv --cwd-file="$tmp"
+ if read -z cwd < "$tmp"; and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ]
+ builtin cd -- "$cwd"
+ end
+ rm -f -- "$tmp"
+end
+