Skip to content

Instantly share code, notes, and snippets.

@ironhouzi
Created July 2, 2018 11:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ironhouzi/3b6e7b59db88d5c63f063a997033cf16 to your computer and use it in GitHub Desktop.
Save ironhouzi/3b6e7b59db88d5c63f063a997033cf16 to your computer and use it in GitHub Desktop.
function! PandocOpen(filetype)
let l:fpath = '/tmp/' . expand('%:t:r') . '.' . a:filetype
execute '!pandoc -s --highlight-style breezedark -o ' . l:fpath . ' %; xdg-open ' . l:fpath
endfunction
nnoremap <silent> <leader>oh :<C-u>call PandocOpen("html")<CR>
nnoremap <silent> <leader>oo :<C-u>call PandocOpen("html")<CR>
nnoremap <silent> <leader>op :<C-u>call PandocOpen("pdf")<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment