Search code examples
vim

Vim: insert text from a file at current cursor position


To insert text from a file in the current Vim buffer I use :r filename to insert the text below the cursor or :0r filename to insert in the first line.

How do you insert the contents of a file where [Cursor] is located?

Actual line with some coding [Cursor]  // TODO for later version  
Line below actual line ...

Solution

  • Insert a line break, read the file, and then take out the line break...