dotfiles

Cross platform dotfiles for linux, mac and windows

commit 37089116c513e3b10faa9b4a3415f4e0644e0606
parent 1ae5bb9139e291b20e4609372df12ea6a28da72d
Author: Bharatvaj Hemanth <bharatvaj@yahoo.com>
Date: Wed, 30 Jul 2025 12:24:17 +0000

Make mutt emulate vifm/vim

Enable QoL features in mutt ...

... - sort reverse-date, standard INBOX, fix trash in yahoo, etc
4 files changed, 52 insertions(+), 26 deletions(-)
M
.config/mutt/keybindings
|
63
+++++++++++++++++++++++++++++++++++++++++++++------------------
M
.config/mutt/muttrc
|
13
++++++-------
M
.config/mutt/ui
|
1
+
M
.config/sh/aliases
|
1
-
diff --git a/.config/mutt/keybindings b/.config/mutt/keybindings
@@ -20,27 +20,32 @@ 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 index,query <space> tag-entry
 #bind browser h goto-parent
 macro browser h '<change-dir><kill-line>..<enter>' "Go to parent folder"
 #bind index,pager H view-raw-message
 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,browser \Cd half-down
+bind index,pager,browser \Cu half-up
+
 bind index,pager S sync-mailbox
 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 pager \005 next-line		    # Mouse wheel
+
 bind editor <Tab> complete-query
 
 macro index S "<shell-escape>mbsync -c \"$XDG_CONFIG_HOME\"/isync/mbsyncrc -aV<enter>" "sync email"
-macro index,pager gi "<change-folder>=Inbox<enter>" "go to inbox"
+
+macro index,pager gi "<change-folder>=INBOX<enter>" "go to inbox"
 macro index,pager gd "<change-folder>=Drafts<enter>" "go to drafts"
 macro index,pager gj "<change-folder>=Junk<enter>" "go to junk"
 macro index,pager gt "<change-folder>=Trash<enter>" "go to trash"

@@ -49,22 +54,44 @@ macro index,pager gb "<change-folder>=Business<enter>" "go to Business"
 macro index,pager ga "<change-folder>=Archive<enter>" "go to archive"
 macro index,pager gf "<change-folder>=Friends<enter>" "go to Friends"
 macro index,pager gF "<change-folder>=Family<enter>" "go to Family"
-macro index,pager Mi ";<save-message>=Inbox<enter>" "move mail to inbox"
-macro index,pager Md ";<save-message>=Drafts<enter>" "move mail to drafts"
-macro index,pager Mj ";<save-message>=Junk<enter>" "move mail to junk"
-macro index,pager Mt ";<save-message>=Trash<enter>" "move mail to trash"
-macro index,pager Ms ";<save-message>=Sent<enter>" "move mail to sent"
-macro index,pager Mb ";<save-message>=Business<enter>" "move mail to Business"
-macro index,pager Ma ";<save-message>=Archive<enter>" "move mail to archive"
-macro index,pager Mg ";<save-message>=Google<enter>" "move mail to google"
-macro index,pager Mf ";<save-message>=Friends<enter>" "move mail to Friends"
-macro index,pager MF ";<save-message>=Family<enter>" "move mail to Family"
+
+macro index,pager M "<save-message>?" "move mail to selected folder"
+
+# macro index,pager Mi ";<save-message>=INBOX<enter>" "move mail to inbox"
+# macro index,pager Md ";<save-message>=Drafts<enter>" "move mail to drafts"
+# macro index,pager Mj ";<save-message>=Junk<enter>" "move mail to junk"
+# macro index,pager Mt ";<save-message>=Trash<enter>" "move mail to trash"
+# macro index,pager Ms ";<save-message>=Sent<enter>" "move mail to sent"
+# macro index,pager Mb ";<save-message>=Business<enter>" "move mail to Business"
+# macro index,pager Ma ";<save-message>=Archive<enter>" "move mail to archive"
+# macro index,pager Mg ";<save-message>=Google<enter>" "move mail to google"
+# macro index,pager Mf ";<save-message>=Friends<enter>" "move mail to Friends"
+# macro index,pager MF ";<save-message>=Family<enter>" "move mail to Family"
 
 # macro index,pager a "<enter-command>set my_pipe_decode=\$pipe_decode pipe_decode<return><pipe-message>abook --add-email<return><enter-command>set pipe_decode=\$my_pipe_decode; unset my_pipe_decode<return>" "add the sender address to abook"
 macro index \Cr "T~U<enter><tag-prefix><clear-flag>N<untag-pattern>.<enter>" "mark all messages as read"
 macro index O "<shell-escape>mw -Y<enter>" "run mw -Y to sync all mail"
+macro index h "c?"
 
-bind index,pager <Esc>k sidebar-prev
-bind index,pager <Esc>j sidebar-next
-bind index,pager <Esc>o sidebar-open
 bind index,pager <Esc>b sidebar-toggle-visible
+
+
+macro index <F8> \
+"<enter-command>set my_old_pipe_decode=\$pipe_decode my_old_wait_key=\$wait_key nopipe_decode nowait_key<enter>\
+<shell-escape>notmuch-mutt -r --prompt search<enter>\
+<change-folder-readonly>`echo ${XDG_CACHE_HOME:-$HOME/.cache}/notmuch/mutt/results`<enter>\
+<enter-command>set pipe_decode=\$my_old_pipe_decode wait_key=\$my_old_wait_key<enter>" \
+      "notmuch: search mail"
+
+macro index <F9> \
+"<enter-command>set my_old_pipe_decode=\$pipe_decode my_old_wait_key=\$wait_key nopipe_decode nowait_key<enter>\
+<pipe-message>notmuch-mutt -r thread<enter>\
+<change-folder-readonly>`echo ${XDG_CACHE_HOME:-$HOME/.cache}/notmuch/mutt/results`<enter>\
+<enter-command>set pipe_decode=\$my_old_pipe_decode wait_key=\$my_old_wait_key<enter>" \
+      "notmuch: reconstruct thread"
+
+macro index <F6> \
+"<enter-command>set my_old_pipe_decode=\$pipe_decode my_old_wait_key=\$wait_key nopipe_decode nowait_key<enter>\
+<pipe-message>notmuch-mutt tag -- -inbox<enter>\
+<enter-command>set pipe_decode=\$my_old_pipe_decode wait_key=\$my_old_wait_key<enter>" \
+      "notmuch: remove message from inbox"
diff --git a/.config/mutt/muttrc b/.config/mutt/muttrc
@@ -1,30 +1,29 @@
 set mbox_type = Maildir
 
 source ~/.local/share/mutt/accounts
-source ~/.local/share/mutt/mailboxes
 source ~/.config/mutt/keybindings
 source ~/.config/mutt/ui
 
-
 set header_cache = ~/.cache/mutt/headercache
 
 set imap_check_subscribed
 # mailbox settings
-set spoolfile = +
+set spoolfile = +INBOX
 set postponed = +Drafts
 set record = +Sent
-set trash = +Trash
 
 set auto_tag = yes
 
 auto_view text/html
-set mailcap_path = ~/.config/mutt/mailcap
-
 set mailcap_path = "~/.config/mutt/mailcap"
 set mime_type_query_command = "file --mime-type -b %s"
 set date_format="%y/%m/%d %I:%M%p"
 set index_format="%D %-15.15F %s (%-4.4c)"
-set sort = 'reverse-date'
+
+set strict_threads = yes
+set sort_aux = last-date-received
+set sort = reverse-threads
+
 set smtp_authenticators = 'gssapi:login'
 set rfc2047_parameters = yes
 set sleep_time = 0
diff --git a/.config/mutt/ui b/.config/mutt/ui
@@ -42,6 +42,7 @@ color signature lightmagenta default
 color bold black default
 color underline black default
 color normal default default
+color index brightred black ~D
 
 # Regex highlighting:
 color header blue default ".*"
diff --git a/.config/sh/aliases b/.config/sh/aliases
@@ -2,7 +2,6 @@
 alias abook='abook --config "$XDG_CONFIG_HOME"/abook/abookrc --datafile "$XDG_DATA_HOME"/abook/addressbook'
 alias abook='abook -C "$XDG_CONFIG_HOME"/abook/abookrc --datafile "$XDG_DATA_HOME"/abook/addressbook'
 alias dict='dict -c "$XDG_CONFIG_HOME"/dict/dictrc'
-there mbsync && alias mbsync='mbsync -c "$XDG_CONFIG_HOME"/isync/mbsyncrc'
 alias startx='startx "$XDG_CONFIG_HOME/X11/xinitrc" vt1'
 alias wget='wget --hsts-file="$XDG_CACHE_HOME/wget-hsts"'