diff --git a/.config/fish/conf.d/puffer_fish_key_bindings.fish b/.config/fish/conf.d/puffer_fish_key_bindings.fish new file mode 100644 index 0000000..58d4d3d --- /dev/null +++ b/.config/fish/conf.d/puffer_fish_key_bindings.fish @@ -0,0 +1,25 @@ +status is-interactive || exit + +function _puffer_fish_key_bindings --on-variable fish_key_bindings + set -l modes + if test "$fish_key_bindings" = fish_default_key_bindings + set modes default insert + else + set modes insert default + end + + bind --mode $modes[1] . _puffer_fish_expand_dots + bind --mode $modes[1] ! _puffer_fish_expand_bang + bind --mode $modes[1] '$' _puffer_fish_expand_lastarg + bind --mode $modes[2] --erase . ! '$' +end + +_puffer_fish_key_bindings + +set -l uninstall_event puffer_fish_key_bindings_uninstall + +function _$uninstall_event --on-event $uninstall_event + bind -e . + bind -e ! + bind -e '$' +end diff --git a/.config/fish/fish_plugins b/.config/fish/fish_plugins new file mode 100644 index 0000000..cf39ae5 --- /dev/null +++ b/.config/fish/fish_plugins @@ -0,0 +1 @@ +nickeb96/puffer-fish diff --git a/.config/fish/fish_variables b/.config/fish/fish_variables index a258a99..2f0eb21 100644 --- a/.config/fish/fish_variables +++ b/.config/fish/fish_variables @@ -2,13 +2,12 @@ # VERSION: 3.0 SETUVAR --export BAT_THEME:OneHalfDark SETUVAR --export EDITOR:nvim -SETUVAR --export ELECTRON_OSZONE_PLATFORM_HINT:wayland SETUVAR --export ELECTRON_OZONE_PLATFORM_HINT:wayland SETUVAR FLASK_ENV:development SETUVAR --export --path GODOT_ADDON_PATH:\x7e/\x2elocal/share/godot/addons SETUVAR LANG:en_GB\x2eUTF\x2d8 SETUVAR LANGUAGE:en_GB\x2eUTF\x2d8 -SETUVAR --export LAST_DIR:/home/felix/Code/CODE/tutorials/rust_web_server +SETUVAR --export LAST_DIR:/home/felix/Code/side/advent_of_code_2024 SETUVAR --export MY_GITLAB_TOKEN:glpat\x2dye6rAJswy24rQcRNnmLo SETUVAR --export RUSTC_WRAPPER:sccache SETUVAR --export SUDO_ASKPASS:/usr/bin/ksshaskpass @@ -20,6 +19,9 @@ SETUVAR _fish_abbr_clera:clear SETUVAR _fish_abbr_current_2D_project:vim\x20Code/side/first_rust_gui SETUVAR _fish_abbr_secscreen:\x2e/Code/scripts/act_second_monitor\x2esh SETUVAR _fish_abbr_uin:sudo\x20pacman\x20\x2dRuscn +SETUVAR _fisher_nickeb96_2F_puffer_2D_fish_files:\x7e/\x2econfig/fish/functions/_puffer_fish_expand_bang\x2efish\x1e\x7e/\x2econfig/fish/functions/_puffer_fish_expand_dots\x2efish\x1e\x7e/\x2econfig/fish/functions/_puffer_fish_expand_lastarg\x2efish\x1e\x7e/\x2econfig/fish/conf\x2ed/puffer_fish_key_bindings\x2efish +SETUVAR _fisher_plugins:nickeb96/puffer\x2dfish +SETUVAR _fisher_upgraded_to_4_4:\x1d SETUVAR fish_color_autosuggestion:969896 SETUVAR fish_color_cancel:\x2d\x2dreverse SETUVAR fish_color_command:b294bb diff --git a/.config/fish/functions/_puffer_fish_expand_bang.fish b/.config/fish/functions/_puffer_fish_expand_bang.fish new file mode 100644 index 0000000..401d85e --- /dev/null +++ b/.config/fish/functions/_puffer_fish_expand_bang.fish @@ -0,0 +1,9 @@ +function _puffer_fish_expand_bang + switch (commandline -t) + case '!' + commandline -t $history[1] + case '*' + commandline -i '!' + end +end + diff --git a/.config/fish/functions/_puffer_fish_expand_dots.fish b/.config/fish/functions/_puffer_fish_expand_dots.fish new file mode 100644 index 0000000..ff82af7 --- /dev/null +++ b/.config/fish/functions/_puffer_fish_expand_dots.fish @@ -0,0 +1,9 @@ +function _puffer_fish_expand_dots -d 'expand ... to ../.. etc' + set -l cmd (commandline --cut-at-cursor) + set -l split (string split -- ' ' $cmd) + if string match --quiet --regex -- '^(\.\./)*\.\.$' $split[-1] + commandline --insert '/..' + else + commandline --insert '.' + end +end diff --git a/.config/fish/functions/_puffer_fish_expand_lastarg.fish b/.config/fish/functions/_puffer_fish_expand_lastarg.fish new file mode 100644 index 0000000..a61b892 --- /dev/null +++ b/.config/fish/functions/_puffer_fish_expand_lastarg.fish @@ -0,0 +1,9 @@ +function _puffer_fish_expand_lastarg + switch (commandline -t) + case '!' + commandline -t "" + commandline -f history-token-search-backward + case '*' + commandline -i '$' + end +end diff --git a/.config/fish/functions/restart.fish b/.config/fish/functions/restart.fish index 36a2c38..e212cf1 100644 --- a/.config/fish/functions/restart.fish +++ b/.config/fish/functions/restart.fish @@ -1,4 +1,4 @@ function restart --argument x -pkill $x && $x &>/dev/null& && jobs | disown +pkill $x && $x &>/dev/null& && sleep 0.2 && jobs | disown end