From 85e810d70b84e542e0426f8d2dd940cc53267fcb Mon Sep 17 00:00:00 2001 From: The_miro Date: Tue, 26 May 2026 13:12:25 +0200 Subject: [PATCH] feat(nvim,alot): full-screen PIM layout + alot Esc bindings - x now opens a full-screen overlay: alot left (55%), abook top-right, calendar bottom-right - Add esc = exit bindings to alot config for search/thread/taglist/ bufferlist modes, applied to live ~/.config/alot/config and to the mail-notmuch.sh setup script Co-Authored-By: Claude Sonnet 4.6 --- nvim/init.lua | 27 +++++++++---------- .../optional-Modules/apps/mail-notmuch.sh | 10 +++++++ 2 files changed, 23 insertions(+), 14 deletions(-) diff --git a/nvim/init.lua b/nvim/init.lua index 1131c03..26f32c6 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -229,27 +229,26 @@ local function toggle_pim() return end - local H = vim.o.lines - 2 - local col_w = math.min(vim.o.columns, math.max(90, math.floor(vim.o.columns * 0.45))) + -- full-screen: alot left, abook top-right, calendar bottom-right + local H = vim.o.lines - 2 + local W = vim.o.columns + local left_w = math.max(1, math.floor(W * 0.55)) + local right_w = math.max(1, W - left_w) + local top_h = math.max(1, math.floor(H / 2)) + local bot_h = math.max(1, H - top_h) - -- abook gets a fixed 24-line minimum; mail/calendar split the rest 57/43 - local ab_h = math.max(24, math.floor(H * 0.30)) - local rest = math.max(2, H - ab_h) - local mail_h = math.max(1, math.floor(rest * 0.57)) - local cal_h = math.max(1, rest - mail_h) - - local w1 = _pim_float(0, 0, mail_h, col_w) + local w1 = _pim_float(0, 0, H, left_w) local ok, err = pcall(vim.cmd, "terminal alot") if not ok then _pim_scratch("alot", err) end - local w2 = _pim_float(mail_h, 0, cal_h, col_w) - ok, err = pcall(vim.cmd, "Calendar -position=here") - if not ok then _pim_scratch("calendar.vim", err) end - - local w3 = _pim_float(mail_h + cal_h, 0, ab_h, col_w) + local w2 = _pim_float(0, left_w, top_h, right_w) ok, err = pcall(vim.cmd, "terminal abook") if not ok then _pim_scratch("abook", err) end + local w3 = _pim_float(top_h, left_w, bot_h, right_w) + ok, err = pcall(vim.cmd, "Calendar -position=here") + if not ok then _pim_scratch("calendar.vim", err) end + _pim_wins = { w1, w2, w3 } vim.api.nvim_set_current_win(w1) end diff --git a/setup/modules/optional-Modules/apps/mail-notmuch.sh b/setup/modules/optional-Modules/apps/mail-notmuch.sh index 4d59c78..2668631 100755 --- a/setup/modules/optional-Modules/apps/mail-notmuch.sh +++ b/setup/modules/optional-Modules/apps/mail-notmuch.sh @@ -97,6 +97,16 @@ cat > ~/.config/alot/config << EOF sendmail_command = msmtp -a main sent_box = maildir://$MAILDIR/Sent draft_box = maildir://$MAILDIR/Drafts + +[bindings] + [[search]] + esc = exit + [[thread]] + esc = exit + [[taglist]] + esc = exit + [[bufferlist]] + esc = exit EOF # ── systemd timer for periodic sync ───────────────────────────────────────────