You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently if one wants to emulate :python with user commands he will be stuck at implementing << EOF: there is no way for user commands to have multiline input, except for not adding -bar and using :execute 'MyCmd' "multiline\nstring". On the other hand it is impossible to just add command -herestring and expect it to work fine: not unless somebody wants to state that user commands must be defined not prior to its usage, but prior to its appearance (i.e. prior to the first function definition which happens to have that command inside) and can’t switch definition after that (or give up on having proper parser). Thus the suggestion: knowing that python << EOF\n{multiline string}\nEOF yields just the same result as execute 'python' "{multiline string}" I am suggesting to add :here command used like that:
here MyCmd << EOF
foo
EOF
and
if 1
here! MyCmd << EOF
First non-empty line appears as having zero indent when bang is used.
And this appears as an error for it being less indented then the first one.
EOF
endif
. The only thing which :here command will do is calling MyCmd with multiline string in <args>, universally and without requiring any additional support in MyCmd definition.
Additionally :here may accept range and forward it to MyCmd. Also :here! is good for built-in :python itself.
The text was updated successfully, but these errors were encountered:
Currently if one wants to emulate
:python
with user commands he will be stuck at implementing<< EOF
: there is no way for user commands to have multiline input, except for not adding-bar
and using:execute 'MyCmd' "multiline\nstring"
. On the other hand it is impossible to just addcommand -herestring
and expect it to work fine: not unless somebody wants to state that user commands must be defined not prior to its usage, but prior to its appearance (i.e. prior to the first function definition which happens to have that command inside) and can’t switch definition after that (or give up on having proper parser). Thus the suggestion: knowing thatpython << EOF\n{multiline string}\nEOF
yields just the same result asexecute 'python' "{multiline string}"
I am suggesting to add:here
command used like that:and
. The only thing which
:here
command will do is callingMyCmd
with multiline string in<args>
, universally and without requiring any additional support inMyCmd
definition.Additionally
:here
may accept range and forward it toMyCmd
. Also:here!
is good for built-in:python
itself.The text was updated successfully, but these errors were encountered: