9

Basically, I'd like to have long entries for bulleted / numbered lists that automatically indent like so:

1. Congress shall make no law respecting an establishment of 
   religion, or prohibiting the free exercise thereof; or 
   abridging the freedom of speech, or of the press; or the 
   right of the people peaceably to assemble, and to petition 
   the government for a redress of grievances.

I'm aware that formatoptions=n will do this for numbered lists and formatoptions=c will do this for asterisks (provided they are defined as comment leaders with comments=fb:*), but this only works by forcing an automatic hard wrap. I'd prefer to avoid this situation, since in order to edit the paragraph, I then have to manually Join the lines back into one, make the edits, and then gqq to reformat.

The breakindent setting gets me halfway there, with automatic indentation for softwrapped paragraphs, but it only provides indentation identical to the first line. Is there any setting that combines breakindent's softwrap support with formatoptions+=cn's numbered- and bulleted-list recognition?

  • 2
    Afaik, this is not possible (compare also :h 'breakindentopt'). I think you have to create a feature request either on the vim_dev mailing list or on the issue tracker on github. – Hotschke Apr 26 '17 at 12:06
  • For anyone who stumbles on this question in the future: The GitHub feature request is here; if you're a C programmer, we'd sure appreciate your help in building this feature, and if you're just a mere mortal, maybe you can at least chime in and state your support for it? :) – Ryan Lue 2 days ago

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.