2023-11-04 13:43:11 +00:00
|
|
|
function xdg-user-directory
|
2024-02-06 19:09:56 +00:00
|
|
|
string replace '@' '' \
|
|
|
|
(string join '' '$XDG_' (string upper $argv[1]) '_DIR')
|
2023-10-24 02:32:00 +00:00
|
|
|
end
|
2023-10-29 18:17:51 +00:00
|
|
|
|
|
|
|
function bang-bang
|
|
|
|
echo "$history[1]"
|
|
|
|
end
|
|
|
|
|
|
|
|
function bang-bang-k
|
|
|
|
set -l k (string replace '!!:' '' $argv[1])
|
2024-01-30 00:21:07 +00:00
|
|
|
set -l arr (string replace -ra '([^\\\ ])( |\n)+' '$1\n' $history[1])
|
2023-10-29 18:17:51 +00:00
|
|
|
echo $arr[$k]
|
|
|
|
end
|
|
|
|
|
2024-01-30 00:21:07 +00:00
|
|
|
function bang-dollar
|
|
|
|
set -l arr (string replace -ra '([^\\\ ])( |\n)+' '$1\n' $history[1])
|
|
|
|
echo $arr[-1]
|
2023-12-30 20:49:07 +00:00
|
|
|
end
|
|
|
|
|
2024-01-30 00:21:07 +00:00
|
|
|
function bang-star
|
|
|
|
set -l arr (string replace -ra '([^\\\ ])( |\n)+' '$1\n' $history[1])
|
|
|
|
echo $arr[..-2]
|
2023-12-30 20:12:51 +00:00
|
|
|
end
|