From: Andre Ramnitz Date: Mon, 27 Oct 2025 22:06:42 +0000 (+0100) Subject: fish: update config X-Git-Url: https://git.ramnitz.eu/?a=commitdiff_plain;h=c18039a63ed073b10fccd1bcfaa343b9e5d017d2;p=dotfiles.git fish: update config --- diff --git a/dot-config/fish/config.fish b/dot-config/fish/config.fish index 29739441..795c5122 100644 --- a/dot-config/fish/config.fish +++ b/dot-config/fish/config.fish @@ -6,6 +6,8 @@ if status is-interactive set EZA_COLORS "*.patch.skip=38;5;244" command -v fastfetch && command fastfetch -c ~/.config/fastfetch/default.jsonc source (/usr/bin/starship init fish --print-full-init | psub) + set -gx EDITOR 'kks edit' + set -gx VISUAL 'kks edit' set -g fish_greeting end diff --git a/dot-config/fish/functions/hyprconfig.fish b/dot-config/fish/functions/hyprconfig.fish new file mode 100644 index 00000000..76c0f1b9 --- /dev/null +++ b/dot-config/fish/functions/hyprconfig.fish @@ -0,0 +1,3 @@ +function hyprconfig --wraps='kks edit ~/.config/hypr/hypr*.conf ~/.config/hypr/fragments/* ' --description 'alias hyprconfig=kak ~/.config/hypr/hypr*.conf ~/.config/hypr/fragments/* ' + kak ~/.config/hypr/hypr*.conf ~/.config/hypr/fragments/* $argv +end diff --git a/dot-config/fish/functions/lf.fish b/dot-config/fish/functions/lf.fish new file mode 100644 index 00000000..4e64c070 --- /dev/null +++ b/dot-config/fish/functions/lf.fish @@ -0,0 +1,19 @@ +# 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 lf --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 + diff --git a/dot-config/fish/functions/lfcd.fish b/dot-config/fish/functions/lfcd.fish deleted file mode 100644 index 1e50b6fe..00000000 --- a/dot-config/fish/functions/lfcd.fish +++ /dev/null @@ -1,19 +0,0 @@ -# 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 -