blob: 3558c39d71f9f51b8b58e38491c7f8d6780b8c71 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
" ~/.vim/ftplugin/tex.vim
" LaTeX-specific vim configuration
" Syntastic linters: chktex, lacheck, proselint
call matchadd('ColorColumn', '\%91v', 100)
setlocal textwidth=80
setlocal omnifunc=v:lua.vim.lsp.omnifunc
" setlocal formatexpr=v:lua.vim.lsp.formatexpr()
let mapleader = " "
nnoremap <buffer> <leader>C :sp ~/.vim/ftplugin/tex/tex.vim<CR>
nnoremap <buffer> <leader>e :Errors<CR>
nnoremap <buffer> K :lua vim.lsp.buf.hover()<CR>
nnoremap <buffer> gd :lua vim.lsp.buf.definition()<CR>
" proselint not enabled by default (it's slow)
"nnoremap <buffer> <leader>sp :SyntasticCheck proselint<CR>
nnoremap <buffer> <leader>c :w<Enter>:!toPDF.sh %<CR><CR>
nnoremap <buffer> <leader>o :w<Enter>:!toPDF.sh -o %<CR><CR>
nnoremap <buffer> <leader>O :w<Enter>:!toPDF.sh -o %<CR>
nnoremap <buffer> <leader>m :w<Enter>:Make<CR>
nnoremap <buffer> <leader>temp :-1r ~/.vim/ftplugin/tex/snips/template.txt<CR>/<+++><CR>cf>
let mapleader = ","
inoremap <buffer> <leader>ldocclass \documentclass{}<Esc>o<++><Esc>k$i
inoremap <buffer> <leader>lpckg \usepackage{}<Esc>o<++><Esc>k$i
inoremap <buffer> <leader>lbdoc \begin{document}<Esc>o<Enter><Enter><Enter>\end{document}<Esc>kkI
inoremap <buffer> <leader>lauthor \author{}<Esc>o<++><Esc>k$i
inoremap <buffer> <leader>ltitle \title{}<Esc>o<++><Esc>k$i
inoremap <buffer> <leader>lsection \section{}<Esc>o<++><Esc>k$i
inoremap <buffer> <leader>lssection \subsection{}<Esc>o<++><Esc>k$i
inoremap <buffer> <leader>lsssection \subsubsection{}<Esc>o<++><Esc>k$i
inoremap <buffer> <leader>lssssection \paragraph{}<Esc>o<++><Esc>k$i
inoremap <buffer> <leader>lsssssection \subparagraph{}<Esc>o<++><Esc>k$i
inoremap <buffer> <leader>lb \textbf{}<++><Esc>F}i
inoremap <buffer> <leader>li \textit{}<++><Esc>F}i
inoremap <buffer> <leader>lemph \emph{}<++><Esc>F}i
inoremap <buffer> <leader>llabel \label{}<++><Esc>F}i
inoremap <buffer> <leader>lref ~\ref{}<++><Esc>F}i
inoremap <buffer> <leader>lenumerate \begin{enumerate}<Esc>o<Enter><Enter><Enter>\end{enumerate}<Esc>kkI\item<Enter><Esc>I<Tab><++><Esc>kA<Space>
inoremap <buffer> <leader>litemize \begin{itemize}<Esc>o<Enter><Enter><Enter>\end{itemize}<Esc>kkI\item<Enter><Esc>I<Tab><++><Esc>kA<Space>
inoremap <buffer> <leader>litem \item<Enter><++><Esc>kA<Space>
inoremap <buffer> <leader>limage \begin{figure}[h]<Enter>\begin{center}<Enter>\includegraphics[width=\textwidth]{}<Enter>\caption{<++>}<Enter>\end{center}<Enter>\end{figure}<Enter><++><Esc>4k$i
inoremap <buffer> <leader>ltable \begin{table}[h]<Enter>\makebox[\linewidth]{<Enter>\begin{tabular}{c<Space>cxxx}<Enter>\toprule<Enter><++><Space>&<Space><++><Space>\\<Enter>\midrule<Enter><++><Space>&<Space><++><Space>\\<Enter>\bottomrule<Enter>\end{tabular}<Enter>}<Enter>\end{table}<Enter><++><Esc>?xxx<Enter>cw
|