execute ':%s/²/\^2/&'
endfunction
+function! s:texTableBfEntries()
+ execute 's/\( *\)\([^ &][^&]*[^ &]\)\( \+\)/\1\\textbf{\2}\3/g'
+endfunction
+
+command! -range TexTableBfEntries call s:texTableBfEntries()
"Open current file with a specific program
function OpenIn(prog)
function InsertIncludeGuardsWithoutEndif()
- let gatename = substitute(expand("%:t"), "\\.", "_", "g") . '_' . strpart(system('pwgen -c 16 1'), 0, 16)
- execute "normal! i#ifndef " . gatename
- execute "normal! o#define " . gatename
+ " Build name of guard: Take filename, replace some chars by _ and
+ " prepend a random sequence to make guard robust against file name
+ " collisions.
+ let guardname = substitute(expand("%:t"), "[\\.-]", "_", "g") . '_' . strpart(system('pwgen -c 16 1'), 0, 16)
+ execute "normal! i#ifndef " . guardname
+ execute "normal! o#define " . guardname
endfunction
function RunAsciidoctor()
execute ":!asciidoctor " . @%
+ if executable("asciidoctor-pdf")
+ execute ":!asciidoctor-pdf " . @%
+ elseif executable("asciidoctor")
+ execute ":!asciidoctor " . @%
+ endif
+endfunction
+
+function RunAsciidoctorPdf()
+ execute ":!asciidoctor-pdf " . @%
endfunction
function RunAsciidoc()
- if executable("asciidoctor")
+ if executable("asciidoctor-pdf")
+ call RunAsciidoctorPdf()
+ elseif executable("asciidoctor")
call RunAsciidoctor()
else
echo "No asciidoc implementation found."