mattn / vim-gist

Vim plugin for Gist
http://www.vim.org/scripts/script.php?script_id=2423
1.69k stars 131 forks source link

Feature Request: Gist -u (update) #204

Open amadeus opened 8 years ago

amadeus commented 8 years ago

I have a file that I like to share between computers using Gist. I have a GistID set up and everything.

As of right now, when I make some updates and switch to that new Gist, I have to re-download that Gist and update the existing file on my computer to have the latest updates.

It would be really nice if instead I could just execute a command like :Gist -u, it would find the GistID in the current file, fetch the latest contents from the server and just replace the contents of the file.

I guess it would be similar to :Gist XXXX command, however not requiring the need to have to type out the address manually.

Perhaps I am an idiot and there's a simple way to do this already that I couldn't get from the docs?

artamonovdev commented 7 years ago

Yes, this will be super future! :+1:

mattn commented 7 years ago

:w should work for update.

amadeus commented 7 years ago

Not sure I follow? :w would just write the selected buffer to disk.

What I am wanting is say I create file.md, write some markdown in it, save it, then call :Gist on it to create a gist.

Then I will put the GistID in the file, in a comment, I can open the file later and just run :Gist and update the online gist.

If I then goto another computer, download that latest version of the gist, make new updates, and called :Gist again, then it will add new changes to the gist. If I return to my old computer, it will not have these updates. It would be cool to open the outdated file on my computer and do something like :Gist -u and have it replace the current buffer contents with the latest version of the gist specified in the comment in GistID.