projects
/
vimconf.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
neomake: Battery-dependent config
[vimconf.git]
/
macros.vim
diff --git
a/macros.vim
b/macros.vim
index cba6b844c37b1578f3d811bac9626e10b69e0e0a..58599670c737d4e4f01f920551b31a873f571155 100644
(file)
--- a/
macros.vim
+++ b/
macros.vim
@@
-96,10
+96,12
@@
function RunPandoc()
execute ":!pandoc " . cssopts . " --self-contained --toc '" . @% . "' -o '" . @% . "'.html"
endfunction
execute ":!pandoc " . cssopts . " --self-contained --toc '" . @% . "' -o '" . @% . "'.html"
endfunction
+
function RunMarkdownpy(prog)
execute ":!" . a:prog . " " . @% . " > " . @% . ".html"
endfunction
function RunMarkdownpy(prog)
execute ":!" . a:prog . " " . @% . " > " . @% . ".html"
endfunction
+
function RunMarkdown()
if executable("pandoc")
call RunPandoc()
function RunMarkdown()
if executable("pandoc")
call RunPandoc()
@@
-113,6
+115,16
@@
function RunMarkdown()
endfunction
endfunction
+function OnBattery()
+ if has('macunix')
+ return match(system('pmset -g batt'), "Now drawing from 'Battery Power'") != -1
+ elseif has('unix')
+ return readfile('/sys/class/power_supply/AC/online') == ['0']
+ endif
+ return 0
+endfunction
+
+
if filereadable($HOME . '/.vim/macros-local.vim')
source ~/.vim/macros-local.vim
endif
if filereadable($HOME . '/.vim/macros-local.vim')
source ~/.vim/macros-local.vim
endif