Today I Learned

hashrocket A Hashrocket project

Read a File Into Vim

In a Hashrocket blog post earlier this year I wrote about a command to read a file into your current Vim window:

:.! cat [filename]

A similar idea, from the command line:

$ cat [source_file] >> [target_file]

But with Vim there's always a better way:

:r[ead] [filename]

This command reads [filename] (defaulting to the current file) into in your window.

h/t Dorian Karter

See More #vim TILs
Every developer at Hashrocket is a Vim expert. Check out our development environment, Dotmatrix, and if you are in Chicago, come to the Vim Chicago Meetup hosted at our Chicago office.