AsciiDoctor

This commit is contained in:
Andrei Astafev 2019-06-02 13:03:49 +03:00
parent 2cb6c3d5d3
commit ad929d3fdf

43
vimrc
View File

@ -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 <Plug>(EasyAlign)
nmap ga <Plug>(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 <buffer> <leader>oo :AsciidoctorOpenRAW<CR>
nnoremap <buffer> <leader>op :AsciidoctorOpenPDF<CR>
nnoremap <buffer> <leader>oh :AsciidoctorOpenHTML<CR>
nnoremap <buffer> <leader>ox :AsciidoctorOpenDOCX<CR>
nnoremap <buffer> <leader>ch :Asciidoctor2HTML<CR>
nnoremap <buffer> <leader>cp :Asciidoctor2PDF<CR>
nnoremap <buffer> <leader>cx :Asciidoctor2DOCX<CR>
endfun
" Call AsciidoctorMappings for all `*.adoc` and `*.asciidoc` files
augroup asciidoctor
au!
au BufEnter *.adoc,*.asciidoc call AsciidoctorMappings()
augroup END
"}}}