Thursday, May 19, 2022

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

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.

Thanks,
-Uday 

--
--
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/CALA1MBKuBDjX9TarxZwy-59WXFLwDBydXvrzLc_sf%2B47Ls70mQ%40mail.gmail.com.

No comments:

Post a Comment