diff options
Diffstat (limited to 'stow/vim/.vim/ftplugin/tex')
-rw-r--r-- | stow/vim/.vim/ftplugin/tex/snips/template.txt | 30 | ||||
-rw-r--r-- | stow/vim/.vim/ftplugin/tex/tex.vim | 45 |
2 files changed, 75 insertions, 0 deletions
diff --git a/stow/vim/.vim/ftplugin/tex/snips/template.txt b/stow/vim/.vim/ftplugin/tex/snips/template.txt new file mode 100644 index 0000000..1f4bd46 --- /dev/null +++ b/stow/vim/.vim/ftplugin/tex/snips/template.txt @@ -0,0 +1,30 @@ +\documentclass{article} + +\usepackage{geometry} +\usepackage{graphicx} +\usepackage{booktabs} + +\geometry{left=4.5cm,top=2cm,bottom=2cm,right=4.5cm} + +\renewcommand{\contentsname}{Contenidos} +\renewcommand{\figurename}{Figura} + +\begin{document} + +\frenchspacing + +\title{<+++>} + +\author{<++>} + +\date{} + +\maketitle + +\tableofcontents + +\section{<++>} + +<++> + +\end{document} diff --git a/stow/vim/.vim/ftplugin/tex/tex.vim b/stow/vim/.vim/ftplugin/tex/tex.vim new file mode 100644 index 0000000..87f3c88 --- /dev/null +++ b/stow/vim/.vim/ftplugin/tex/tex.vim @@ -0,0 +1,45 @@ +" ~/.vim/ftplugin/tex.vim +" LaTeX-specific vim configuration + +" Syntastic linters: chktex, lacheck, proselint + +call matchadd('ColorColumn', '\%91v', 100) +setlocal textwidth=80 + +let mapleader = " " + +nnoremap <buffer> <leader>C :sp ~/.vim/ftplugin/tex/tex.vim<CR> +nnoremap <buffer> <leader>e :Errors<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><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>k<<i<Tab><Esc>$a<Space> +inoremap <buffer> <leader>litemize \begin{itemize}<Esc>o<Enter><Enter><Enter>\end{itemize}<Esc>kkI\item<Enter><Esc>I<Tab><++><Esc>k<<i<Tab><Esc>$a<Space> +inoremap <buffer> <leader>litem \item<Enter><++><Esc>k$a<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]{\centering<Enter>\centering<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 |