Skip to content

Instantly share code, notes, and snippets.

@sgharms
Created January 23, 2012 18:04
Show Gist options
  • Save sgharms/1664563 to your computer and use it in GitHub Desktop.
Save sgharms/1664563 to your computer and use it in GitHub Desktop.
How I build Markdown from within Vim
" 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