diff --git a/files/fish/functions/fish_custom_functions.fish b/files/fish/functions/fish_custom_functions.fish index a243454..678465e 100644 --- a/files/fish/functions/fish_custom_functions.fish +++ b/files/fish/functions/fish_custom_functions.fish @@ -38,10 +38,20 @@ end function bang-bang-k set -l k (string replace '!!:' '' $argv[1]) - set -l arr (string replace -ra ' ' '\n' $history[1]) + set -l arr (string replace -ra '([^\\\ ])( |\n)+' '$1\n' $history[1]) echo $arr[$k] end +function bang-dollar + set -l arr (string replace -ra '([^\\\ ])( |\n)+' '$1\n' $history[1]) + echo $arr[-1] +end + +function bang-star + set -l arr (string replace -ra '([^\\\ ])( |\n)+' '$1\n' $history[1]) + echo $arr[..-2] +end + function edit-home echo "~/projects/code/scm/radix/ && $EDITOR home-environments/$(whoami).scm" end @@ -49,11 +59,3 @@ end function edit-system echo "~/projects/code/scm/radix/ && $EDITOR operating-systems/$(hostname).scm" end - -function bang-dollar - string replace -ra '.* ' '' "$history[1]" -end - -function bang-star - string replace -ra ' [^ ]+$' '' "$history[1]" -end