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.
--
A man goes to a tailor to try on a new custom-made suit. The
first thing he notices is that the arms are too long.
"No problem," says the tailor. "Just bend them at the elbow
and hold them out in front of you. See, now it's fine."
"But the collar is up around my ears!"
"It's nothing. Just hunch your back up a little ... no, a
little more ... that's it."
"But I'm stepping on my cuffs!" the man cries in desperation.
"Nu, bend you knees a little to take up the slack. There you
go. Look in the mirror -- the suit fits perfectly."
So, twisted like a pretzel, the man lurches out onto the
street. Reba and Florence see him go by.
"Oh, look," says Reba, "that poor man!"
"Yes," says Florence, "but what a beautiful suit."
-- Arthur Naiman, "Every Goy's Guide to Yiddish"
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---