La Boina Roja

Linux, the struggles are real!

Inserting “stuff” in vi files

Leave a comment

Yeah, I know a very professional title, it is also very clear  photo emo.gif Look, I just wrote it on here to be sure I won’t lose it. Also, it might be useful to someone else.

:r newfile.txt

Reads in newfile.txt in the current file, you can use TAB completion

:r!date

Puts the date in a file; ! reads the output of a command

:5, 22s /^/  /

Adds to two spaces before line 5 until 22, there two spaces in between the last two /.

Please, don’t ask questions about this, I don’t know what I am doing  photo shutup.gif

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s