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 <noreply@anthropic.com>
main
Amir Alexander Abdelbaki 2026-05-26 13:12:25 +02:00
parent 9db080dc0f
commit 85e810d70b
2 changed files with 23 additions and 14 deletions

View File

@ -229,27 +229,26 @@ local function toggle_pim()
return
end
-- full-screen: alot left, abook top-right, calendar bottom-right
local H = vim.o.lines - 2
local col_w = math.min(vim.o.columns, math.max(90, math.floor(vim.o.columns * 0.45)))
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

View File

@ -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 ───────────────────────────────────────────