I would like to find a way to easy format lists in Vim.
I checked PAR and the default formatter of Vim.
p.e.
1. this is my text this is my text this is my text 2. this is my text this is my text this is my text 3. this is my text this is my text this is my text 4. this is my text this is my text this is my text
and this
- this is my text this is my text this is my text - this is my text this is my text this is my text - this is my text this is my text this is my text - this is my text this is my text this is my text
when I select the lines and do a default format to 42 with PAR and VIM these are the results:
formatting with par:
par error:
(42) <= (0) + (50)
formatting with vim:
1. this is my text this is my text this is my text 2. this is my text this is my text this is my text 3. this is my text this is my text this is my text 4. this is my text this is my text this is my text
formatting with par:
4 lines filtered (no change)
formatting with vim:
- this is my text this is my text this is my text - this is my text this is my text this is my text - this is my text this is my text this is my text - this is my text this is my text this is my text
Does anyone know a good way how to format lists without problems?
Try set fo+=n
. From :help fo-table
:
n When formatting text, recognize numbered lists. This actually uses
the 'formatlistpat' option, thus any kind of list can be used. The
indent of the text after the number is used for the next line. The
default is to find a number, optionally followed by '.', ':', ')',
']' or '}'. Note that 'autoindent' must be set too. Doesn't work
well together with "2".
Example:
1. the first item
wraps
2. the second item
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With