execute "conf qa" or ":conf qa"

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

execute "conf qa" or ":conf qa"

M Kelly
Hi,

It seems that sometimes I see cmds in an execute statement without a leading colon, as in:

execute "conf qa"

And sometimes I see the colon, as in:

execute ":conf qa"

Is there a rule or reason why ?  Just wanting to understand it properly.
I would have thought I need a colon always since I had thought the execute was being performed in 'normal' mode.  But it seems to work without the colon, at least in some places.

thx as always,
mark

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: execute "conf qa" or ":conf qa"

Tony Mechelynck
On Mon, Jun 11, 2018 at 4:21 AM, M Kelly <[hidden email]> wrote:

> Hi,
>
> It seems that sometimes I see cmds in an execute statement without a leading colon, as in:
>
> execute "conf qa"
>
> And sometimes I see the colon, as in:
>
> execute ":conf qa"
>
> Is there a rule or reason why ?  Just wanting to understand it properly.
> I would have thought I need a colon always since I had thought the execute was being performed in 'normal' mode.  But it seems to work without the colon, at least in some places.
>
> thx as always,
> mark

The operand of the :execute command must be an ex-command, not a
Normal command: for instance,

        :execute "j"

will join the current line with the next one, not move the cursor down
one line. So the colon is not necessary. But at the start of an
ex-command, a colon (or several) actually does nothing, e.g.

        ::::::::help

still displays the help.txt helpfile. So if the operand of :execute
starts with a colon, that colon is not harmful, but it isn't necessary
either.


Best regards,
Tony.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: execute "conf qa" or ":conf qa"

M Kelly
> So if the operand of :execute starts with a colon, that colon is not harmful,
> but it isn't necessary either.

Thank you so much Tony for explaining that.

-mark

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.