In my .vimrc I have this piece of code:

" Gist it to bl.ocks.org {{{
let g:gist_clip_command = 'xclip -selection clipboard'
command! -range=% Blocks
    \ <line1>,<line2>Format format | f index.html | exe 'Gist! -p' | bd!                                    |
    \ let @+ = 'http://bl.ocks.org/oblitum/raw/' . matchstr(@+, 'https://gist.github.com/\zs\w\+\ze') . '/' |
    \ let @+ = bitly#shorten(@+).url | redraw | echomsg 'Done: ' . @+ | setlocal nomodified
" }}}


At the top of the .vimrc I set clipboard=unnamedplus and add all the necessary plugins (frawor, formatvim, webapi-vim, gist-vim, bitly.vim). This command is to get buffer contents including highlighting and post it to a web page online.

This command works when executed from Vim in the terminal, but it doesn't when executed from GVIM.

On GVIM it seems that Gist! -p works for saving the gist url into the clipboard but then all the remaining command parts that are supposed to edit and transform this content in the clipboard seems to be doing nothing and in the end the echomsg just displays what was created by the original Gist! -p.

1 Answer 1


let g:gist_clip_command = 'xclip -selection clipboard' configuration is not necessary on GVIM and it's the culprit.

  • You can wrap it in if !has('gui_running') to run it only for terminal Vim. Commented Aug 31, 2016 at 11:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.