> 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?

See ":help option-backslash" for an explanation.  Unfurtunately this is
complicated.  Another way is to use an assignment:
        :let &formatlistpat = 'value'
 
> 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.

I'll Cc the maintainer of the ReST indent file.

-- 
A cow comes flying over the battlements,  lowing aggressively.  The cow
lands on GALAHAD'S PAGE, squashing him completely.
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
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/202105142000.14EK0QIG3126996%40masaka.moolenaar.net.

Raspunde prin e-mail lui