mattn / vim-gist

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

update more than 1 Gist from same file #219

Open pinggit opened 5 years ago

pinggit commented 5 years ago

this is my daily tool that I heavily used. great tool! one issue I found regarding work flow, and visual selection.

  1. I published whole file, put GistID: xxx in the beginning of my file
  2. I then want to share a small piece of my file to someone, so I visual selected that piece, and hit :Gist! -p. I put the new GistID: yyy just in the visual selected snippet, so later I may keep updating the same Gist yyy, without changing the first Gist xxx.
  3. now if I want to update somewhere (not in the content of Gist yyy) else in the file and update my Gist xxx, it looks there is no good way to accomplish this. what i tried: a. Gist -p , this will continue to use Gist yyy and update that one b. Gist! -p, this will generate a third Gist zzz, which duplicated with Gist xxx. not what I waned.

currently the 2 workarounds I found, is:

  1. to close the buffer, reopen it, then: to update Gist xxx, :Gist -p. close the buffer and reopen it, then: to update Gist yyy, visual select the content (including the GistID): Gist -p

  2. create a new buffer for the 2nd Gist. is there a way to update more than 1 Gist from same file, without reopen the buffer or create a new buffer?

pinggit commented 1 year ago

I think ideally if the "GistID" in visually selected text is taking the precedence it will be perfect. so form same file one can publish many different gist, each with their own traceable ID.