From 9e5e6a6965af6843bba27fab8723bb416ecdceab Mon Sep 17 00:00:00 2001 From: Arpit Chakladar Date: Fri, 18 Sep 2026 05:34:13 +0530 Subject: feat(communication/neomutt): added auto completions for neomutt-sync --- modules/communication/neomutt/neomutt-sync.zsh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 modules/communication/neomutt/neomutt-sync.zsh (limited to 'modules/communication/neomutt/neomutt-sync.zsh') 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 -- cgit v1.2.3