Email or username:

Password:

Forgot your password?
Conor Hughes

During lunch a friend mentioned that you can just supply a HTTP URL to vim on the command line and it would use curl to download that resource and allow you to edit the content. I jokingly asked whether if you enter :w it would then issue a HTTP POST back to the origin which is of course ridiculous.

It issues a PUT

23 comments
Helge Heß

@conorh Next step is figuring out that Finder has WebDAV support since forever and you can effectively do that with literally any macOS app.

Hella

@conorh
Other protocols are also possible, e.g. you can edit files via scp

vim scp://user@remoteserver.example.org//home/user/remotefile.txt

Andrew Hewus Fresh

@unixwitch don't forget rsync:// for editing very large documents.
@conorh

Programmer 832-529 πŸ…

@unixwitch @conorh I didn't fully believe you but just tried it with the scp URL.

It works, amazing! Never knew it could do that.

ache

@smallsees @unixwitch @conorh Is scp still a thing ?

I mean, it's sftp now. Should work with any sftp server so.

Gheesh

@conorh Just tried this, it's perfect for testing thanks!

Jaycie

@conorh Xe are earnestly giddy at this revelation. Sounds great for xir journaling needs.

Alex Willmer

@conorh `vim foo.txt.gz` transparently decompresses the file, then recompresses on save. `vim bar.tar.gz` or `vim baz.zip` shows a list of the files in the archive, so you can choose which ones to edit tranparently.

Stefan Eissing

@conorh @jpmens The curl project is always happy to help. 😌

comicmuse ☘️

@conorh I need to have more lunches with people who introduce features of vim

David Peach

@conorh presumably I could have a file locally with an auth token that it can read from when doing a put request? πŸ€”

Chris. R. πŸŽ§πŸŽΌβ˜•πŸ

@conorh
My server logs gave me a wget entry. Nevertheless 🀯

Tony Hoyle

@conorh
Alas full vim doesn't seem that common. No idea what arch uses (vi is linked to ed somehow) and Debian uses vim.tiny which doesn't have any of this.

DrYak

@conorh That's indeed the appropriate protocol for webdav servers (btw, other editors do the same, e.g.: KDE's Kate also supports out-of-box working with remote files. I use this a lot for work. One more reason why I prefer working on Linux)

Go Up