From e6d62b9db712dca0d4df42f330b09706d6ea3c53 Mon Sep 17 00:00:00 2001 From: dogeystamp Date: Fri, 5 May 2023 22:59:36 -0400 Subject: [PATCH] fish: add aliases for accessing problem files --- src/.config/fish/aliases.fish | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/.config/fish/aliases.fish b/src/.config/fish/aliases.fish index 1b7d25b..f88cb6c 100644 --- a/src/.config/fish/aliases.fish +++ b/src/.config/fish/aliases.fish @@ -40,3 +40,18 @@ function musrec http --form POST "https://api.audd.io?api_token=$(cat ~/.config/audd_token)" file@$argv end end + +# problem solving +# --------------- +# use abbreviations instead of aliases/functions because +# this allows retrieving the files accessed from history +# instead of (basename (xsel -b)) + +function prob_typ; echo $EDITOR (basename (xsel -b)).typ; end +abbr -a typ --function prob_typ +function prob_cpp; echo $EDITOR src/(basename (xsel -b)).cpp; end +abbr -a cpp --function prob_cpp +function prob_py; echo $EDITOR src/(basename (xsel -b)).py; end +abbr -a py --function prob_py +function prob_pdf; echo zathura (basename (xsel -b)).pdf; end +abbr -a pdf --function prob_pdf