projects
/
vimconf.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1526f46
)
asciidoctor: Add F5 keymap logic
author
Stefan Huber <shuber@sthu.org>
Mon, 14 Feb 2022 16:35:21 +0000
(17:35 +0100)
committer
Stefan Huber <shuber@sthu.org>
Mon, 14 Feb 2022 16:35:21 +0000
(17:35 +0100)
keymaps.vim
patch
|
blob
|
history
macros.vim
patch
|
blob
|
history
diff --git
a/keymaps.vim
b/keymaps.vim
index bf0597d1661f1c9ea0dc8d5fea16b0ca5f11915a..38f7774ee4d6a38379edc9f0e8f66e243c19337b 100644
(file)
--- a/
keymaps.vim
+++ b/
keymaps.vim
@@
-69,7
+69,7
@@
au Filetype c,cpp,objc map <buffer> <S-F12> :FSHere<CR>
au Filetype c,cpp,objc map <buffer> <F24> :FSHere<CR>
au Filetype markdown map <buffer> <F5> :call RunMarkdown()<CR>
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
" See https://github.com/artur-shaik/vim-Javacomplete2
" <C-j>ji <leader>ji
diff --git
a/macros.vim
b/macros.vim
index d74406055ece5b04f6c1184bcbfe2f7c9340adfd..1da3dae9c56080df7f1cdc01545f006bef4759ac 100644
(file)
--- a/
macros.vim
+++ b/
macros.vim
@@
-112,6
+112,15
@@
endfunction
function RunAsciidoctor()
execute ":!asciidoctor " . @%
function RunAsciidoctor()
execute ":!asciidoctor " . @%
+ if executable("asciidoctor-pdf")
+ execute ":!asciidoctor-pdf " . @%
+ elseif executable("asciidoctor")
+ execute ":!asciidoctor " . @%
+ endif
+endfunction
+
+function RunAsciidoctorPdf()
+ execute ":!asciidoctor-pdf " . @%
endfunction
endfunction
@@
-129,7
+138,9
@@
endfunction
function RunAsciidoc()
function RunAsciidoc()
- if executable("asciidoctor")
+ if executable("asciidoctor-pdf")
+ call RunAsciidoctorPdf()
+ elseif executable("asciidoctor")
call RunAsciidoctor()
else
echo "No asciidoc implementation found."
call RunAsciidoctor()
else
echo "No asciidoc implementation found."