Auto line break upon reply email

8 views
Skip to first unread message

Tim Ye

unread,
May 8, 2022, 3:05:59 AM5/8/22
to vim...@googlegroups.com
Hi,

I noticed that some of the replied emails are auto indented by user, so
if the line is longer than, say 72 chars, it'll break into 2 lines
automatically(?). I'm wondering if it's possible to do this in vim?

My email client is mutt.

Thank you,

- Tim

BPJ

unread,
May 8, 2022, 4:22:12 AM5/8/22
to vim_use


Den sön 8 maj 2022 09:06'Tim Ye' via vim_use <vim...@googlegroups.com> skrev:
Hi,

I noticed that some of the replied emails are auto indented by user, so
if the line is longer than, say 72 chars, it'll break into 2 lines
automatically(?).  I'm wondering if it's possible to do this in vim?

:setl tw=72

see :h textwidth

I usually also do

:setl cc=72

(see :h colorcolumn)

to have an indication how much I have left on the line and to spot overlong lines which may arise during editing.

HTH,

/bpj



My email client is mutt.

Thank you,

- Tim

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20220508025238.autf5p3mmxsjbdpq%40localhost.

BPJ

unread,
May 8, 2022, 4:34:58 AM5/8/22
to bpj, vim_use


Den sön 8 maj 2022 10:21BPJ <b...@melroch.se> skrev:


Den sön 8 maj 2022 09:06'Tim Ye' via vim_use <vim...@googlegroups.com> skrev:
Hi,

I noticed that some of the replied emails are auto indented by user, so
if the line is longer than, say 72 chars, it'll break into 2 lines
automatically(?).  I'm wondering if it's possible to do this in vim?

:setl tw=72

see :h textwidth

I usually also do

:setl cc=72

(see :h colorcolumn)

to have an indication how much I have left on the line and to spot overlong lines which may arise during editing.

You also have to make sure "t" is in 'formatoptions' (see :h formatoptions). I forgot that because I always have it. Sorry!

/bpj

Tim Ye

unread,
May 8, 2022, 4:40:02 AM5/8/22
to vim...@googlegroups.com
Thank you for your reply.

Sorry I didn't make myself clear, what I wanted to achieve is that when
I hit reply (in mutt it's 'r'), I hope that the text in my replied email
would be automatically re-formatted (so if someone else sent an email
which doesn't set textwidth to 72 can be breaking into multiple lines in
my replied email).
>To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CADAJKhD8cYWvhBQAAkRb7H-Rz8ZMmB%3Dtz44VdCYCydr4UJR4vw%40mail.gmail.com.

Tim Ye

unread,
May 8, 2022, 4:40:02 AM5/8/22
to v...@vim.org
Hi,

I noticed that some of the replied emails are auto formatted by user, so
if the line is longer than, say 72 chars, it'll break into 2 lines
automatically(?). I'm wondering if it's possible to do this in vim?

Tim Ye

unread,
May 8, 2022, 4:40:02 AM5/8/22
to vim...@googlegroups.com, bpj
On 2022-05-08 10:34+0200, BPJ wrote:

>You also have to make sure "t" is in 'formatoptions' (see :h
>formatoptions). I forgot that because I always have it. Sorry!

Yes I have something like the following setting in my muttrc:

set editor = "vim -c 'set comments+=nb:> nocp bg=light tw=72 spell ft=mail formatoptions+=w'"

Tim Ye

unread,
May 8, 2022, 4:43:24 AM5/8/22
to 'Tim Ye' via vim_use, v...@vim.org
Please ignore this message, it's duplicated.

Sorry.
>--
>--
>You received this message from the "vim_use" maillist.
>Do not top-post! Type your reply below the text you are replying to.
>For more information, visit http://www.vim.org/maillist.php
>
>---
>You received this message because you are subscribed to the Google Groups "vim_use" group.
>To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+u...@googlegroups.com.
>To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20220508031918.juoz6hoii3bvcavo%40localhost.

Christian Brabandt

unread,
May 8, 2022, 4:46:04 AM5/8/22
to vim...@googlegroups.com
You do not need that. Make sure you have :filetype plugin on in your
vimrc, then Vim will automatically detect that you are writing a mail
from mutt and sets some sensible options. Check
$VIMRUNTIME/ftplugin/mail.vim for what those are.

This already sets a lot of useful defaults. If you need others, you can
add additional options by writing them into your
~/.vim/after/ftplugin/mail.vim (create non-existing directories).

Thanks,
Chris
--
F: Was ist golden und fliegt durch die Luft?
A: Maikäfer mit Goldzahn.

Tim Ye

unread,
May 8, 2022, 5:19:22 AM5/8/22
to vim...@googlegroups.com
Thank you I'll check them out.
Reply all
Reply to author
Forward
0 new messages