aboutsummaryrefslogtreecommitdiff
path: root/config/nvim/after/ftplugin/tex.vim
blob: 361d1eb9acd60d9a2c0645ea8ea983801d79396e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
function SetLatexVar()
	if !exists('b:compit')
		let b:compit = 1
	else
		unlet b:compit
	endif
endfunction
function LatexCompile()
	if exists('b:compit')
		call system('pdflatex ' .. expand('%'))
	endif
endfunction
nmap <buffer> <Leader>z <cmd>call system("zathura " .. expand("%:r") .. ".pdf &")<cr>
nmap <buffer> <Leader>l <Cmd>call SetLatexVar()<Cr>
imap <buffer> 'l <esc>byei\begin{<esc>A}<cr>\end{}<esc>hpO
au BufWritePost <buffer> call LatexCompile()
setlocal indentexpr=""