Created
December 12, 2020 03:06
-
-
Save eduardoarandah/5f1f83e705d1a015b58bcae21172aab5 to your computer and use it in GitHub Desktop.
Vim plugin share code pastebin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""""""""""""""""""""""""""""""""""" | |
" Share via paste.rs | |
" | |
" Visual select and :Share | |
" | |
" Add .extension to url to format code | |
" Example: .markdown | |
""""""""""""""""""""""""""""""""" | |
function! s:share() range | |
let n = @n | |
silent! normal gv"ny | |
let out = system("echo '" . @n . "' | curl --silent --data-binary @- https://paste.rs") | |
let @n = n | |
normal `> | |
put ='' | |
put ='Share:' | |
put =out | |
" also copy to clipboard? | |
let @+ = out | |
endfunction | |
command! -range Share :call s:share()<cr> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment