From d3e69e7311187f907bdfc67d60cc51c9ada19bef Mon Sep 17 00:00:00 2001 From: surtur Date: Sun, 30 Oct 2022 03:17:47 +0100 Subject: [PATCH] vimrc: add latex-compiling funcs/maps --- .vim/vimrc | 47 +++++++++++++++++++++++++++++++++++++---------- 1 file changed, 37 insertions(+), 10 deletions(-) diff --git a/.vim/vimrc b/.vim/vimrc index 90955d8..4eb6ba2 100644 --- a/.vim/vimrc +++ b/.vim/vimrc @@ -548,20 +548,47 @@ nnoremap :TagbarToggle vmap gb :!git blame % -L=line("'<") ,=line("'>") nnoremap gb :!git blame % " ll provided by vimtex -nnoremap kk :w! !pdflatex -shell-escape -interaction=nonstopmode $PWD/*.tex -:function Pdfpls() - :echom "compiling ur tex goodness!" - :w! - :!pdflatex -shell-escape -interaction=nonstopmode $PWD/*.tex +" nnoremap kk :w! !pdflatex -shell-escape -interaction=nonstopmode ./*.tex +function! Pdfpls() + echom 'compiling ur tex goodness!' + " w! + :!pdflatex -shell-escape -interaction=nonstopmode ./*.tex :!bibtex $PWD/*.aux - :!pdflatex -shell-escape -interaction=nonstopmode $PWD/*.tex -:endfunction + :!pdflatex -shell-escape -interaction=nonstopmode ./*.tex +endfunction + +function! PdfLuapls() + echom 'compiling ur tex goodness!' + " w! + :!lualatex -shell-escape -interaction=nonstopmode ./*.tex + :!bibtex $PWD/*.aux + " :!lualatex -shell-escape -interaction=nonstopmode ./*.tex +endfunction + +function! PdfBibLuapls() + " https://tex.stackexchange.com/a/308565 + " echom "compiling ur tex goodness!" + " :!mkdir -p build + " :!lualatex -output-directory=build -shell-escape -interaction=nonstopmode ./*.tex + " :!cp *.bib build + " :!cd build + " :!bibtex %:r + " :!cd .. + " :!lualatex -output-directory=build -shell-escape -interaction=nonstopmode ./*.tex + " :!mv build/*.pdf . + :!lualatex -shell-escape -interaction=nonstopmode ./*.tex + :!bibtex ./*.aux + :!lualatex -shell-escape -interaction=nonstopmode ./*.tex +endfunction + +" nnoremap lb :call Pdfpls() +" nnoremap lb :call PdfLuapls() +" nnoremap lb :call PdfLuapls() +nnoremap lb :call PdfBibLuapls() + -nnoremap lb :call Pdfpls() nnoremap l :exec &conceallevel ? "set conceallevel=0" : "set conceallevel=1" -" toggle GitGutterLineHighlights -nnoremap d :GitGutterLineHighlightsToggle " ALE bindings nmap :ALEPreviousWrap