summaryrefslogtreecommitdiff
path: root/.vim/ftplugin/latex.vim
diff options
context:
space:
mode:
Diffstat (limited to '.vim/ftplugin/latex.vim')
-rw-r--r--.vim/ftplugin/latex.vim24
1 files changed, 24 insertions, 0 deletions
diff --git a/.vim/ftplugin/latex.vim b/.vim/ftplugin/latex.vim
new file mode 100644
index 0000000..a218cc7
--- /dev/null
+++ b/.vim/ftplugin/latex.vim
@@ -0,0 +1,24 @@
+" some general options
+ set ai " autoindent
+ set et " expandtab
+ set ts=2 " tabstop
+ set tw=85 " textwidth
+
+" compile tex-files with latex
+ set makeprg=latex\ %
+
+" Inserting pairs of quotes:
+ imap Y" ``''<Left><Left>
+
+" Some mappings for often used commands
+ iab ,b \begin{}<Esc>i
+ iab ,e \end{}<Esc>i
+
+" A mapping for more effective use of latex compiling
+ map <F7> : call CompileRunPDF()<CR>
+ func! CompileRunPDF()
+ exec "w"
+ exec "!latex % && dvipdf %<.dvi && xpdf %<.pdf"
+ exec "i"
+ endfunc
+