diff --git a/vimrc b/vimrc index e75b3fc..6d97395 100644 --- a/vimrc +++ b/vimrc @@ -82,6 +82,10 @@ Plug 'stephpy/vim-yaml' " Markdown " Plug 'plasticboy/vim-markdown' +"https://github.com/habamax/vim-asciidoctor +" AsciiDoctor +Plug 'habamax/vim-asciidoctor' + " https://github.com/SirVer/ultisnips " Вставка фрагментов кода " Plug 'sirver/ultisnips' @@ -594,3 +598,42 @@ xmap ga (EasyAlign) nmap ga (EasyAlign) "}}} +"{{{ AsciiDoctor +" What to use for HTML, default `asciidoctor`. +let g:asciidoctor_executable = 'asciidoctor' + +" What extensions to use for HTML, default `[]`. +let g:asciidoctor_extensions = ['asciidoctor-diagram'] + +" What to use for PDF, default `asciidoctor-pdf`. +let g:asciidoctor_pdf_executable = 'asciidoctor-pdf' + +" What extensions to use for PDF, default `[]`. +let g:asciidoctor_pdf_extensions = ['asciidoctor-diagram'] + +" What to use for DOCX, default `pandoc`. +" The DOCX 'compilation' process is to generate `docbook` using +" `g:asciidoctor-executable` and then to generate DOCX out of `docbook` +" using `pandoc`. +let g:asciidoctor_pandoc_executable = 'pandoc' + +" List of filetypes to highlight, default `[]` +let g:asciidoctor_fenced_languages = ['python', 'c', 'javascript', 'sh', 'tex'] + +" Function to create buffer local mappings +fun! AsciidoctorMappings() + nnoremap oo :AsciidoctorOpenRAW + nnoremap op :AsciidoctorOpenPDF + nnoremap oh :AsciidoctorOpenHTML + nnoremap ox :AsciidoctorOpenDOCX + nnoremap ch :Asciidoctor2HTML + nnoremap cp :Asciidoctor2PDF + nnoremap cx :Asciidoctor2DOCX +endfun + +" Call AsciidoctorMappings for all `*.adoc` and `*.asciidoc` files +augroup asciidoctor + au! + au BufEnter *.adoc,*.asciidoc call AsciidoctorMappings() +augroup END +"}}}