Sunday, June 5, 2011

Re: Using the colon with `execute'

On 05/06/11 19:30, Tim Johnson wrote:
> 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

The concatenation of expressions given as arguments to :execute, or each
line in a vim script, are already known to be ex-commands: they don't
need a starting colon.

When you type an ex-command at the keyboard, you must switch Vim from
Normal mode to command-line mode: for that, you need a colon.

At the start of an ex-command, any number of additional colons are
permitted (and do nothing).

See for instance
:help script
:help 20.1
:help cmdline-lines
" followed by
/A colon is allowed


Best regards,
Tony.
--
Once upon a time, there was a non-conforming sparrow who decided not to
fly south for the winter. However, soon after the weather turned cold,
the sparrow changed his mind and reluctantly started to fly south.
After a short time, ice began to form his on his wings and he fell to
earth in a barnyard almost frozen. A cow passed by and crapped on this
little bird and the sparrow thought it was the end, but the manure
warmed him and defrosted his wings. Warm and happy the little sparrow
began to sing. Just then, a large Tom cat came by and hearing the
chirping investigated the sounds. As Old Tom cleared away the manure,
he found the chirping bird and promptly ate him.

There are three morals to this story:

(1) Everyone who shits on you is not necessarily your enemy.
(2) Everyone who gets you out of shit is not necessarily your friend.
(3) If you are warm and happy in a pile of shit, keep your mouth shut.

--
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

No comments: