set all - each option one line

35 views
Skip to first unread message

Erhy

unread,
Jan 15, 2020, 4:22:21 PM1/15/20
to vim_use
Hello!
I want to compare the options set in VIM.

Do you know, how to format of set all output
that I have for each option a separate line ?

Thank you for tips
Erhy

Andy Wokula

unread,
Jan 16, 2020, 3:50:37 PM1/16/20
to vim...@googlegroups.com
Am 15.01.2020 um 22:22 schrieb Erhy:
> Hello!
> I want to compare the options set in VIM.
>
> Do you know, how to format of set all output
> that I have *for each option a separate line *?
>
> Thank you for tips
> Erhy

Apparently
:set
always (?) produces multi-column output.
(sounds like one of those little annoyances that others didn't bother to ask for years)

You could redirect to a buffer with very small temporary 'columns' setting (at least 12),
but that's awful.

Or :substitute the (redirected) multi-column output to get single column output:

:%s/ \+\ze\%(no\l\+\%(\s\|$\)\| \S\)/\r/gIe

Obviously the problem is how to not split within option values.
My example output (not given here) shows a statusline with spaces and these don't appear escaped, so one just
cannot skip escaped spaces -- just make it a bit more unlikely to split there.

--
Andy

Bram Moolenaar

unread,
Jan 17, 2020, 1:39:38 PM1/17/20
to vim...@googlegroups.com

Andy Wokula wrote:

> Am 15.01.2020 um 22:22 schrieb Erhy:
> > Hello!
> > I want to compare the options set in VIM.
> >
> > Do you know, how to format of set all output
> > that I have *for each option a separate line *?
> >
> > Thank you for tips
> > Erhy
>
> Apparently
> :set
> always (?) produces multi-column output.
> (sounds like one of those little annoyances that others didn't bother
> to ask for years)

How about ":set!" only using one column? Currently ! isn't used and I
can't think of anything we would want to use it for when listing
options.

> You could redirect to a buffer with very small temporary 'columns'
> setting (at least 12), but that's awful.
>
> Or :substitute the (redirected) multi-column output to get single column output:
>
> :%s/ \+\ze\%(no\l\+\%(\s\|$\)\| \S\)/\r/gIe
>
> Obviously the problem is how to not split within option values.
> My example output (not given here) shows a statusline with spaces and
> these don't appear escaped, so one just cannot skip escaped spaces --
> just make it a bit more unlikely to split there.

--
SECOND SOLDIER: It could be carried by an African swallow!
FIRST SOLDIER: Oh yes! An African swallow maybe ... but not a European
swallow. that's my point.
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Andy Wokula

unread,
Jan 17, 2020, 2:53:25 PM1/17/20
to vim...@googlegroups.com
Am 17.01.2020 um 19:39 schrieb Bram Moolenaar:
> Andy Wokula wrote:
>
>> Am 15.01.2020 um 22:22 schrieb Erhy:
>>> Hello!
>>> I want to compare the options set in VIM.
>>>
>>> Do you know, how to format of set all output
>>> that I have *for each option a separate line *?
>>>
>>> Thank you for tips
>>> Erhy
>>
>> Apparently
>> :set
>> always (?) produces multi-column output.
>> (sounds like one of those little annoyances that others didn't bother
>> to ask for years)
>
> How about ":set!" only using one column? Currently ! isn't used and I
> can't think of anything we would want to use it for when listing
> options.

Why not.
Simple solution for a simple problem ^^.

--
Andy

Erhy

unread,
Jan 17, 2020, 4:48:03 PM1/17/20
to vim_use
don't see the simple solution?
please tell me
Erhy

Andy Wokula

unread,
Jan 18, 2020, 10:14:46 AM1/18/20
to vim...@googlegroups.com
Am 17.01.2020 um 22:48 schrieb Erhy:
> don't see the simple solution?
> please tell me
> Erhy

Get Vim 8.2.0128 and then use
:set!

--
Andy

John Little

unread,
Jan 19, 2020, 1:47:52 AM1/19/20
to vim_use
If you can't build or obtain a very new vim version, using the python interface can serve with a bit of work.  Use the :ver command to see what

For example, my vim is compiled with python3, so in a scratch buffer
py3 << eof
b = vim.current.buffer
for k in vim.options:
    b.append(k + '=' + str(vim.options[k]))
eof

That's global options only, there's buffer-local and window-local options too.

Erhy

unread,
Jan 25, 2020, 8:51:03 AM1/25/20
to vim_use
how I can get  Vim 8.2.0128
Few days before I have installed Vim
and gvim.exe has the version 8.2.0.0 
... with this :set! doesn't work

Erhy
Reply all
Reply to author
Forward
0 new messages