2008-07-02

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

3 comments:

Anonymous said...

Bedankt, handige tip!

Anonymous said...

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

For vi, this is a good tip indeed!

Anonymous said...

Check out the Nread command

:Nread ?