[neomutt-users] Top Tip [advanced]
rich at flatcap.org
Mon Apr 9 14:33:08 CEST 2018
"$pager_index_lines" controls how much of the index is visible when
you're reading an email.
Recently a NeoMutt user asked:
"Can I toggle the variable between two values?"
This triggered a bit of a discussion on IRC.
NeoMutt doesn't support maths when setting variables.
set pager_index_lines = 50 - $pager_index_lines
But Lua can! Lua is a scripting language built into NeoMutt.
Check to see if your NeoMutt supports lua:
neomutt -v | grep "+lua"
We're going to use two commands:
and combine them into a macro:
macro index,pager <f3> ':lua mutt.set("pager_index_lines", 50 - mutt.get("pager_index_lines"))<enter><redraw-screen>'
If you start with "$pager_index_lines = 10", then this macro would
toggle it between 40 and 10 lines.
What can *you* do with with some simple maths?
Rich / FlatCap
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 868 bytes
Desc: not available
More information about the neomutt-users