au BufNewFile *.{h,hpp,hxx} call AddIncludeGuards()
au Filetype html,xml imap <buffer> <C-_> <C-X>/
+au Filetype markdown map <buffer> <F5> :call RunPandoc()<CR>
" Start interactive EasyAlign in visual mode (e.g. vipga)
vmap <Enter> <Plug>(EasyAlign)
endfunction
+function RunPandoc()
+ " If pandoc.css exists, use it
+ let cssopts = ""
+ if findfile("pandoc.css", ".") == "pandoc.css"
+ let cssopts = "-c pandoc.css --self-contained"
+ endif
+
+ execute ":!pandoc " . cssopts . " --toc " . @% . " -o " . @% . ".html"
+endfunction
+
+
if filereadable($HOME . '/.vim/macros-local.vim')
source ~/.vim/macros-local.vim
endif