From fd8a737134eb92e204aa632731ea303fed1dc1b0 Mon Sep 17 00:00:00 2001 From: 0scar Date: Wed, 22 Mar 2023 12:04:48 +0100 Subject: Update tex vim ftplugin --- .config/vim/ftplugin/tex.vim | 51 +++++++++++++++++++++++++++++++++++--------- 1 file changed, 41 insertions(+), 10 deletions(-) (limited to '.config/vim/ftplugin') diff --git a/.config/vim/ftplugin/tex.vim b/.config/vim/ftplugin/tex.vim index 98a9e75..a4333a6 100644 --- a/.config/vim/ftplugin/tex.vim +++ b/.config/vim/ftplugin/tex.vim @@ -5,7 +5,9 @@ function! GetMainDoc() else " Find the main document file " Must be in the same folder of the current file - let l:maindocs = split(system("grep -lE '\\begin{document}' " . expand('%:h') . "/*.tex"), '\n') + let l:maindocscmd = "grep -lrE '\\\\begin{document}' " . expand('%:h') . "/*.tex" + let l:maindocssys = system(l:maindocscmd) + let l:maindocs = split(l:maindocssys) if len(l:maindocs) > 0 " Use the first document containing `begin{document}` return l:maindocs[0] @@ -24,11 +26,14 @@ endfunction function! Synctex() " remove 'silent' for debugging - let l:doc = GetMainDoc() execute "silent !mv -u latex.out/" . substitute(l:doc, '\.tex', '') . ".synctex.gz ." - execute "silent !zathura --synctex-forward " . line('.') . ":" . col('.') . ":" . bufname('%') . " " . expand('%:t:r') . ".pdf" + execute "silent !zathura --synctex-forward " . line('.') . ":" . col('.') . ":" . bufname('%') . " " . g:syncpdf redraw! endfunction +nmap :call Synctex() + +setlocal spell +setlocal spelllang=en_us imap FTT \texttt{}i imap FBF \textbf{}i @@ -39,6 +44,38 @@ imap MBF \mathbf{}i imap MIT \mathit{}i imap MSC \mathsc{}i +imap (( \left(\right)F\i +imap {{ \left\{\right\}F\F\i +imap [[ \left[\right]F\i + +imap ~~ \neg +imap /\ \land +imap \/ \lor +imap -> \rightarrow +imap ==> \Rightarrow +imap <== \Leftarrow +imap <=> \Leftrightarrow +imap \|- \vdash +imap \|= \vDash +imap !-- \inference[]{%}{%}kk$F[a +imap !== \begin{align*}\end{align*}O +imap !ii \begin{itemize}\end{itemize}O\item Case +imap CC \item Case +imap EIMP \expEimp{<++>}{<++>}{<++>}F\ +imap [[ [\![ +imap ]] ]\!] + +imap CI $\land\mbox{I}$ +imap CE1 $\land\mbox{E}_1$ +imap CE2 $\land\mbox{E}_2$ +imap DI1 $\lor\mbox{I}_1$ +imap DI2 $\lor\mbox{I}_2$ +imap DE $\lor\mbox{E}$ +imap II $\Rightarrow\mbox{I}$ +imap IE $\Rightarrow\mbox{E}$ +imap NE $\neg\mbox{E}$ +imap NI $\neg\mbox{I}$ + imap MCC \mathcal{}<++>T{i inoremap /<++>cf> @@ -53,13 +90,7 @@ vnoremap `mt `>a}` " put \begin{} \end{} tags tags around the current word vnoremap YpkI\begin{A}jI\end{A}kA -nmap :call Synctex() -"setlocal spell spelllang=en_US +syntax sync minlines=10000 call CompileMainDoc() - -" autocmd BufRead *.tex imap /\ \land -" autocmd BufRead *.tex imap \/ \lor -" autocmd BufRead *.tex imap -> \rightarrow -" autocmd BufRead *.tex imap ~~ \neg -- cgit v1.3