summaryrefslogtreecommitdiffstats
path: root/vim
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2013-11-21 13:40:50 -0500
committerJesse Luehrs <doy@tozt.net>2013-12-11 17:14:29 -0500
commit095ed623acb5e945b7d0a1ede983b0d1d1abc0b2 (patch)
treef4e36bdcde98edaad9ba34d37c5e16408759ae1e /vim
parentaf7e0bdc47f7840b395e04074b47b0934e96b060 (diff)
downloadconf-095ed623acb5e945b7d0a1ede983b0d1d1abc0b2.tar.gz
conf-095ed623acb5e945b7d0a1ede983b0d1d1abc0b2.zip
automake for latex editing (to update the pdf display)
Diffstat (limited to 'vim')
-rw-r--r--vim/ftplugin/tex.vim14
1 files changed, 14 insertions, 0 deletions
diff --git a/vim/ftplugin/tex.vim b/vim/ftplugin/tex.vim
index dedfe76..827f95d 100644
--- a/vim/ftplugin/tex.vim
+++ b/vim/ftplugin/tex.vim
@@ -28,6 +28,16 @@ function! s:make_errors()
endfor
return 0
endfunction
+let b:automake_enabled = 0
+function! s:automake()
+ let old_shellpipe = &shellpipe
+ let &shellpipe = '>'
+ try
+ silent make!
+ finally
+ let &shellpipe = old_shellpipe
+ endtry
+endfunction
augroup _tex
autocmd!
if executable('xpdf') && strlen(expand('$DISPLAY'))
@@ -35,8 +45,12 @@ if executable('xpdf') && strlen(expand('$DISPLAY'))
elseif executable('evince') && strlen(expand('$DISPLAY'))
autocmd QuickFixCmdPost make if !s:make_errors() | call s:evince() | endif
endif
+autocmd CursorHold,CursorHoldI,InsertLeave <buffer> if b:automake_enabled | call s:automake() | endif
augroup END
+noremap <silent><F6> :let b:automake_enabled = !b:automake_enabled<CR><F5>
+inoremap <silent><F6> <C-O>:let b:automake_enabled = !b:automake_enabled<CR><C-O><F5>
+
" see :help errorformat-LaTeX
setlocal errorformat=
\%E!\ LaTeX\ %trror:\ %m,