RFE: Make the :scriptversion command usable within a sequence of | bar-separated comands at the command-line.

7 views
Skip to first unread message

Tony Mechelynck

unread,
Aug 8, 2021, 12:57:19 PM8/8/21
to Bram Moolenaar, vim_dev
Example:
:scriptversion 4 | echo 123'456'789 | scriptversion 1 | echo 123'456'789
now gives
E984: :scriptversion used outside of a sourced file
I suggest displaying
123456789
123 456 789
instead.

This would make it possible to use at the command-line syntaxes not
supported at scriptversion 1, sometimes making typing easier, as e.g.
for big numbers.

Best regards,
Tony.

Bram Moolenaar

unread,
Aug 8, 2021, 1:57:06 PM8/8/21
to vim...@googlegroups.com, Tony Mechelynck
Hmm, I don't really want to allow using :scriptversion at the command
line, it is really meant to be used in a script.

We should be able to use the ":vim9cmd" modifier. However, it appears
not to work. I can fix that. Then this works:

:vim9cmd echo 123'456'789

--
Seen on the back of a biker's vest: If you can read this, my wife fell off.

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

Tony Mechelynck

unread,
Aug 8, 2021, 5:25:47 PM8/8/21
to Bram Moolenaar, vim_dev
On Sun, Aug 8, 2021 at 7:57 PM Bram Moolenaar <Br...@moolenaar.net> wrote:
> Tony wrote: [...]
>
> Hmm, I don't really want to allow using :scriptversion at the command
> line, it is really meant to be used in a script.
>
> We should be able to use the ":vim9cmd" modifier. However, it appears
> not to work. I can fix that. Then this works:
>
> :vim9cmd echo 123'456'789

Fixed by patch 3318, thanks.

Best regards
Tony.
Reply all
Reply to author
Forward
0 new messages