setting word/line wrap correctly with mutt and vim

2022-08-28 Thread void

Hello mutt-users,

mutt is 

2.2.7 (2022-08-07) with ncurses on freebsd current


vim is

VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Aug  4 2022 02:42:28)
Included patches: 1-129
Compiled by root@main-arm64-default-job-11
Huge version without GUI.


I'm trying to get things so that emails composed and replied to in 
mutt do not have to be manually edited with hard returns each time.


What I want is, if i'm typing in a line and it goes over 72 chars, 
to newline at that point intelligently. 


I've tried variations of
set editor="vim +':set textwidth=68' +':set wrapmargin=0' +':set wrap'"
and
set editor="vim +':set textwidth=0' +':set wrapmargin=0' +':set wrap'"
and
set editor="vim +':set textwidth=72' +':set wrapmargin=5'"

and in .vimrc
set textwidth=72

to no effect.

I don't know if this is a mutt issue or a vim issue or both/none. 
Where should I be looking?


TIA
--


Re: setting word/line wrap correctly with mutt and vim

2022-08-28 Thread void

On Sun, Aug 28, 2022 at 11:45:53AM -0700, Zach wrote:


loads of stuff to try


thank you :D I'll try that and post the results
--


Re: setting word/line wrap correctly with mutt and vim

2022-08-28 Thread void

On Sun, Aug 28, 2022 at 11:45:53AM -0700, Zach wrote:

On 2022-08-28  7:15pm, void wrote:

What I want is, if i'm typing in a line and it goes over 72 chars, to
newline at that point intelligently.


It could be that in vimrc you have

filetype on
filetype plugin on

Which will make vim recognize that the mutt temp file you are editing is of the 
'mail' filetype, and it will in turn apply particular settings to edit that 
file.

Vim looks in its $VIMRUNTIME path for a filetype plugin called 'mail.vim'. In 
that file are settings to be used when editing mutt email, to include line wrap 
settings, quote characters, cursor placement (iirc), etc.

:set runtimepath?

…will lead you to the filetype-associated paths. If this isn't the issue, you 
can at least check it off the list of things to examine.


Hi Zach,

runtimepath=~/.vim,/usr/local/share/vim/vimfiles,/usr/local/share/vim/vim90,/usr/local/share/vim/vimfiles/after,~/.vim/after

mail.vim is in /usr/local/share/vim/vim90

.vimrc contains (i simplified the file to the last five lines before looking at 
this)

filetype on
filetype plugin on
set mouse=
set paste
set laststatus=2
set nocompatible
syntax on

.muttrc contains

set editor="vim"

This results in txt wrapped to 72 chars or thereabouts for original text but quoted text 
isn't wrapped (it appears over several lines with a "+" on the following 
line(s).

Still, the result is in the right direction :D thank you. I'm getting the 
impression this is much more a vim setting than a mutt setting.
--


hcache on tmpfs?

2023-03-30 Thread void

Hi mutts@

Mutt's config for $tmpdir points to a tmpfs here which is memory-backed
and therefore v quick. The perms for this are set to 700.

I was wondering which hcache would be best in this use context. I'd like
to point the hcache to this tmpdir. But I understand that kyotocabinet
is memory-based already, so am unsure which to choose.

thanks,
--


Re: hcache on tmpfs?

2023-03-31 Thread void

Hello Cameron, I've replied in-line

On Fri, Mar 31, 2023 at 10:22:49AM +1100, Cameron Simpson wrote:


"memory based" might just mean memory mapped - kytotocabinet still has
persistent storage. Using a tmpfs will mean (a) it uses your physical
RAM (or possibly swap?) even when you're not using mutt and (b) the db
will vanosh on reboot.

I've used kyotocabinet elsewhere but do not know much, if anything,
about its internals.

Are you asking about picking a db backend (eg kyoto versus dbm)?


yes. I have several choices when building mutt:

HCACHE_BDB : off
HCACHE_GDBM: off
HCACHE_KYOTOCABINET: off
HCACHE_LMDB: on
HCACHE_NONE: off
HCACHE_QDBM: off
HCACHE_TOKYOCABINET: off

The question is really about "is it worth putting kyotocabinet in there
when ~/tmp is already a tmpfs and it uses (mostly? mainly?) ram


Subjectively, I'd have thought for moderate data they'd be similar on a
tmpfs. If you're prepared to rebuild the whole hcache after a reboot
(which of course might be very infrequent for you) it still may not
matter.


Yes. The machine is on 24/7 apart from OS upgrades and similar


Can you qualify what your concerns are here?


It's just interest. I want as fast as possible and it's not an issue if
headers have to be re-fetched after a boot because the connection is
also fast. I use imap with my ISP. I frequently press '$' to resync
last-read pointers with the imap server. Maybe I can tell mutt to do
that automatically every 5 mins. my concern is only that if/when headers
have to be re-fetched that already-read email doesn't have the unread
flag set subsequently.


I use an hcache. On persistent storage, which is an SSD for me. My
"python" folder has 157000 messages in it and opening mutt on it and
then closing it just took about 20 seconds including eyeballing the top
line to read the message count. This mutt was built with tokyocabinet,
which I expect is used for the hache (nothing else would have any use
for it).


I'd recomment lmdb in your context if you need persistent storage. 
Have been v impressed with lmdb. I also have thousands of emails 
spread across different folders. My context is using a rpi4b (8GB) with

usb3-connected hard drive. Right now, with $tmpdir pointing to a tmpfs
mount, and with hcache still pointing to the HD, (and with a zfs
filesystem), mutt is veru useable and quick even on this limited
hardware.
--


Re: hcache on tmpfs?

2023-03-31 Thread void

On Fri, Mar 31, 2023 at 10:02:17AM -0400, Dan Ritter wrote:


I don't know about "best", but I tried out putting hcache on a tmpfs,
and I can confirm that for large Maildirs (5000+) it makes a visible
difference even on an all SSD system.


awesome. I was hoping this would be the case. I'll stick with lmdb and
point it at a tmpfs.
--


Re: hcache on tmpfs?

2023-04-01 Thread void

On Sat, Apr 01, 2023 at 09:48:51AM +1100, Cameron Simpson wrote:


I keep an hcache per mail folder, I think because I once read somewhere
that only one mutt gets to use the hcache and I sometimes have a few
mutts around, sometimes on the same folder but usually different
folders.


I've read that mutt will do that if hcache points to a dir and not 
a file. For things like multiple mutts (I use this with multiple 
mutt -F muttrc-thisconfig mutt -F .muttrc-thatconfig) define a 
hcache per mutt so in .muttrc-thisconfig it'll point to
~/tmp/hcache-thisconfig) it is quite blazingly fast. 
--


dynamic sig based off imap folder

2024-01-14 Thread void

Hi,

I have various mailing list emails filtered on the server
by the mail provider going into various imap folders, based
on various properties of the email, like List-Id: for example.

What I'd like to have within mutt is for it to dynamically
decide which signature file to use based on what imap
folder the mail being replied to is in.

In the .muttrc there's for example a line like this:

mailboxes =mutt-users =test

In the manual, the nearest thing I can find to do what
I'm describing is in "Example 3.8. Using MuttLisp expressions"
but I'm unsure what expressions to use for an imap folder,
how to test to see if mutt is in it.

thanks in advance for any assistance/pointers
--


Re: dynamic sig based off imap folder

2024-01-15 Thread void

Thank you both. I'll be trying this shortly :D

--