Created
January 23, 2012 18:04
-
-
Save sgharms/1664563 to your computer and use it in GitHub Desktop.
How I build Markdown from within Vim
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
" Written by steven for quick loadup of Markdown text into HTML | |
function! Mkdp() | |
write | |
let file = expand("%") | |
let mkd_file = file . ".html" | |
let result = system("markdown " . file . " > " . mkd_file) | |
let result = system("open " . mkd_file) | |
endfunction | |
augroup filetype_markdown | |
autocmd! | |
au BufNewFile,BufReadPost *.{md,markdown} nnoremap <leader>mm :call Mkdp()<CR> | |
augroup END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment