commit 959d66ea7432aff707ab2d4dca670629c32f9b80
parent 281b86bd8f32226d19454c182567a3cfe8395647
Author: Milutin Popovic <milutin@popovic.xyz>
Date: Thu, 26 Feb 2026 13:59:24 +0000
mutt configuration
Diffstat:
9 files changed, 79 insertions(+), 25 deletions(-)
diff --git a/.config/mutt/accounts/1-milutin@popovic.xyz.muttrc b/.config/mutt/accounts/1-milutin@popovic.xyz.muttrc
@@ -16,9 +16,6 @@ bind index,pager M noop
bind index,pager C noop
bind index gg first-entry
macro index o "<shell-escape>mw -y milutin@popovic.xyz<enter>" "run mbsync to sync milutin@popovic.xyz"
-unmailboxes *
-
-mailboxes "=INBOX" "=Archive" "=Sent" "=Drafts" "=Trash"
set spoolfile = "+INBOX" # mw-autogenerated
set postponed = "+Drafts" # mw-autogenerated
@@ -37,6 +34,10 @@ macro index,pager gd "<change-folder>=Drafts<enter>" "go to drafts" # mw-autogen
macro index,pager Md ";<save-message>=Drafts<enter>" "move mail to drafts" # mw-autogenerated
macro index,pager Cd ";<copy-message>=Drafts<enter>" "copy mail to drafts" # mw-autogenerated
+macro index,pager gj "<change-folder>=Junk<enter>" "go to junk" # mw-autogenerated
+macro index,pager Mj ";<save-message>=Junk<enter>" "move mail to junk" # mw-autogenerated
+macro index,pager Cj ";<copy-message>=Junk<enter>" "copy mail to junk" # mw-autogenerated
+
macro index,pager gs "<change-folder>=Sent<enter>" "go to sent" # mw-autogenerated
macro index,pager Ms ";<save-message>=Sent<enter>" "move mail to sent" # mw-autogenerated
macro index,pager Cs ";<copy-message>=Sent<enter>" "copy mail to sent" # mw-autogenerated
diff --git a/.config/mutt/accounts/2-mika@popovic.xyz.muttrc b/.config/mutt/accounts/2-mika@popovic.xyz.muttrc
@@ -16,9 +16,6 @@ bind index,pager M noop
bind index,pager C noop
bind index gg first-entry
macro index o "<shell-escape>mw -y mika@popovic.xyz<enter>" "run mbsync to sync mika@popovic.xyz"
-unmailboxes *
-
-mailboxes "=INBOX" "=Archive" "=Sent" "=Drafts" "=Trash"
set spoolfile = "+INBOX" # mw-autogenerated
set postponed = "+Drafts" # mw-autogenerated
@@ -41,6 +38,10 @@ macro index,pager gs "<change-folder>=Sent<enter>" "go to sent" # mw-autogenerat
macro index,pager Ms ";<save-message>=Sent<enter>" "move mail to sent" # mw-autogenerated
macro index,pager Cs ";<copy-message>=Sent<enter>" "copy mail to sent" # mw-autogenerated
+macro index,pager gj "<change-folder>=Junk<enter>" "go to junk" # mw-autogenerated
+macro index,pager Mj ";<save-message>=Junk<enter>" "move mail to junk" # mw-autogenerated
+macro index,pager Cj ";<copy-message>=Junk<enter>" "copy mail to junk" # mw-autogenerated
+
macro index,pager gt "<change-folder>=Trash<enter>" "go to trash" # mw-autogenerated
macro index,pager Mt ";<save-message>=Trash<enter>" "move mail to trash" # mw-autogenerated
macro index,pager Ct ";<copy-message>=Trash<enter>" "copy mail to trash" # mw-autogenerated
diff --git a/.config/mutt/accounts/3-a11807930@unet.univie.ac.at.muttrc b/.config/mutt/accounts/3-a11807930@unet.univie.ac.at.muttrc
@@ -16,9 +16,6 @@ bind index,pager M noop
bind index,pager C noop
bind index gg first-entry
macro index o "<shell-escape>mw -y a11807930@unet.univie.ac.at<enter>" "run mbsync to sync a11807930@unet.univie.ac.at"
-unmailboxes *
-
-mailboxes "=INBOX" "=Archive" "=Sent" "=Drafts" "=Trash"
set spoolfile = "+INBOX" # mw-autogenerated
set postponed = "+Drafts" # mw-autogenerated
@@ -42,6 +39,10 @@ macro index,pager ga "<change-folder>=Archive<enter>" "go to inbox" # mw-autogen
macro index,pager Ma ";<save-message>=Archive<enter>" "move mail to inbox" # mw-autogenerated
macro index,pager Ca ";<copy-message>=Archive<enter>" "copy mail to inbox" # mw-autogenerated
+macro index,pager gj "<change-folder>=Junk<enter>" "go to junk" # mw-autogenerated
+macro index,pager Mj ";<save-message>=Junk<enter>" "move mail to junk" # mw-autogenerated
+macro index,pager Cj ";<copy-message>=Junk<enter>" "copy mail to junk" # mw-autogenerated
+
macro index,pager gi "<change-folder>=INBOX<enter>" "go to inbox" # mw-autogenerated
macro index,pager Mi ";<save-message>=INBOX<enter>" "move mail to inbox" # mw-autogenerated
macro index,pager Ci ";<copy-message>=INBOX<enter>" "copy mail to inbox" # mw-autogenerated
diff --git a/.config/mutt/accounts/4-milutin@ponnect.rs.muttrc b/.config/mutt/accounts/4-milutin@ponnect.rs.muttrc
@@ -15,10 +15,7 @@ bind index,pager g noop
bind index,pager M noop
bind index,pager C noop
bind index gg first-entry
-macro index o "<shell-escape>mw -y milutin@ponnect.rs<enter>" "run mbsync to sync milutin@ponnect.rs
-unmailboxes *
-
-mailboxes "=INBOX" "=Archive" "=Sent" "=Drafts" "=Trash"
+macro index o "<shell-escape>mw -y milutin@ponnect.rs<enter>" "run mbsync to sync milutin@ponnect.rs"
set spoolfile = "+INBOX" # mw-autogenerated
set postponed = "+Drafts" # mw-autogenerated
@@ -41,6 +38,10 @@ macro index,pager gs "<change-folder>=Sent<enter>" "go to sent" # mw-autogenerat
macro index,pager Ms ";<save-message>=Sent<enter>" "move mail to sent" # mw-autogenerated
macro index,pager Cs ";<copy-message>=Sent<enter>" "copy mail to sent" # mw-autogenerated
+macro index,pager gj "<change-folder>=Junk<enter>" "go to junk" # mw-autogenerated
+macro index,pager Mj ";<save-message>=Junk<enter>" "move mail to junk" # mw-autogenerated
+macro index,pager Cj ";<copy-message>=Junk<enter>" "copy mail to junk" # mw-autogenerated
+
macro index,pager gt "<change-folder>=Trash<enter>" "go to trash" # mw-autogenerated
macro index,pager Mt ";<save-message>=Trash<enter>" "move mail to trash" # mw-autogenerated
macro index,pager Ct ";<copy-message>=Trash<enter>" "copy mail to trash" # mw-autogenerated
diff --git a/.config/mutt/accounts/5-info@ponnect.rs.muttrc b/.config/mutt/accounts/5-info@ponnect.rs.muttrc
@@ -15,10 +15,7 @@ bind index,pager g noop
bind index,pager M noop
bind index,pager C noop
bind index gg first-entry
-macro index o "<shell-escape>mw -y info@ponnect.rs<enter>" "run mbsync to sync info@ponnect.rs
-unmailboxes *
-
-mailboxes "=INBOX" "=Archive" "=Sent" "=Drafts" "=Trash"
+macro index o "<shell-escape>mw -y info@ponnect.rs<enter>" "run mbsync to sync info@ponnect.rs"
set spoolfile = "+INBOX" # mw-autogenerated
set postponed = "+Drafts" # mw-autogenerated
@@ -41,6 +38,10 @@ macro index,pager gs "<change-folder>=Sent<enter>" "go to sent" # mw-autogenerat
macro index,pager Ms ";<save-message>=Sent<enter>" "move mail to sent" # mw-autogenerated
macro index,pager Cs ";<copy-message>=Sent<enter>" "copy mail to sent" # mw-autogenerated
+macro index,pager gj "<change-folder>=Junk<enter>" "go to junk" # mw-autogenerated
+macro index,pager Mj ";<save-message>=Junk<enter>" "move mail to junk" # mw-autogenerated
+macro index,pager Cj ";<copy-message>=Junk<enter>" "copy mail to junk" # mw-autogenerated
+
macro index,pager gt "<change-folder>=Trash<enter>" "go to trash" # mw-autogenerated
macro index,pager Mt ";<save-message>=Trash<enter>" "move mail to trash" # mw-autogenerated
macro index,pager Ct ";<copy-message>=Trash<enter>" "copy mail to trash" # mw-autogenerated
diff --git a/.config/mutt/general.muttrc b/.config/mutt/general.muttrc
@@ -78,7 +78,7 @@ macro index A "<limit>all\n" "show all messages (undo limit)"
# Sidebar mappings
set sidebar_visible = yes
-set sidebar_width = 20
+set sidebar_width = 30
set sidebar_short_path = yes
set sidebar_next_new_wrap = yes
set mail_check_stats
diff --git a/.config/mutt/muttrc b/.config/mutt/muttrc
@@ -4,17 +4,25 @@ source /home/mika/.config/mutt/general.muttrc
set new_mail_command="notify-send 'New Email' '%n new messages, %u unread.' &"
source /home/mika/.config/mutt/accounts/1-milutin@popovic.xyz.muttrc # mw-autogenerated
-macro index,pager i1 '<sync-mailbox><enter-command>source /home/mika/.config/mutt/accounts/1-milutin@popovic.xyz.muttrc<enter><change-folder>!<enter>;<check-stats>' "switch to milutin@popovic.xyz"
+macro index,pager i1 '<sync-mailbox><enter-command>source /home/mika/.config/mutt/accounts/1-milutin@popovic.xyz.muttrc<enter><enter-command>source ~/.config/mutt/mailboxes<enter><change-folder>!<enter>;<check-stats>' "switch to milutin@popovic.xyz"
#source /home/mika/.config/mutt/accounts/2-mika@popovic.xyz.muttrc # mw-autogenerated
-macro index,pager i2 '<sync-mailbox><enter-command>source /home/mika/.config/mutt/accounts/2-mika@popovic.xyz.muttrc<enter><change-folder>!<enter>;<check-stats>' "switch to mika@popovic.xyz"
+macro index,pager i2 '<sync-mailbox><enter-command>source /home/mika/.config/mutt/accounts/2-mika@popovic.xyz.muttrc<enter><enter-command>source ~/.config/mutt/mailboxes<enter><change-folder>!<enter>;<check-stats>' "switch to mika@popovic.xyz"
-macro index,pager i3 '<sync-mailbox><enter-command>source /home/mika/.config/mutt/accounts/3-a11807930@unet.univie.ac.at.muttrc<enter><change-folder>!<enter>;<check-stats>' "switch to a11807930@unet.univie.ac.at"
+macro index,pager i3 '<sync-mailbox><enter-command>source /home/mika/.config/mutt/accounts/3-a11807930@unet.univie.ac.at.muttrc<enter><enter-command>source ~/.config/mutt/mailboxes<enter><change-folder>!<enter>;<check-stats>' "switch to a11807930@unet.univie.ac.at"
-macro index,pager i4 '<sync-mailbox><enter-command>source /home/mika/.config/mutt/accounts/4-milutin@ponnect.rs.muttrc<enter><change-folder>!<enter>;<check-stats>' "switch to milutin@ponnect.rs"
+macro index,pager i4 '<sync-mailbox><enter-command>source /home/mika/.config/mutt/accounts/4-milutin@ponnect.rs.muttrc<enter><enter-command>source ~/.config/mutt/mailboxes<enter><change-folder>!<enter>;<check-stats>' "switch to milutin@ponnect.rs"
-macro index,pager i5 '<sync-mailbox><enter-command>source /home/mika/.config/mutt/accounts/5-info@ponnect.rs.muttrc<enter><change-folder>!<enter>;<check-stats>' "switch to info@ponnect.rs"
+macro index,pager i5 '<sync-mailbox><enter-command>source /home/mika/.config/mutt/accounts/5-info@ponnect.rs.muttrc<enter><enter-command>source ~/.config/mutt/mailboxes<enter><change-folder>!<enter>;<check-stats>' "switch to info@ponnect.rs"
-macro index,pager i6 '<sync-mailbox><enter-command>source /home/mika/.config/mutt/accounts/6-milutin@oari.io.muttrc<enter><change-folder>!<enter>;<check-stats>' "switch to milutin@oari.io"
+macro index,pager i6 '<sync-mailbox><enter-command>source /home/mika/.config/mutt/accounts/6-milutin@oari.io.muttrc<enter><enter-command>source ~/.config/mutt/mailboxes<enter><change-folder>!<enter>;<check-stats>' "switch to milutin@oari.io"
set signature = $XDG_CONFIG_HOME/mutt/signature
+
+# Source auto-discovered mailboxes so that all accounts always appear in the
+# sidebar regardless of which account is currently active.
+# The file is generated by mutt-mailboxes (see ~/.local/bin/mutt-mailboxes).
+source ~/.config/mutt/mailboxes
+
+# Ctrl+B: regenerate mailbox list from Maildir and reload into sidebar.
+macro index,pager \Cb '<enter-command>echo "Refreshing mailbox list..."<enter><shell-escape>mutt-mailboxes<enter><enter-command>source ~/.config/mutt/mailboxes<enter><enter-command>echo "Mailbox list refreshed."<enter>' "regenerate mailbox list from Maildir"
diff --git a/.config/nvim/lua/config/autocmd.lua b/.config/nvim/lua/config/autocmd.lua
@@ -54,7 +54,7 @@ autocmd({'BufWritePre'}, {
end,
})
--- Convert two spaces to tabs in router folder
+-- Convert tabs to two spaces on buf enter
autocmd({'BufEnter'}, {
pattern = '*/router/*',
callback = function()
@@ -62,6 +62,13 @@ autocmd({'BufEnter'}, {
end,
})
+-- Convert double qotes to single qotes on save
+autocmd({'BufWritePre'}, {
+ pattern = '*/router/*',
+ callback = function()
+ vim.cmd([[%s/"/'/ge]])
+ end,
+})
diff --git a/.local/bin/scripts/mutt-mailboxes b/.local/bin/scripts/mutt-mailboxes
@@ -0,0 +1,34 @@
+#!/bin/sh
+# mutt-mailboxes: Auto-discover Maildir mailboxes and generate neomutt sidebar config.
+MAIL_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/mail"
+OUT_FILE="${XDG_CONFIG_HOME:-$HOME/.config}/mutt/mailboxes"
+
+cat > "$OUT_FILE" << 'EOF'
+# vim: filetype=neomuttrc
+# Auto-generated by mutt-mailboxes — do not edit manually.
+# Re-run: mutt-mailboxes
+# In mutt: press Ctrl+B to regenerate and reload.
+EOF
+
+[ -d "$MAIL_DIR" ] || exit 0
+
+# Sort accounts for a stable order across re-sources
+for account_dir in $(find "$MAIL_DIR" -mindepth 1 -maxdepth 1 -type d | sort); do
+ account=$(basename "$account_dir")
+
+ # ── Account separator label ──────────────────────────────────────────────
+ # Points to INBOX so it's a valid path; the label acts as a visual header.
+ inbox="${account_dir}/INBOX"
+ printf '\n' >> "$OUT_FILE"
+ printf 'named-mailboxes "--- %s ---" "%s"\n' \
+ "$account" "$inbox" >> "$OUT_FILE"
+
+ for folder_dir in $(find "$account_dir" -mindepth 1 -maxdepth 1 -type d | sort); do
+ folder=$(basename "$folder_dir")
+ [ "$folder" = "INBOX" ] && continue # already added above
+ # Only include real Maildir dirs (have cur/ and new/)
+ [ -d "$folder_dir/cur" ] && [ -d "$folder_dir/new" ] || continue
+ printf 'named-mailboxes "%s" "%s"\n' \
+ "$folder" "$folder_dir" >> "$OUT_FILE"
+ done
+done