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)
let cssopts = "-c pandoc.css"
endif
- execute ":!pandoc " . cssopts . " --self-contained --toc " . @% . " -o " . @% . ".html"
+ execute ":!pandoc " . cssopts . " --self-contained --toc '" . @% . "' -o '" . @% . "'.html"
endfunction
+
function RunMarkdownpy(prog)
execute ":!" . a:prog . " " . @% . " > " . @% . ".html"
endfunction
+
+function RunAsciidoctor()
+ execute ":!asciidoctor " . @%
+endfunction
+
+
function RunMarkdown()
if executable("pandoc")
call RunPandoc()
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
+ elseif has('unix')
+ if filereadable('/sys/class/power_supply/AC/online')
+ return readfile('/sys/class/power_supply/AC/online') == ['0']
+ endif
+ endif
+ return 0
+endfunction
+
+
if filereadable($HOME . '/.vim/macros-local.vim')
source ~/.vim/macros-local.vim
endif