2023-10-08 01:12:36 +00:00
|
|
|
function code-projects
|
|
|
|
string replace '@' '~/projects/code/' $argv[1]
|
|
|
|
end
|
2023-10-08 16:39:01 +00:00
|
|
|
|
2023-10-30 04:41:22 +00:00
|
|
|
function git-root
|
|
|
|
set -l result (git root 2>/dev/null) && \
|
|
|
|
echo $result || echo ""
|
|
|
|
end
|
|
|
|
|
2023-10-08 17:30:14 +00:00
|
|
|
function bookmarks
|
2023-10-13 17:43:54 +00:00
|
|
|
$EDITOR (string replace ':' '~/resources/bookmarks/' $argv[1])
|
2023-10-08 16:39:01 +00:00
|
|
|
end
|
2023-10-24 02:32:00 +00:00
|
|
|
|
2023-11-04 13:43:11 +00:00
|
|
|
function xdg-user-directory
|
2023-10-24 02:32:00 +00:00
|
|
|
switch (string replace '@' '' $argv[1])
|
|
|
|
case "desktop"
|
2023-11-04 13:43:11 +00:00
|
|
|
echo $XDG_DESKTOP_DIR
|
2023-10-24 02:32:00 +00:00
|
|
|
case "documents"
|
2023-11-04 13:43:11 +00:00
|
|
|
echo $XDG_DOCUMENTS_DIR
|
2023-10-24 02:32:00 +00:00
|
|
|
case "downloads"
|
2023-11-04 13:43:11 +00:00
|
|
|
echo $XDG_DOWNLOAD_DIR
|
2023-10-24 02:32:00 +00:00
|
|
|
case "music"
|
2023-11-04 13:43:11 +00:00
|
|
|
echo $XDG_MUSIC_DIR
|
2023-10-24 02:32:00 +00:00
|
|
|
case "pictures"
|
2023-11-04 13:43:11 +00:00
|
|
|
echo $XDG_PICTURES_DIR
|
2023-10-24 02:32:00 +00:00
|
|
|
case "public"
|
2023-11-04 13:43:11 +00:00
|
|
|
echo $XDG_PUBLICSHARE_DIR
|
2023-10-24 02:32:00 +00:00
|
|
|
case "templates"
|
2023-11-04 13:43:11 +00:00
|
|
|
echo $XDG_TEMPLATES_DIR
|
2023-10-24 02:32:00 +00:00
|
|
|
case "videos"
|
2023-11-04 13:43:11 +00:00
|
|
|
echo $XDG_VIDEOS_DIR
|
2023-10-24 02:32:00 +00:00
|
|
|
end
|
|
|
|
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])
|
2023-10-30 04:41:22 +00:00
|
|
|
set -l arr (string replace -ra ' ' '\n' $history[1])
|
2023-10-29 18:17:51 +00:00
|
|
|
echo $arr[$k]
|
|
|
|
end
|
|
|
|
|
|
|
|
function bang-dollar
|
|
|
|
string replace -ra '.* ' '' "$history[1]"
|
|
|
|
end
|
|
|
|
|
|
|
|
function bang-star
|
|
|
|
string replace -ra ' [^ ]+$' '' "$history[1]"
|
|
|
|
end
|