Skip to content

Conversation

ianks
Copy link

@ianks ianks commented Jun 8, 2014

This will allow users to:

$ gist --vim my_new_gist.rb 

Which will create a new file in VIM, then post it as Gist.

Alternatively:

$ gist --vim -rf my_new_gist.rb 

Which will create the new file in VIM, post it as Gist, then immediately remove the file once finished. I chose to do it this way because VIM does not have great support with flushing a buffer to stdout.

This configuration could work with any editor (child process) which will correctly will report it's changed state to the Gist gem. However, I chose to initially set this up with Vim as I am most familiar with it.

Cheers and thanks for the gem 😄

@logankoester
Copy link

From one vim user to another, I think this should support other values of $EDITOR before being included, perhaps as -E, --edit. Good feature though, I'm looking forward to using it.

@ianks
Copy link
Author

ianks commented Jun 9, 2014

Yeah, the problem is that I am waiting for the Process to finish here (and reaping it once it's finished). On many editors, it will just open the file in the editor, and people will want to just save instead of exiting the process. 

The alternative way to do it would be to "listen" for the file using Guard-listen or something. Once the file is created, then follow the same logic. 

If I get some time I will do this eventually. Super swamped tho ATM

On Mon, Jun 9, 2014 at 12:06 PM, Logan Koester notifications@github.com
wrote:

From one vim user to another, I think this should support other values of $EDITOR before being included, perhaps as -E, --edit. Good feature though, I'm looking forward to using it.

Reply to this email directly or view it on GitHub:
#175 (comment)

@ConradIrwin
Copy link
Collaborator

We can steal this code from Pry:
https://github.com/pry/pry/blob/master/lib/pry/editor.rb#L79-L90

Conrad

On Mon, Jun 9, 2014 at 11:34 AM, Ian Ker-Seymer notifications@github.com
wrote:

Yeah, the problem is that I am waiting for the Process to finish here (and
reaping it once it's finished). On many editors, it will just open the file
in the editor, and people will want to just save instead of exiting the
process.

The alternative way to do it would be to "listen" for the file using
Guard-listen or something. Once the file is created, then follow the same
logic.

If I get some time I will do this eventually. Super swamped tho ATM

On Mon, Jun 9, 2014 at 12:06 PM, Logan Koester notifications@github.com
wrote:

From one vim user to another, I think this should support other values
of $EDITOR before being included, perhaps as -E, --edit. Good feature

though, I'm looking forward to using it.

Reply to this email directly or view it on GitHub:
#175 (comment)


Reply to this email directly or view it on GitHub
#175 (comment).

@logankoester
Copy link

@ConradIrwin's idea sounds reasonable to me.

@ConradIrwin
Copy link
Collaborator

I think this is better implemented using an editor plugin (for vim, you can just do :w!gist)

@ConradIrwin ConradIrwin closed this Nov 9, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants