Skip to content

Instantly share code, notes, and snippets.

@romainl
Last active November 10, 2025 00:24
Show Gist options
  • Select an option

  • Save romainl/1cad2606f7b00088dda3bb511af50d53 to your computer and use it in GitHub Desktop.

Select an option

Save romainl/1cad2606f7b00088dda3bb511af50d53 to your computer and use it in GitHub Desktop.
Sharing is caring
" Mac OS X (requires curl)
" ------------------------
command! -range=% SP <line1>,<line2>w !curl -F 'sprunge=<-' http://sprunge.us | tr -d '\n' | pbcopy
command! -range=% CL <line1>,<line2>w !curl -F 'clbin=<-' https://clbin.com | tr -d '\n' | pbcopy
command! -range=% VP <line1>,<line2>w !curl -F 'text=<-' http://vpaste.net | tr -d '\n' | pbcopy
command! -range=% PB <line1>,<line2>w !curl -F 'c=@-' https://ptpb.pw/?u=1 | tr -d '\n' | pbcopy
command! -range=% IX <line1>,<line2>w !curl -F 'f:1=<-' http://ix.io | tr -d '\n' | pbcopy
command! -range=% EN <line1>,<line2>w !curl -F 'file=@-;' https://envs.sh | tr -d '\n' | pbcopy
command! -range=% XO <line1>,<line2>w !curl -F 'file=@-' https://0x0.st | tr -d '\n' | pbcopy
command! -range=% TB <line1>,<line2>w !nc termbin.com 9999 | tr -d '\n' | pbcopy
" Linux and other UNIX-like systems (requires curl and xclip)
" -----------------------------------------------------------
command! -range=% SP <line1>,<line2>w !curl -F 'sprunge=<-' http://sprunge.us | tr -d '\n' | xclip -i -selection clipboard
command! -range=% CL <line1>,<line2>w !curl -F 'clbin=<-' https://clbin.com | tr -d '\n' | xclip -i -selection clipboard
command! -range=% VP <line1>,<line2>w !curl -F 'text=<-' http://vpaste.net | tr -d '\n' | xclip -i -selection clipboard
command! -range=% PB <line1>,<line2>w !curl -F 'c=@-' https://ptpb.pw/?u=1 | tr -d '\n' | xclip -i -selection clipboard
command! -range=% IX <line1>,<line2>w !curl -F 'f:1=<-' http://ix.io | tr -d '\n' | xclip -i -selection clipboard
command! -range=% EN <line1>,<line2>w !curl -F 'file=@-;' https://envs.sh | tr -d '\n' | xclip -i -selection clipboard
command! -range=% XO <line1>,<line2>w !curl -F 'file=@-' https://0x0.st | tr -d '\n' | xclip -i -selection clipboard
command! -range=% TB <line1>,<line2>w !nc termbin.com 9999 | tr -d '\n' | xclip -i -selection clipboard
@shmup

shmup commented Apr 15, 2020

Copy link
Copy Markdown

yo, i wanted to share a thing i did for more CRUD stuff on ix.io, as it's the only one i use and some chunk of the time i want to do a -x PUT:

https://gist.github.com/shmup/db671132f0f9882187b28a677fa8df72

" nonymous-ix.vim uses .netrc for auth, and fucks with ix.io
" insert  :IX [optional visual selection] - copies url to system clipboard
" replace :RX <URL> [optional visual selection]
" delete  :DX <URL>

thanks for the template tho, been using it for a long while

@romainl

romainl commented Apr 15, 2020

Copy link
Copy Markdown
Author

@shmup, cool share, thanks.

@romainl

romainl commented Jan 22, 2021

Copy link
Copy Markdown
Author

@batalooppak

Copy link
Copy Markdown

Hi, how about this one:
command! -range=% ZX ,w !curl -F "file=@-" https://0x0.st | tr -d '\n' | pbcopy

@romainl

romainl commented Dec 1, 2023

Copy link
Copy Markdown
Author

@batalooppak thanks for the reminder. I had it in my vimrc under XO.

@bfrg

bfrg commented Dec 27, 2023

Copy link
Copy Markdown

Here's another one:

command! -range=% DP <line1>,<line2>w !curl -s -F "content=<-" https://dpaste.com/api/  | tr -d '\n' | pbcopy

The backslash at the end of the URL is required for some reasons.

The API also supports setting the syntax.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment