Monday, June 6, 2011

Re: Using the colon with `execute'

Tim Chase wrote:
> On 06/05/2011 12:30 PM, 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.
>
> As far as I can tell, the colon is *never* needed in the string used
> by :exec command as the resulting string is (per ":help :execute")
> executed as an Ex command. Explicitly stated in usr_41.txt (around
> line 498)
>
Not that the following couldn't be done otherwise, avoiding the colon,
but...

exe "echomsg getline('.')|norm! j:echomsg getline('.')\<cr>"

So, if one has a "norm" embedded in your string, one may find a colon
therein useful.

(you may need to use :mess to see the messages).

Regards,
Chip Campbell

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