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:

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

    For vi, this is a good tip indeed!

    ReplyDelete
  2. Check out the Nread command

    :Nread ?

    ReplyDelete