aboutsummaryrefslogtreecommitdiff
path: root/files
diff options
context:
space:
mode:
authorAnton Bobov <anton@bobov.name>2025-01-28 20:28:21 +0500
committerAnton Bobov <anton@bobov.name>2025-01-28 20:28:21 +0500
commit37b5415cb539af1f1f99c269fc425fcc729d03ab (patch)
tree4b4ffd39914d3e65d4493794fe6ffeb9452c2f44 /files
parent9506dfc7c56f22296e69d750b1262a2c82bcf252 (diff)
zsh: Update aliases
Diffstat (limited to 'files')
-rw-r--r--files/.zsh/rc/S40_completion3
-rw-r--r--files/.zsh/rc/S50_aliases9
-rw-r--r--files/.zsh/rc/S51_ledger25
3 files changed, 32 insertions, 5 deletions
diff --git a/files/.zsh/rc/S40_completion b/files/.zsh/rc/S40_completion
index 825dd0f..bb8784d 100644
--- a/files/.zsh/rc/S40_completion
+++ b/files/.zsh/rc/S40_completion
@@ -75,6 +75,9 @@ __load_or_generate docker-compose 'curl -sL "https://raw.githubusercontent.com/d
__load_or_generate watson 'curl -sL "https://raw.githubusercontent.com/TailorDev/Watson/master/watson.zsh-completion"'
__load_or_generate cheat 'curl -sL "https://raw.githubusercontent.com/cheat/cheat/master/scripts/cheat.zsh"'
__load_or_generate poetry "poetry completions zsh"
+__load_or_generate gmailctl "gmailctl completion zsh"
+__load_or_generate bat "bat --completion zsh"
+__load_or_generate git-absorb "git-absorb --gen-completions zsh"
compdef fdfind=fd
diff --git a/files/.zsh/rc/S50_aliases b/files/.zsh/rc/S50_aliases
index 6885879..59aa653 100644
--- a/files/.zsh/rc/S50_aliases
+++ b/files/.zsh/rc/S50_aliases
@@ -47,7 +47,7 @@ is_command aria2c && alias -s torrent="aria2c"
# Fix aliases
alias sudo='sudo '
-alias sudo-path='sudo env "PATH=$PATH"'
+alias sudo-path='sudo env "PATH=$PATH" '
alias watch='watch '
# Remove grml alias for ag
@@ -238,6 +238,13 @@ if is_command remind; then
for day in {1..9} ; do
alias $day="rem '*$day'"
done
+
+ remind-schedule() {
+ remind -@ "${@:-*7}" | grep -vEe '^(No reminders\.|)$'
+ }
+ rem-schedule() {
+ rem -@ "${@:-*7}" | grep -vEe '^(No reminders\.|)$'
+ }
fi
# }}}
diff --git a/files/.zsh/rc/S51_ledger b/files/.zsh/rc/S51_ledger
index 4d80a93..8dd986d 100644
--- a/files/.zsh/rc/S51_ledger
+++ b/files/.zsh/rc/S51_ledger
@@ -44,10 +44,27 @@ lx() {
}
budgets() {
- first_day_of_current_month=$(date +%Y%m01)
- seq 0 24 | xargs -I{} date -d "$first_day_of_current_month - {} months" +%Y-%m | \
- fzf --reverse --preview-window 90% --preview 'ledger budget --force-color -p {} --exchange R ^Expenses and not ^Expenses:Cash'
- }
+ (
+ start_year=2013
+ start_month=11
+
+ end_year=$(date +%Y)
+ end_month=$(date +%m)
+
+ for year in $(seq "$start_year" "$end_year"); do
+ [ "$year" = "$start_year" ] && s_month="$start_month" || s_month=1
+ [ "$year" = "$end_year" ] && e_month="$end_month" || e_month=12
+
+ for month in $(seq "$s_month" "$e_month"); do
+ printf "%d-%02d\n" "$year" "$month"
+ done
+ done
+ ) | sort -r | fzf \
+ --reverse \
+ --exact \
+ --preview-window 90% \
+ --preview 'ledger budget --force-color -p {} --exchange R ^Expenses and not ^Expenses:Cash'
+}
expenses() {
account=$(ledger accounts -p 'last 6 months' '^Assets:' | fzf)