preservim / vim-pencil

Rethinking Vim as a tool for writing
Other
1.57k stars 38 forks source link

List Formatting With Soft Wrap #60

Open thouqht opened 7 years ago

thouqht commented 7 years ago

Hey friends - loving the plugin. I'm wondering if there's a way to set the formatting on a list with soft wrap to go from the wrapped line going directly under the bullet like this:

- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt 
dolore magna aliqua. Ut enim ad minim 
- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt 
dolore magna aliqua. Ut enim ad minim 

To the wrapped line being in line with the text like this:

- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt 
  dolore magna aliqua. Ut enim ad minim 
- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt 
  dolore magna aliqua. Ut enim ad minim 

Any help is greatly appreciated, thank you!

reedes commented 7 years ago

I vaguely recall that wasn't a controllable behavior for Vim's soft wrap mode back when I wrote pencil to support it years ago.

However, Vim and Neovim have changed since then. If you can figure out a setting to modify that behavior, I can look at supporting it in pencil. Thanks.

thouqht commented 6 years ago

Thanks for responding!

From what I've gathered from this thread, it seems like breakindent was introduced in 2014 which should allow the behavior.

I posted this on reddit and there were some other ideas tossed around. In particular, this thread seemed to offer some ideas of how to actually implement it.

I wish I knew coding better to offer more help, but alas I use vim for word processing (made enjoyable by your plugin here). This feature would be tremendous boon for using vim for outlines and brainstorming.

LeuschkeTressa commented 3 years ago

This feature would be tremendous boon for using vim for outlines and brainstorming.

Absolutely agree. I'd really like to see this feature as well.

Markdown and free flowing text/prose really only works with soft wraps and reasonable list indentation is really key for the readability of text with lists/bullets. It's a pity that not even vim/neoVim is configurable enough that this can be achieved, not even with a custom plugin, as I understand it.

For those that would benefit from this feature, please upvote/comment on the GitHub feature request for vim (still open as of March 2021) and also for the corresponding one for NeoVim.


My current workaround is using set showbreak=\ \ - less than satisfactory but better than nothing.

alerque commented 3 years ago

VIM has and NeoVIM will soon have new features in this department.

cf. https://github.com/neovim/neovim/issues/10206

folofjc commented 2 years ago

VIM has and NeoVIM will soon have new features in this department.

cf. neovim/neovim#10206

For those who come here figuring out how to do this, what you need to set is: :set briopt+=list:-1. The vim issue here states to set it to 3. However, the final PR changed that, which you can see here