wget inside vi

Suppose a text file exists on the internet, and you want this text inside your current vi(m). In command mode, type the following:

:r !wget -q http://linux-training.be/dates.txt -O -

EDIT: Leo has a simpler solution:

:Nread http://linux-training.be/dates.txt


Koen Vervloesem said...

Bedankt, handige tip!

Philip said...

In Vim, you can read straight from http using netrw, which uses curl internally.

For vi, this is a good tip indeed!

Leo Eraly said...

Check out the Nread command

:Nread ?