From e88f3b103ccfad5854f4c5c7e64df998e02c4da9 Mon Sep 17 00:00:00 2001 From: Stefan Huber Date: Tue, 22 Dec 2020 12:17:44 +0100 Subject: [PATCH] Add asciidoc support --- init.vim | 8 +++++--- keymaps.vim | 1 + macros.vim | 14 ++++++++++++++ 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/init.vim b/init.vim index 019c81e..1f1bfc7 100644 --- a/init.vim +++ b/init.vim @@ -136,11 +136,13 @@ let g:vim_markdown_math=1 """""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Some filetype-specific settings -au FileType text,markdown,mail,tex,gitcommit,mediawiki,vimwiki setlocal spell -au FileType text,markdown,mail,gitcommit,mediawiki,vimwiki setlocal formatoptions+=n +au FileType text,markdown,asciidoc,mail,gitcommit,mediawiki,vimwiki,tex setlocal spell +au FileType text,markdown,asciidoc,mail,gitcommit,mediawiki,vimwiki setlocal formatoptions+=n au Filetype mail setlocal formatoptions+=o " Add | for block quotation, such that gq respects it -au Filetype mail setlocal comments+=n:\| +au Filetype mail setlocal comments+=n:\|, +" Add ordered lists via . +au Filetype asciidoc setlocal comments+=fb:., au Filetype go setlocal shiftwidth=8 tabstop=8 noexpandtab au Filetype tex setlocal shiftwidth=2 tabstop=2 diff --git a/keymaps.vim b/keymaps.vim index 8d7e549..1cbfbf9 100644 --- a/keymaps.vim +++ b/keymaps.vim @@ -21,6 +21,7 @@ au Filetype c,cpp,objc map :vsplit:FSRight au Filetype c,cpp,objc map :FSHere au Filetype markdown map :call RunMarkdown() +au Filetype asciidoc map :call RunAsciidoc() " Start interactive EasyAlign in visual mode (e.g. vipga) vmap (EasyAlign) diff --git a/macros.vim b/macros.vim index 046e381..b0c94dd 100644 --- a/macros.vim +++ b/macros.vim @@ -102,6 +102,11 @@ function RunMarkdownpy(prog) endfunction +function RunAsciidoctor() + execute ":!asciidoctor " . @% +endfunction + + function RunMarkdown() if executable("pandoc") call RunPandoc() @@ -115,6 +120,15 @@ function RunMarkdown() endfunction +function RunAsciidoc() + if executable("asciidoctor") + call RunAsciidoctor() + else + echo "No asciidoc implementation found." + endif +endfunction + + function OnBattery() if has('macunix') return match(system('pmset -g batt'), "Now drawing from 'Battery Power'") != -1 -- 2.30.2