summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlistout <listout@protonmail.com>2021-04-13 12:13:13 +0530
committerlistout <listout@protonmail.com>2021-04-13 12:13:13 +0530
commitf62084a6929e7b7b8080a4ccd8e5b2c2380c9626 (patch)
tree0e0017dec85b3df39533ae678e5af5c6417109f1
parent0a3184fbba18c02e534a6125c8643efc283747ae (diff)
neomutt configs
-rw-r--r--.config/neomutt/gmail_main38
-rw-r--r--.config/neomutt/gmail_work21
-rw-r--r--.config/neomutt/mailcap10
-rw-r--r--.config/neomutt/mappings59
-rw-r--r--.config/neomutt/neomuttrc42
5 files changed, 170 insertions, 0 deletions
diff --git a/.config/neomutt/gmail_main b/.config/neomutt/gmail_main
new file mode 100644
index 0000000..5447d8d
--- /dev/null
+++ b/.config/neomutt/gmail_main
@@ -0,0 +1,38 @@
+# vim: set ft=muttrc:
+source "gpg -dq $HOME/Nextcloud/keepass_database/mutt_pass.gpg |"
+
+## Receive options
+set imap_pass=$my_pass
+set imap_user=$my_userName@gmail.com
+set folder=imaps://$my_userName@imap.gmail.com/
+set spoolfile=+INBOX
+mailboxes imaps://imap.gmail.com/INBOX
+
+# store message header locally
+set header_cache=~/.cache/neomutt
+
+# store messages locally to speed things up
+set message_cachedir="~/.cache/neomutt"
+
+# specify where to save and/or look for postponded messages
+set postponed=+[Gmail]/Drafts
+
+# allow mutt to open a new IMAP connection autmatically
+unset imap_passive
+
+# keep imap connection alive by polling intermittently
+set imap_keepalive=300
+
+# how often to check check for new email
+set mail_check=120
+
+# gmail automatically saves sent emails, so we avoid duplicates
+unset record
+
+## Send options
+set smtp_url=smtps://$my_userName:$my_pass@smtp.gmail.com
+set from=$my_userName@gmail.com
+set hostname="gmail.com"
+
+## Hook
+account-hook $folder "set imap_user=$my_userName@gmail.com imap_pass=$my_pass"
diff --git a/.config/neomutt/gmail_work b/.config/neomutt/gmail_work
new file mode 100644
index 0000000..e9be317
--- /dev/null
+++ b/.config/neomutt/gmail_work
@@ -0,0 +1,21 @@
+source "gpg -dq $HOME/Nextcloud/keepass_database/mutt_work.gpg |"
+
+## Receive Option
+set imap_user=$my_userName@gmail.com
+set imap_pass=$my_pass
+set folder=imaps://$my_userName@imap.gmail.com/
+set spoolfile=+INBOX
+unset record
+set postponed="+[Gmail]/Drafts"
+
+## Send Option
+set smtp_url=smtps://$my_userName:$my_pass@smtp.gmail.com
+set from=$my_userName@gmail.com
+set hostname="gmail.com"
+# Connection options
+set ssl_force_tls=yes
+unset ssl_starttls
+
+## Hook
+account-hook $folder "set imap_user=$my_userName@gmail.com imap_pass=$my_pass"
+# vim:ft=muttrc
diff --git a/.config/neomutt/mailcap b/.config/neomutt/mailcap
new file mode 100644
index 0000000..dbb63f1
--- /dev/null
+++ b/.config/neomutt/mailcap
@@ -0,0 +1,10 @@
+# HTML
+text/html; /usr/bin/w3m -I %{charset} -T text/html; copiousoutput;
+text/plain; nvim %s
+
+#Images
+image/png; /usr/bin/feh %s
+image/jpeg; /usr/bin/feh %s
+
+#PDFs
+application/pdf; /usr/bin/evince %s &
diff --git a/.config/neomutt/mappings b/.config/neomutt/mappings
new file mode 100644
index 0000000..8275875
--- /dev/null
+++ b/.config/neomutt/mappings
@@ -0,0 +1,59 @@
+# vim: filetype=muttrc
+
+# General rebindings
+bind attach <return> view-mailcap
+bind attach l view-mailcap
+bind editor <space> noop
+bind pager c imap-fetch-mail
+bind index G last-entry
+bind index g noop
+bind index gg first-entry
+bind pager,attach h exit
+bind pager j next-line
+bind pager k previous-line
+bind pager l view-attachments
+bind index D delete-message
+bind index U undelete-message
+bind index L limit
+bind index h noop
+bind index l display-message
+bind browser h goto-parent
+bind browser l select-entry
+bind pager,browser gg top-page
+bind pager,browser G bottom-page
+bind index,pager,browser d half-down
+bind index,pager,browser u half-up
+bind index,pager R group-reply
+bind index \031 previous-undeleted # Mouse wheel
+bind index \005 next-undeleted # Mouse wheel
+bind pager \031 previous-line # Mouse wheel
+bind pager \005 next-line # Mouse wheel
+bind editor <Tab> complete-query
+bind index,pager B sidebar-toggle-visible
+
+# sidebar mappings
+bind index,pager \Ck sidebar-prev
+bind index,pager \Cj sidebar-next
+bind index,pager \Co sidebar-open
+bind index,pager \Cp sidebar-prev-new
+bind index,pager \Cn sidebar-next-new
+bind index,pager B sidebar-toggle-visible
+
+# global index and pager shortcuts
+bind index,pager @ compose-to-sender
+bind index,pager D purge-message
+bind index <tab> sync-mailbox
+bind index <space> collapse-thread
+
+# Email completion bindings
+bind editor <Tab> complete-query
+bind editor ^T complete
+
+# Press A to add contact to Khard address book
+macro index,pager A \
+ "<pipe-message>khard add-email<return>" \
+ "add the sender email address to khard"
+
+# use markdown in email, esc then 5
+macro compose \e5 "F pandoc -s -f markdown -t html \ny^T^Utext/html; charset=utf-8\n"
+set wait_key=no
diff --git a/.config/neomutt/neomuttrc b/.config/neomutt/neomuttrc
new file mode 100644
index 0000000..71cbdbf
--- /dev/null
+++ b/.config/neomutt/neomuttrc
@@ -0,0 +1,42 @@
+# vim: set ft=muttrc:
+set editor="/usr/bin/nvim"
+
+set sendmail="/usr/bin/msmtp"
+
+# keybindings
+source "~/.config/neomutt/mappings"
+
+set send_charset="utf-8"
+
+# connection information
+set ssl_force_tls=yes
+unset ssl_starttls
+
+# status bar, date format, finding stuff etc.
+set status_chars = " *%A"
+set status_format = "[ Folder: %f ] [%r%m messages%?n? (%n new)?%?d? (%d to delete)?%?t? (%t tagged)? ]%>─%?p?( %p postponed )?"
+set date_format = "%d.%m.%Y %H:%M"
+set sort = threads
+set sort_aux = reverse-last-date-received
+set uncollapse_jump
+set sort_re
+set reply_regexp = "^(([Rr][Ee]?(\[[0-9]+\])?: *)?(\[[^]]+\] *)?)*"
+set quote_regexp = "^( {0,4}[>|:#%]| {0,4}[a-z0-9]+[>|]+)+"
+set send_charset = "utf-8:iso-8859-1:us-ascii"
+set charset = "utf-8"
+set arrow_cursor = "no" # Change `color indicator` depending
+
+# mailcap
+set mailcap_path=~/.config/neomutt/mailcap
+
+## ACCOUNT 1
+source "~/.config/neomutt/gmail_main"
+folder-hook $folder 'source ~/.config/neomutt/gmail_main'
+
+## ACCOUNT 2
+source "~/.config/neomutt/gmail_work"
+folder-hook $folder 'source ~/.config/neomutt/gmail_work'
+
+## Shortcuts
+macro index,pager <f2> '<sync-mailbox><enter-command>source ~/.config/neomutt/gmail_main<enter><change-folder>!<enter>'
+macro index,pager <f3> '<sync-mailbox><enter-command>source ~/.config/neomutt/gmail_work<enter><change-folder>!<enter>'