On Sun, 22 Mar 2009 20:29:30 +0800, Tony Mechelynck wrote:

>
> On 22/03/09 10:32, Yue Wu wrote:
>>
>> I want echo msg in different colors, but echohl can just make whole echo
>> the same color, can I use some command strings like:
>>
>>     echo "\red[Red text]\normal[Normal text]"
>>
>> to achieve it?
>>
>
> No, but you can use
>
>       echo "Normal text "
>       echohl Error
>       echon "Red text"
>       echohl Normal
>       echon " Normal text"
>
> or even
>
>       :echo 'Normal text ' | echohl Error | echon 'Red text' | echohl Normal
> | echon ' Normal text'
>
> The |:echon| command displays its argument(s) without adding a linefeed
> before (or after) it, so if you use it repeatedly they will all appear
> on one line. (Experiment shows that plain ":echo" apparently adds a
> newline before but not after.)
>
>
> Best regards,
> Tony.

Wow, so interesting, thank you for useful tip :)

-- 
Regards,
Van.

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to