Created
September 3, 2013 18:34
-
-
Save richsoni/6427794 to your computer and use it in GitHub Desktop.
Ghetto Markdown Compiling In Vim Window
This file contains hidden or 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
"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