Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Support ix.io ? #13

Closed
jakejohns opened this issue Apr 20, 2016 · 5 comments
Closed

Feature: Support ix.io ? #13

jakejohns opened this issue Apr 20, 2016 · 5 comments

Comments

@jakejohns
Copy link

jakejohns commented Apr 20, 2016

sprunge is down rupa/sprunge#35
ix.io is quite similar rupa/sprunge#10
@rupa seems frustrated with the hosting situation for sprunge.

Maybe this could possibly support http://ix.io as well?

command! -range=% IX  silent execute <line1> . "," . <line2> . "w !curl -F 'f:1=<-' ix.io | tr -d '\\n' | xclip -i -selection clipboard"

from reddit

.... I guess it kinnda already does with:

 let g:sprunge_cmd = 'curl -s -F "f:1=<-" http://ix.io'

However, there are other fancy features, and the syntax highlight is not a query in ix.io.

@javier-lopez
Copy link
Owner

javier-lopez commented Apr 20, 2016

Hello @jakejohns,

Indeed, updating the g:sprunge_cmd variable is an option, however the plugin should just work, I'll probably add an option for providers, so if one of them fail it continue with the following...

let g:sprunge_providers = "sprunge,ix,etc"

If you've a better idea feel free to share it.

@jakejohns
Copy link
Author

jakejohns commented Apr 20, 2016

that sounds reasonable. Looping until it finds one seems a like it'll be a bit of performance hit waiting for the last one if it's the only one up. But bumping the preferred/functioning one to the front of the list is no different than designating a single one, and will be more resilient.

noting here also that sprunge.vim:84 needs to be updated for ix.io highlighting:

if g:sprunge_open_browser | call sprunge#OpenBrowser(l:url . '/' . &filetype) | endif
"                                                             ^ "/" instead of "?"

Although I think you can post the file type as well, and just get the url back with it.

@javier-lopez
Copy link
Owner

it could be both @jakejohns, by default it could use

let g:sprunge_providers = "sprunge,ix,etc"

But users could configure

let g:sprunge_providers = "ix" 

Or

 let g:sprunge_cmd = 'curl -s -F "f:1=<-" http://ix.io'

If they only want to use a single or custom service, still not sure about highlighting, probably will end writing a wrapper function to modify the generated url before calling sprunge#OpenBrowser()

@javier-lopez
Copy link
Owner

Hello @jakejohns

I've added an initial implementation of the suggested feature, it's working on my side, but feel free to comment any issue.

@jakejohns
Copy link
Author

Cool! I'll check it out. Thanks!
I'll close this and reopen if necessary.
Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants