views:

87

answers:

2

Lets say that you have either URL or a link on a webpage that is a text file. How would be the easiest way for the user to be able to open that file in a Vim?

  • Right click and save link as?
  • Use a specific file extension that defaults to Vim?
  • Command line command?
+1  A: 

Assuming you want to just open a link in vim, how about this:

curl http://www.google.com | vim -

EDIT to make this command easier you can always user your browser of choice's "Copy link address" option.

EDIT Given @speshak's answer and my own, I would say the "easiest" way would be option 3, "a command line command".

Matthew J Morrison
+5  A: 

Depending on how your vim binary was built you can just give vim the url:

vim http://www.google.com

Vim spawns curl and grabs the file, then opens it.

speshak
touche, @speshak, touche
Matthew J Morrison
This also works when vim is already open: ":e http://www.google.com"
Lucas Oman