4

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

Xavier T.
  • 40,509
  • 10
  • 68
  • 97
beakr
  • 5,709
  • 11
  • 42
  • 66

2 Answers2

5

When you say "print to the editor", I take it you mean "print to the current buffer". If that's correct, take a look at :help append().

Randy Morris
  • 39,631
  • 8
  • 69
  • 76
2

A facility I sometimes use is :redir @" (or :redir @a for register a), which redirects the output of commands to a buffer, so you can paste it. To stop output redirection, say :redir end. See :help :redir.

Lumi
  • 14,775
  • 8
  • 59
  • 92