Hello Bram, Am Fr., 14. Mai 2021 um 16:58 Uhr schrieb Bram Moolenaar <[email protected]>: > > > When starting an ordered list:: > > > > 1. hello > > > > with two spaces between the ``1.`` and the ``hello``, pressing Return > > at the end of the line leads to an indentation by four spaces, s.t. > > the cursor is located directly beneath the beginning of ``hello``. > > Other amounts of space between the ``1.`` and the ``hello`` are > > respected as well. > > > > However, when writing unordered lists:: > > > > * hello > > > > or:: > > > > - hello > > > > or:: > > > > + hello > > > > with three spaces between the bullet marker and the word "hello", > > pressing Return leaves the cursor indented with two spaces. This is > > independent on the number of spaces between the marker and the text. > > > > It is easy enough to indent manually when writing such paragraphs. > > However, when reflowing paragraphs in an unordered list by ``gq`` in > > "visual line" mode (``V``), it is a little tedious to reformat the > > paragraph starting at its second line, after the first line is > > complete. > > > > Would it be possible to change vim's behaviour in this respect? > > You don't mention what option values you use, but you should be able to > make it work by: > include the "n" flag in 'formatoptions' > Adjust the 'formatlistpat' option, e.g. to use a list with "+": > set formatlistpat=^\\s*\\(\\d\\+[\\]:.)}\\t\ ]\\\\|+\\)\\s*
Before trying to tweak the 'formatlistpat' option (with the double-backslashes contracted), I tried it out with the standard value and ``:set fo+=n`` in a vanilla buffer (``$ vim``), however no numbered lists are "recognised". I will do more research later. (The 'autoindent' option is set.) So far, thanks for the hint. BTW, shouldn't it be only one (two, in your case) backslashes prior to the alternative '|'? It looks like if the '|' should be, in your case, two more characters to the left? How is implemented the default indentation for ordered lists in the ReST mode (which works also with the "default" formatoptions='tcroql' I found to be present); and could the present behaviour w.r.t. unordered lists be changed still? Your proposition of using the 'n' formatoption looks more like a workaround to me. Friedrich -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/CAN06%3DCz88dXFu2fc3WsAHRfeG5QZiOtLegte%2BTNjUBM9QKdkUw%40mail.gmail.com.
