au Filetype c,cpp,objc map <buffer> <F24> :FSHere<CR>
au Filetype markdown map <buffer> <F5> :call RunMarkdown()<CR>
-au Filetype asciidoc map <buffer> <F5> :call RunAsciidoc()<CR>
+au Filetype asciidoc,asciidoctor map <buffer> <F5> :call RunAsciidoc()<CR>
" See https://github.com/artur-shaik/vim-Javacomplete2
" <C-j>ji <leader>ji
function RunAsciidoctor()
execute ":!asciidoctor " . @%
+ if executable("asciidoctor-pdf")
+ execute ":!asciidoctor-pdf " . @%
+ elseif executable("asciidoctor")
+ execute ":!asciidoctor " . @%
+ endif
+endfunction
+
+function RunAsciidoctorPdf()
+ execute ":!asciidoctor-pdf " . @%
endfunction
function RunAsciidoc()
- if executable("asciidoctor")
+ if executable("asciidoctor-pdf")
+ call RunAsciidoctorPdf()
+ elseif executable("asciidoctor")
call RunAsciidoctor()
else
echo "No asciidoc implementation found."