Thursday, June 2, 2022

Re: Prevent lines from being unwrapped when the lines end with a certain character/pattern

On Do, 02 Jun 2022, Uday Reddy B wrote:

>
> Just another ping on this question to see if there is a way.
>
> -Uday
>
> On Fri, 20 May 2022 at 07:25, Uday Reddy B <udayreddy@gmail.com> wrote:
>
> Hello,
>
> I was trying to find a way to have vim keep lines broken (i.e., not unwrap with auto format) when the lines ended with a certain character. For example, with Latex script, it's desirable to have:
>
> This is a line. \\
> Designation \\
> Affiliation \\
>
> I have formatoptions set to `tcqan` because I do need auto-formatting everywhere else and in general. However, with such options, vim would auto-format the above to:
>
> This is a line. \\ Designation \\ Affiliation \\
>
> My current approach is to switch into and out of `paste` mode when editing such lines to prevent unwrapping but it'd be convenient if this is automatically taken care of with some setting.

I don't think this is currently possible, perhaps try to tune the
'formatlistpat' option so that those lines are detect as "lists"

But I would rather ask, if you see such lines, why do you format them in
first place? This may depend on the document however. Not sure if this
is easily possible

Best,
Christian
--
Dass Christus auf eine Hamletische Weise zugrunde ging, und
schlimmer, weil er Menschen um sich berief, die er fallen ließ, da
Hamlet bloß als Individuum perierte.
-- Goethe, Maximen und Reflektionen, Nr. 1285

--
--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20220602102513.GC4071194%40256bit.org.

No comments: