How have you gotten formatoptions+=n to work?

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

How have you gotten formatoptions+=n to work?

Nikolai Weibull-2
I have tried to get the 'n' flag in formatoptions to do my bidding, but
it doesn't seem to work for me.

I have

        set formatoptions=tcroqln

and 'formatlistpat' at its default setting.  When I type

1.  Blah ...

I expect the following line to be indented by the 'B', but no such luck.
Any suggestions on what I might try?,
        nikolai

--
Nikolai Weibull: now available free of charge at http://bitwi.se/!
Born in Chicago, IL USA; currently residing in Gothenburg, Sweden.
main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}
Reply | Threaded
Open this post in threaded view
|

Re: How have you gotten formatoptions+=n to work?

A.J.Mechelynck
Nikolai Weibull wrote:

> I have tried to get the 'n' flag in formatoptions to do my bidding, but
> it doesn't seem to work for me.
>
> I have
>
>         set formatoptions=tcroqln
>
> and 'formatlistpat' at its default setting.  When I type
>
> 1.  Blah ...
>
> I expect the following line to be indented by the 'B', but no such luck.
> Any suggestions on what I might try?,
>         nikolai
>

'formatlistpat' at its default value means that, to be recognised as a
"numbered list header" a line must contain exactly the following in the
following sequence:

1. start-of-line
2. zero or more spaces or tabs
3. one or more digits
4. exactly one of: colon, dot, right bracket (square, round or curly) or
one space or one tab
5. zero or more spaces or tabs, as many as possible
6. one or more text characters.

The way I understand it, the next line in the _same_ paragraph of
_auto-formatted_ text will be indented like item 6 above.

What are your exact symptoms? (What are you doing and what are you
seeing?) "No such luck" covers a lot. If you could give a reproducible
example, preferably with a minimal vimrc, that would help us track the
problem.

IIUC, the settings for
        'expandtab'
        'autoindent'
        'smartindent'
        'tabstop'
        'softtabstop'
might in some cases be relevant too.


Best regards,
Tony.

Reply | Threaded
Open this post in threaded view
|

Re: How have you gotten formatoptions+=n to work?

Alan G Isaac
In reply to this post by Nikolai Weibull-2
On Wed, 29 Jun 2005, Nikolai Weibull apparently wrote:
>         set formatoptions=tcroqln
> and 'formatlistpat' at its default setting.  When I type

1. If I set fo=tcqn, then I find that the numbered list
   option works as expected as long as I do no press <enter>
   on the line containing the number.
2. What is formatlistpat?  A version 7 option?  I need that!

Thank you,
Alan Isaac







Reply | Threaded
Open this post in threaded view
|

Re: How have you gotten formatoptions+=n to work?

Nikolai Weibull-2
In reply to this post by A.J.Mechelynck
A. J. Mechelynck wrote:

> Nikolai Weibull wrote:

> > I have
> >
> >         set formatoptions=tcroqln
> >
> > and 'formatlistpat' at its default setting.  When I type
> >
> > 1.  Blah ...
> >
> > I expect the following line to be indented by the 'B', but no such luck.
> > Any suggestions on what I might try?,

> 'formatlistpat' at its default value means that, to be recognised as a
> "numbered list header" a line must contain exactly the following in the
> following sequence:
>
> 1. start-of-line
> 2. zero or more spaces or tabs
> 3. one or more digits
> 4. exactly one of: colon, dot, right bracket (square, round or curly) or
> one space or one tab
> 5. zero or more spaces or tabs, as many as possible
> 6. one or more text characters.
>
> The way I understand it, the next line in the _same_ paragraph of
> _auto-formatted_ text will be indented like item 6 above.

Item 4 you mean.  Yes, I know what the regex says, but that's
irrelevant.  I've written my lists to conform to this language and yet I
get no satisfaction.

> What are your exact symptoms? (What are you doing and what are you
> seeing?) "No such luck" covers a lot. If you could give a reproducible
> example, preferably with a minimal vimrc, that would help us track the
> problem.

Running vim without any configuration and then setting up
'formatoptions' as suggested is what I've been trying (to get a fair
result),
        nikolai

--
Nikolai Weibull: now available free of charge at http://bitwi.se/!
Born in Chicago, IL USA; currently residing in Gothenburg, Sweden.
main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}
Reply | Threaded
Open this post in threaded view
|

Re: How have you gotten formatoptions+=n to work?

A.J.Mechelynck
In reply to this post by Alan G Isaac
Alan G Isaac wrote:

> On Wed, 29 Jun 2005, Nikolai Weibull apparently wrote:
>
>>        set formatoptions=tcroqln
>>and 'formatlistpat' at its default setting.  When I type
>
>
> 1. If I set fo=tcqn, then I find that the numbered list
>    option works as expected as long as I do no press <enter>
>    on the line containing the number.
> 2. What is formatlistpat?  A version 7 option?  I need that!
>
> Thank you,
> Alan Isaac

Yes, it's new in Version 7. It's a pattern to recognise what a "numbered
list header" consists of (idea by Hugo Haas).

See 'formatlistpat' under ":help new-items-7" in version7.txt, and of
course ":help 'formatlistpat'" in the options.txt for version 7.00aa.

You may download a usable version 7 distribution for W32 from
http://users.skynet.be/antoine.mechelynck/vim/#vim7 (Read the disclaimer
before downloading: this is alpha software, it's not for the faint of
heart, and no damages will be paid out, not even if it causes your
computer to burn away in big red flames.) For any platform, you can also
compile your own, from sources at
ftp://ftp.vim.org/pub/vim/unstable/snapshot/ -- each of the .zip files
in that directory is a "snapshot" of the full Vim source at a certain
date (Hint: use the most recent one that you can make work). Here also,
no reimbursements: read the README file in that directory before you
decide to download.

Anyone deciding to use Vim 7 on a regular basis should also subscribe to
the vim-dev list, where (among other things) new features and bugs of
alpha versions are discussed.


Best regards,
Tony.

Reply | Threaded
Open this post in threaded view
|

Re: How have you gotten formatoptions+=n to work?

Nikolai Weibull-2
In reply to this post by Alan G Isaac
Alan G Isaac wrote:

> On Wed, 29 Jun 2005, Nikolai Weibull apparently wrote:

> >         set formatoptions=tcroqln
> > and 'formatlistpat' at its default setting.  When I type
>
> 1. If I set fo=tcqn, then I find that the numbered list
>    option works as expected as long as I do no press <enter>
>    on the line containing the number.

Aha!  Gawd...I figured it would work when pressing <Enter> as
well...damn...

Thanks,
        nikolai

--
Nikolai Weibull: now available free of charge at http://bitwi.se/!
Born in Chicago, IL USA; currently residing in Gothenburg, Sweden.
main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}
Reply | Threaded
Open this post in threaded view
|

Re: How have you gotten formatoptions+=n to work?

A.J.Mechelynck
In reply to this post by Nikolai Weibull-2
Nikolai Weibull wrote:

> A. J. Mechelynck wrote:
>
>
>>Nikolai Weibull wrote:
>
>
>>>I have
>>>
>>>        set formatoptions=tcroqln
>>>
>>>and 'formatlistpat' at its default setting.  When I type
>>>
>>>1.  Blah ...
>>>
>>>I expect the following line to be indented by the 'B', but no such luck.
>>>Any suggestions on what I might try?,
>
>
>>'formatlistpat' at its default value means that, to be recognised as a
>>"numbered list header" a line must contain exactly the following in the
>>following sequence:
>>
>>1. start-of-line
>>2. zero or more spaces or tabs
>>3. one or more digits
>>4. exactly one of: colon, dot, right bracket (square, round or curly) or
>>one space or one tab
>>5. zero or more spaces or tabs, as many as possible
>>6. one or more text characters.
>>
>>The way I understand it, the next line in the _same_ paragraph of
>>_auto-formatted_ text will be indented like item 6 above.
>
>
> Item 4 you mean.  Yes, I know what the regex says, but that's
> irrelevant.  I've written my lists to conform to this language and yet I
> get no satisfaction.

No I mean Item 6. In your example, Item 4 is the dot after the digit,
Item 6 starts at the B of Blah.

>
>
>>What are your exact symptoms? (What are you doing and what are you
>>seeing?) "No such luck" covers a lot. If you could give a reproducible
>>example, preferably with a minimal vimrc, that would help us track the
>>problem.
>
>
> Running vim without any configuration and then setting up
> 'formatoptions' as suggested is what I've been trying (to get a fair
> result),
>         nikolai
>

"without any configuration" usually implies 'compatible' is set to TRUE.
You might want to set -N in the Vim command line to avoid that.

By "a repeatable example" I mean, for instance:

- describe exactly how you invoke Vim, e.g., "gvim -u NONE -U NONE -N".
- describe exactly which additional ex-commands you type
- describe exactly what you type in Insert mode
- describe exactly what happens
- describe exactly what you think ought to have happened.

"It doesn't work" doesn't tell us /how/ it fails or /what/ you expected
of it.


Best regards,
Tony.

Reply | Threaded
Open this post in threaded view
|

Re: How have you gotten formatoptions+=n to work?

Nikolai Weibull-2
A. J. Mechelynck wrote:

> > > 6. one or more text characters.

> > > The way I understand it, the next line in the _same_ paragraph of
> > > _auto-formatted_ text will be indented like item 6 above.

> > Item 4 you mean.  Yes, I know what the regex says, but that's
> > irrelevant.  I've written my lists to conform to this language and
> > yet I get no satisfaction.

> No I mean Item 6. In your example, Item 4 is the dot after the digit,
> Item 6 starts at the B of Blah.

Um, OK, now I understand what you mean.  That wasn't very clear.
(You're saying "indented beginning at the text characters of item 6",
right? ;-) Anyway, the other response solved it.  I was pressing <Enter>
to get unto the next line more quickly (for testing).  This doesn't work
for the first line, but for all subsequent lines (even when the previous
one was empty, which is weird.  I'd have thought that a blank line would
separate list items).

> Best regards,
> Tony.

How is your name Tony when you post as A. J. Mechelynck?  Just curious.

Anyway, thanks for responding,
        nikolai

--
Nikolai Weibull: now available free of charge at http://bitwi.se/!
Born in Chicago, IL USA; currently residing in Gothenburg, Sweden.
main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}
Reply | Threaded
Open this post in threaded view
|

Re: How have you gotten formatoptions+=n to work?

A.J.Mechelynck
Nikolai Weibull wrote:
> A. J. Mechelynck wrote:
[...]
>>Best regards,
>>Tony.
>
>
> How is your name Tony when you post as A. J. Mechelynck?  Just curious.
>
> Anyway, thanks for responding,
>         nikolai
>

Short answer: Tony is short for Anthony.

Long answer:

My full identity, as registered in the French language shortly after I
was born, is:

Antoine Jean Andr? Jacques Charles Henri, fils de Andr? Louis ?douard
?mile MECHELYNCK et de Marie Jeanne H?l?ne Andr?e DE PAGE.

where the part before the comma consists of my given names, and the rest
tells who are my parents (family names in capitals). I know, I got much
too many first names, but at that time none of my grandparents had any
grandchildren yet, so the whole family came together to throw names at me.

A.J. is short for Antoine Jean.

Tony is an English familiar variant of Anthony = Antoine.

Remarks: Many common English nicknames don't start with the same letter
as what they stand for: for instance, Bill=William, Dick=Richard,
Liz=Elizabeth, ... Neither is this peculiar to English; e.g. in Russian,
Sasha=Alexander, Tonya=Anton or Anton'ya, Vanya=Ivan, Kolya=Nikola?; in
some Germanic languages, Hans=Johannes; etc.


Best regards,
Tony.

Reply | Threaded
Open this post in threaded view
|

Re: How have you gotten formatoptions+=n to work?

Nikolai Weibull-2
A. J. Mechelynck wrote:

> Nikolai Weibull wrote:

> > How is your name Tony when you post as A. J. Mechelynck?  Just curious.

> Short answer: Tony is short for Anthony.
>
> Long answer:
>
> My full identity, as registered in the French language shortly after I
> was born, is:
>
> Antoine Jean Andr� Jacques Charles Henri, fils de Andr� Louis �douard
> �mile MECHELYNCK et de Marie Jeanne H�l�ne Andr�e DE PAGE.
>
> where the part before the comma consists of my given names, and the rest
> tells who are my parents (family names in capitals). I know, I got much
> too many first names, but at that time none of my grandparents had any
> grandchildren yet, so the whole family came together to throw names at me.
>
> A.J. is short for Antoine Jean.
>
> Tony is an English familiar variant of Anthony = Antoine.
>
> Remarks: Many common English nicknames don't start with the same letter
> as what they stand for: for instance, Bill=William, Dick=Richard,
> Liz=Elizabeth, ... Neither is this peculiar to English; e.g. in Russian,
> Sasha=Alexander, Tonya=Anton or Anton'ya, Vanya=Ivan, Kolya=Nikola�; in
> some Germanic languages, Hans=Johannes; etc.

My grandparents on my mother?s side liked to call me Mikolai for some
reason :-) (they were Ukranian).  I was having a hard time coming up
with a French or Flemish name beginning with A or J that could be
turned into Tony, but I see clearly now :-).  Thanks for the
explanation,
        nikolai

--
Nikolai Weibull: now available free of charge at http://bitwi.se/!
Born in Chicago, IL USA; currently residing in Gothenburg, Sweden.
main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}