preservim / vim-pencil

Rethinking Vim as a tool for writing
Other
1.58k stars 39 forks source link

Make autoformat conscious of soft like breaks in hard wrap mode? #62

Closed kartikynwa closed 7 years ago

kartikynwa commented 7 years ago

I will use hyphens to show spaces for clarity. Assume the following is a Markdown document.

Markdown-is-a-markup-language.--
:thinking:

When trying to do this, line 2 is autoformatted back to line 1 and the two whitespaces at the end of line 1 denoting a line break are removed.

Is there a fix to this?

Thanks for this wonderful plugin by the way.

reedes commented 7 years ago

Hmm, a few ideas...

Use 'soft' mode which avoids Vim's aggressive autoformat.

With 'hard' mode, use the temporary method of disabling autoformat as described in the readme.

Precede ':thinking:' with a '- ' to treat it as a list, using Tim Pope's syntax (which is also default one)

Glad to see you like the plugin!

kartikynwa commented 7 years ago

I feel the best solution to this is to turn off autoformatting (set fo-=a) while allowing line breaks when textwidth is exceeded (`set fo+=t'). Autoformatting is gimmicky anyway. Autoformatting is gimmicky anyway.