I want to create a multi-color enabled debug-print command. As far I know, the only way to print multi-color messages in Vim is:

echohl Macro | echon "Hi" | echohl Statement | 
     \ echon " There!" | echohl None

I plan to utilize this technique. However there's a main drawback of echon — it isn't stored in any message history, not even in the single-past message recall command g<. I think that this limitation undermines the purpose of the debug-print function/command…

Is there some way to print multi-color and have the message remembered in some generally available history? So that the user of a plugin can restore the last messages and read them (because IMO it's mostly the case that when the user does something in Vim he out of an inertia enters 1-2 commands too much and they cancel the messages)?

  • Please post an answer with what you implemented in asciinema.org/a/357950 (from your comments on a now deleted answer.) Thanks!
    – filbranden
    Sep 6, 2020 at 3:34


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.