Sunday, June 5, 2011

Re: Using the colon with `execute'

Reply to message «Using the colon with `execute'»,
sent 21:30:42 05 June 2011, Sunday
by Tim Johnson:

For :execute it is not necessary in any case.
The only place where you *must* have a colon is a mapping/feedkeys() call/manual
typing: where you need to execute a command not from the command mode and thus
have to use colon to start it. In any other place it is unnecessary.

I personally sometimes use colon for readability in :au definitions, but it is
also not required here.

Documentation does not mention it because `:' is only used in normal mode to
start command mode. Ability to specify colon in front of a command is present, I
guess, only for convenience. At least I can't find it anywhere in help.

Original message:
> I'm unclear about when to use and when *not* to use the colon in a
> string for the `execute' command - as composed programmatically.
>
> I'd appreciate it if someone could point me to some documentation or
> discussion on this topic.
>
> :h execute
>
> doesn't seem to clear this question up for me.
>
> thanks

No comments: