diff options
| author | Arpit Chakladar <arpitchakladar@gmail.com> | 2026-09-18 05:34:13 +0530 |
|---|---|---|
| committer | Arpit Chakladar <arpitchakladar@gmail.com> | 2026-09-18 05:34:13 +0530 |
| commit | 9e5e6a6965af6843bba27fab8723bb416ecdceab (patch) | |
| tree | 3c1eec0a7c3186d13472219f0ee26a61d3d443c2 /modules/communication/neomutt/neomutt-sync.zsh | |
| parent | a6e6c259b30c0e3f8d7e26ee71efe2cb921e037c (diff) | |
| download | home-manager-config-9e5e6a6965af6843bba27fab8723bb416ecdceab.tar.gz home-manager-config-9e5e6a6965af6843bba27fab8723bb416ecdceab.zip | |
feat(communication/neomutt): added auto completions for neomutt-sync
Diffstat (limited to 'modules/communication/neomutt/neomutt-sync.zsh')
| -rw-r--r-- | modules/communication/neomutt/neomutt-sync.zsh | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/modules/communication/neomutt/neomutt-sync.zsh b/modules/communication/neomutt/neomutt-sync.zsh new file mode 100644 index 0000000..03c092a --- /dev/null +++ b/modules/communication/neomutt/neomutt-sync.zsh @@ -0,0 +1,21 @@ +#compdef neomutt-sync +# Zsh completion for the neomutt-sync command. +# Completes mbsync channel names parsed from the mbsyncrc +# (defaults to ~/.config/mbsync/.mbsyncrc, overridable via MBSYNCRC). + +_arguments '1: :->channel' + +case $state in + channel) + local mbsyncrc="${MBSYNCRC:-$HOME/.config/mbsync/.mbsyncrc}" + local -a channels + while IFS= read -r channel; do + case $channel in + *-quick) channels+=("$channel:Quick sync of INBOX only (new mail); run from the neomutt gs macro") ;; + *-full) channels+=("$channel:Full two-way sync of all folders (slow); for scheduled runs") ;; + *) channels+=("$channel") ;; + esac + done < <(grep -oP '^Channel\s+\K\S+' "$mbsyncrc" 2>/dev/null | sort -u) + _describe 'channel' channels + ;; +esac |
