aboutsummaryrefslogtreecommitdiff
path: root/config/nvim/after/ftplugin/tex.vim
diff options
context:
space:
mode:
Diffstat (limited to 'config/nvim/after/ftplugin/tex.vim')
-rw-r--r--config/nvim/after/ftplugin/tex.vim17
1 files changed, 17 insertions, 0 deletions
diff --git a/config/nvim/after/ftplugin/tex.vim b/config/nvim/after/ftplugin/tex.vim
new file mode 100644
index 0000000..361d1eb
--- /dev/null
+++ b/config/nvim/after/ftplugin/tex.vim
@@ -0,0 +1,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=""