Skip to content

Instantly share code, notes, and snippets.

@richsoni
Created September 3, 2013 18:34
Show Gist options
  • Save richsoni/6427794 to your computer and use it in GitHub Desktop.
Save richsoni/6427794 to your computer and use it in GitHub Desktop.
Ghetto Markdown Compiling In Vim Window
"Requires:
"lynx
"markdown.pl http://daringfireball.net/projects/markdown/
"setup (copy path to your markdown.pl in this script)
"Markdown Stuff
map <silent><leader>md :call MarkdownPreview()<cr>
function! MarkdownPreview()
"compile the markdown
let buffer = bufname("%")
"create a scratch split
vsplit __MARKDOWN_PREVIEW__
normal! ggdG
setlocal buftype=nofile
"insert compiled html
execute "r ! (path_to)/markdown " . buffer . " | lynx -stdin -dump"
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment