Formatting text in VIM while saving newline

enter image description here

I have a bunch of markup files that I want to reformat to maximize the width of the text. My foinstalled on:

formatoptions=2tcqn

these parameters indicate:

t   Auto-wrap text using textwidth
c   Auto-wrap comments using textwidth, inserting the current comment
    leader automatically.
q   Allow formatting of comments with "gq".
n   When formatting text, recognize numbered lists

textwidth also set to a reasonable value.

The problem is that I am trying to format a few paragraphs containing lines of lines with trailing spaces (which is a markdown method for line breaks). These line breaks are removed when formatting using gq.
Is there a way to tell VIM to leave these lines (including trailing spaces) alone?

P.S. gif vap, gq . , linewise.

+3
1

- formatprg, , . vim vim, formatprg (, par , ).

+1

All Articles