Skip to content

Instantly share code, notes, and snippets.

@hchoroomi
Created December 31, 2008 06:56
Show Gist options
  • Save hchoroomi/41910 to your computer and use it in GitHub Desktop.
Save hchoroomi/41910 to your computer and use it in GitHub Desktop.
" rdoc.vim
command! -nargs=0 RDocPreview call RDocRenderBufferToPreview()
noremap <buffer> <LocalLeader>rd :RDocPreview<CR>
function! RDocRenderBufferToPreview()
if (system('which rdoc') == "rdoc not found\n")
throw "Could not find rdoc!"
end
let rdocoutput = "/tmp/vimrdoc/"
call system("rdoc " . bufname("%") . " --op " . rdocoutput)
call system("open -a Safari ". rdocoutput . "index.html")
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment