Vimscript print function?

Is there a feature in Vimscript or a convention that allows you to simply print text in an editor? The echo function provides only the print function on the command line and does not actually print in the editor.

+4
source share
2 answers

When you say “print to the editor”, I assume that you mean “print to current buffer”. If this is correct, take a look at :help append() .

+6
source

The object that I sometimes use is :redir @" (or :redir @a for register a ), which redirects the output of commands to the buffer so that you can p an asteroid. To stop redirecting the output, say :redir end . See :help :redir .

+1
source

Source: https://habr.com/ru/post/1401052/


All Articles