summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile5
-rw-r--r--completion/_mutt-wizard.zsh45
-rw-r--r--share/mutt-wizard.muttrc1
3 files changed, 50 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 81b0c2e..a150447 100644
--- a/Makefile
+++ b/Makefile
@@ -34,10 +34,15 @@ install:
sed -iba 's:/usr/local:$(PREFIX):' $(DESTDIR)$(PREFIX)/share/mutt-wizard/mailcap; \
rm -f $(DESTDIR)$(PREFIX)/share/mutt-wizard/mailcapba; \
fi
+ mkdir -p $(DESTDIR)$(PREFIX)/share/zsh/site-functions/
+ chmod 755 $(DESTDIR)$(PREFIX)/share/zsh/site-functions/
+ cp -f completion/_mutt-wizard.zsh $(DESTDIR)$(PREFIX)/share/zsh/site-functions/_mutt-wizard.zsh
+ chmod 644 $(DESTDIR)$(PREFIX)/share/zsh/site-functions/_mutt-wizard.zsh
uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/mw $(DESTDIR)$(PREFIX)/bin/mailsync $(DESTDIR)$(PREFIX)/lib/mutt-wizard/openfile
rm -rf $(DESTDIR)$(PREFIX)/share/mutt-wizard $(DESTDIR)$(PREFIX)/lib/mutt-wizard
rm -f $(DESTDIR)$(MANPREFIX)/man1/mw.1 $(DESTDIR)$(MANPREFIX)/man1/mailsync.1
+ rm -f $(DESTDIR)$(PREFIX)/share/zsh/site-functions/_mutt-wizard.zsh
.PHONY: install uninstall
diff --git a/completion/_mutt-wizard.zsh b/completion/_mutt-wizard.zsh
new file mode 100644
index 0000000..18c3e2e
--- /dev/null
+++ b/completion/_mutt-wizard.zsh
@@ -0,0 +1,45 @@
+#compdef mw
+
+_arguments \
+ '1:flag:->flags' \
+ '*:: :->args'
+
+case "$state" in
+ flags)
+ local -a opts
+ opts=(
+ '-a:Add an email address'
+ '-l:List email addresses configured'
+ '-d:Remove an already added address'
+ '-D:Force remove account without confirmation'
+ '-y:Sync mail for account by name'
+ '-Y:Sync mail for all accounts'
+ '-t:Toggle automatic mailsync every <number> minutes'
+ '-T:Toggle automatic mailsync every 10 minutes'
+ '-r:order account numbers'
+ )
+ _describe 'flags' opts
+ ;;
+ args)
+ case $line[1] in
+ -a)
+ _alternative \
+ 'args: :((
+ -u\:"Account login name if not full address"
+ -n\:"Real name to be on the email account"
+ -i\:"IMAP/POP server address"
+ -I\:"IMAP/POP server port"
+ -s\:"SMTP server address"
+ -S\:"SMTP server port"
+ -x\:"Password for account (recommended to be in double quotes)"
+ -P\:"Pass Prefix (prefix of the file where password is stored)"
+ -p\:"Add for a POP server instead of IMAP."
+ -X\:"Delete an account'"'"'s local email too when deleting."
+ -o\:"Configure address, but keep mail online."
+ -f\:"Assume typical English mailboxes without attempting log-on."
+ ))'
+ ;;
+ -D|-y)
+ _values 'email list' $(mw -l | cut -f2) 2>/dev/null
+ esac
+esac
diff --git a/share/mutt-wizard.muttrc b/share/mutt-wizard.muttrc
index 21968d8..47d48c3 100644
--- a/share/mutt-wizard.muttrc
+++ b/share/mutt-wizard.muttrc
@@ -144,7 +144,6 @@ color sidebar_highlight red default
color sidebar_divider brightblack black
color sidebar_flagged red black
color sidebar_new green black
-color normal brightyellow default
color error red default
color tilde black default
color message cyan default