aboutsummaryrefslogtreecommitdiff
path: root/config/nvim/after/ftplugin/tex.vim
diff options
context:
space:
mode:
authorryo <ryo@nopwd.lol>2024-10-30 20:10:03 +0000
committerryo <ryo@nopwd.lol>2024-10-30 20:10:03 +0000
commitcc6d6fcfc6e8403e87dae9f092e61f0edf8e3cc6 (patch)
treef7f751a92c30b5ef7cf8770004c30479c516fdca /config/nvim/after/ftplugin/tex.vim
Initial commit
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=""