Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- " Vim plugin to paste stuff to pastebin.com
- " Last change: 2011 JUN 19
- " Maintainer: Tony Baldwin <tony@baldwinsoftware.com
- " License: © tony baldwin, released according to the terms of the GPL v. 3
- " Make sure we gots us some bashy goodness...
- if !has("bash")
- finish
- endif
- " I map this to f11, so you may want to change that if you have f11 doing something else.
- :vmap <f11> :PasteIt<cr>
- " define a command
- :command -range -nargs=* PasteIt :call PasteMe(<line1>,<line2>)
- function! PasteMe(line1,line2,args)
- let sel_save = &selection
- let &selection = "inclusive"
- let pc = sel_save
- " change this to your username
- let un = tonybaldwin
- " make this your password
- let pw = **********
- let uk=$(: !curl -d api_dev_key="useyourkey" -d api_user_name="$un" -d api_user_password="$pw" http://pastebin.com/api/api_login.php)
- : !curl -d api_dev_key="useyourkey" -d api_user_key="$uk" -d api_user_name="$un" -d api_user_password="$pw" -d api_option="paste" -d api_paste_code="$pc" http://pastebin.com/api/api_post.php
- fi
- endfunction
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement