Add asciidoc support
authorStefan Huber <shuber@sthu.org>
Tue, 22 Dec 2020 11:17:44 +0000 (12:17 +0100)
committerStefan Huber <shuber@sthu.org>
Tue, 22 Dec 2020 11:17:44 +0000 (12:17 +0100)
init.vim
keymaps.vim
macros.vim

index 019c81e94a4b022f75589c320a4d7110d8dbb25a..1f1bfc709be977cc6b54d7d829337bb100cb9b5f 100644 (file)
--- 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
index 8d7e5495790dfad746463cc2ab40db104d85b708..1cbfbf95256ff57156ddd5a2910a90b3af185325 100644 (file)
@@ -21,6 +21,7 @@ au Filetype c,cpp,objc map <buffer> <F11> :vsplit<CR>:FSRight<CR>
 au Filetype c,cpp,objc map <buffer> <S-F11> :FSHere<CR>
 
 au Filetype markdown map <buffer> <F5> :call RunMarkdown()<CR>
+au Filetype asciidoc map <buffer> <F5> :call RunAsciidoc()<CR>
 
 " Start interactive EasyAlign in visual mode (e.g. vipga)
 vmap <Enter> <Plug>(EasyAlign)
index 046e381283aef870c7ebc0b50008867ff8551ecd..b0c94ddefdd6a4057ee88caf5bb2bd0b8fbfb884 100644 (file)
@@ -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