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
parent
9db080dc0f
commit
85e810d70b
|
|
@ -229,27 +229,26 @@ local function toggle_pim()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local H = vim.o.lines - 2
|
-- full-screen: alot left, abook top-right, calendar bottom-right
|
||||||
local col_w = math.min(vim.o.columns, math.max(90, math.floor(vim.o.columns * 0.45)))
|
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 w1 = _pim_float(0, 0, H, left_w)
|
||||||
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 ok, err = pcall(vim.cmd, "terminal alot")
|
local ok, err = pcall(vim.cmd, "terminal alot")
|
||||||
if not ok then _pim_scratch("alot", err) end
|
if not ok then _pim_scratch("alot", err) end
|
||||||
|
|
||||||
local w2 = _pim_float(mail_h, 0, cal_h, col_w)
|
local w2 = _pim_float(0, left_w, top_h, right_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)
|
|
||||||
ok, err = pcall(vim.cmd, "terminal abook")
|
ok, err = pcall(vim.cmd, "terminal abook")
|
||||||
if not ok then _pim_scratch("abook", err) end
|
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 }
|
_pim_wins = { w1, w2, w3 }
|
||||||
vim.api.nvim_set_current_win(w1)
|
vim.api.nvim_set_current_win(w1)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -97,6 +97,16 @@ cat > ~/.config/alot/config << EOF
|
||||||
sendmail_command = msmtp -a main
|
sendmail_command = msmtp -a main
|
||||||
sent_box = maildir://$MAILDIR/Sent
|
sent_box = maildir://$MAILDIR/Sent
|
||||||
draft_box = maildir://$MAILDIR/Drafts
|
draft_box = maildir://$MAILDIR/Drafts
|
||||||
|
|
||||||
|
[bindings]
|
||||||
|
[[search]]
|
||||||
|
esc = exit
|
||||||
|
[[thread]]
|
||||||
|
esc = exit
|
||||||
|
[[taglist]]
|
||||||
|
esc = exit
|
||||||
|
[[bufferlist]]
|
||||||
|
esc = exit
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# ── systemd timer for periodic sync ───────────────────────────────────────────
|
# ── systemd timer for periodic sync ───────────────────────────────────────────
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue