dotfiles

configuration files for shell, text editor, graphical environment, etc.
git clone git://src.adamsgaard.dk/dotfiles
Log | Files | Refs | README | LICENSE Back to index

commit 9d76d5a8f35a433902c7fede8a37ad720373a2bf
parent e12c1063c19554db5bea938c5f546f5c453e2a62
Author: Anders Damsgaard Christensen <adc@geo.au.dk>
Date:   Sun, 28 Oct 2012 10:16:29 +0100

Added .vim

Diffstat:
A.vim/.DS_Store | 0
A.vim/._.DS_Store | 0
A.vim/._compiler | 0
A.vim/._doc | 0
A.vim/._ftplugin | 0
A.vim/._indent | 0
A.vim/._license.txt | 0
A.vim/._syntax | 0
A.vim/.netrwhist | 6++++++
A.vim/Makefile | 30++++++++++++++++++++++++++++++
A.vim/Makefile.in | 133+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/autoload/pathogen.vim | 245+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/bundle/vim-powerline | 1+
A.vim/compiler/._mlint.vim | 0
A.vim/compiler/mlint.vim | 44++++++++++++++++++++++++++++++++++++++++++++
A.vim/compiler/tex.vim | 294+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/doc/._matlab.txt | 0
A.vim/doc/._vcscommand.txt | 0
A.vim/doc/Makefile | 62++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/doc/Makefile.in | 29+++++++++++++++++++++++++++++
A.vim/doc/README | 110+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/doc/README.new | 17+++++++++++++++++
A.vim/doc/catalog.xml | 12++++++++++++
A.vim/doc/imaps.txt | 116+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/doc/latex-suite-chunk.xsl | 52++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/doc/latex-suite-common.xsl | 64++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/doc/latex-suite-quickstart.css | 182+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/doc/latex-suite-quickstart.html | 353+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/doc/latex-suite-quickstart.txt | 448+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/doc/latex-suite-quickstart.xml | 471+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/doc/latex-suite-quickstart/index.html | 8++++++++
A.vim/doc/latex-suite-quickstart/lsq-compiling.html | 21+++++++++++++++++++++
A.vim/doc/latex-suite-quickstart/lsq-conclusions.html | 9+++++++++
A.vim/doc/latex-suite-quickstart/lsq-debugging.html | 26++++++++++++++++++++++++++
A.vim/doc/latex-suite-quickstart/lsq-folding.html | 49+++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/doc/latex-suite-quickstart/lsq-insert-environment.html | 20++++++++++++++++++++
A.vim/doc/latex-suite-quickstart/lsq-inserting-reference.html | 66++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/doc/latex-suite-quickstart/lsq-inserting-template.html | 31+++++++++++++++++++++++++++++++
A.vim/doc/latex-suite-quickstart/lsq-keyboard-shortcuts.html | 34++++++++++++++++++++++++++++++++++
A.vim/doc/latex-suite-quickstart/lsq-lsq-inserting-package.html | 34++++++++++++++++++++++++++++++++++
A.vim/doc/latex-suite-quickstart/lsq-quick-forward-searching.html | 25+++++++++++++++++++++++++
A.vim/doc/latex-suite-quickstart/lsq-quick-inverse-searching.html | 25+++++++++++++++++++++++++
A.vim/doc/latex-suite-quickstart/lsq-using-tutorial.html | 20++++++++++++++++++++
A.vim/doc/latex-suite-quickstart/lsq-viewing-dvi.html | 11+++++++++++
A.vim/doc/latex-suite.css | 182+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/doc/latex-suite.html | 2673+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/doc/latex-suite.txt | 3460+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/doc/latex-suite.xml | 4665+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/doc/latex-suite.xsl | 24++++++++++++++++++++++++
A.vim/doc/latex-suite/altkey-mappings.html | 66++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/doc/latex-suite/auc-tex-mappings.html | 38++++++++++++++++++++++++++++++++++++++
A.vim/doc/latex-suite/automatic-package-detection.html | 51+++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/doc/latex-suite/bibtex-bindings.html | 84+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/doc/latex-suite/compiler-dependency.html | 40++++++++++++++++++++++++++++++++++++++++
A.vim/doc/latex-suite/compiler-output-customization.html | 41+++++++++++++++++++++++++++++++++++++++++
A.vim/doc/latex-suite/compiler-rules.html | 22++++++++++++++++++++++
A.vim/doc/latex-suite/compiling-multiple.html | 55+++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/doc/latex-suite/custom-macros-menu.html | 39+++++++++++++++++++++++++++++++++++++++
A.vim/doc/latex-suite/customizing-compiling.html | 88+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/doc/latex-suite/customizing-folding.html | 13+++++++++++++
A.vim/doc/latex-suite/customizing-latex-completion.html | 43+++++++++++++++++++++++++++++++++++++++++++
A.vim/doc/latex-suite/customizing-latex-suite.html | 21+++++++++++++++++++++
A.vim/doc/latex-suite/customizing-macros.html | 140+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/doc/latex-suite/customizing-menus.html | 40++++++++++++++++++++++++++++++++++++++++
A.vim/doc/latex-suite/customizing-packages.html | 13+++++++++++++
A.vim/doc/latex-suite/customizing-place-holders.html | 27+++++++++++++++++++++++++++
A.vim/doc/latex-suite/customizing-smart-keys.html | 18++++++++++++++++++
A.vim/doc/latex-suite/customizing-viewing.html | 65+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/doc/latex-suite/customizing-what-to-fold.html | 129+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/doc/latex-suite/default-folding.html | 18++++++++++++++++++
A.vim/doc/latex-suite/diacritic-mappings.html | 17+++++++++++++++++
A.vim/doc/latex-suite/editing-folding.html | 100+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/doc/latex-suite/environment-mappings.html | 118+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/doc/latex-suite/font-maps.html | 21+++++++++++++++++++++
A.vim/doc/latex-suite/forward-searching.html | 27+++++++++++++++++++++++++++
A.vim/doc/latex-suite/greek-letter-mappings.html | 19+++++++++++++++++++
A.vim/doc/latex-suite/index.html | 17+++++++++++++++++
A.vim/doc/latex-suite/inserting-packages.html | 30++++++++++++++++++++++++++++++
A.vim/doc/latex-suite/inverse-searching.html | 23+++++++++++++++++++++++
A.vim/doc/latex-suite/latex-command-maps.html | 37+++++++++++++++++++++++++++++++++++++
A.vim/doc/latex-suite/latex-compiling.html | 33+++++++++++++++++++++++++++++++++
A.vim/doc/latex-suite/latex-completion-cite.html | 113+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/doc/latex-suite/latex-completion.html | 36++++++++++++++++++++++++++++++++++++
A.vim/doc/latex-suite/latex-folding.html | 34++++++++++++++++++++++++++++++++++
A.vim/doc/latex-suite/latex-macros.html | 70++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/doc/latex-suite/latex-master-file.html | 31+++++++++++++++++++++++++++++++
A.vim/doc/latex-suite/latex-packages.html | 18++++++++++++++++++
A.vim/doc/latex-suite/latex-project-settings.html | 11+++++++++++
A.vim/doc/latex-suite/latex-project.html | 57+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/doc/latex-suite/latex-suite-commands-maps.html | 6++++++
A.vim/doc/latex-suite/latex-suite-commands.html | 148+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/doc/latex-suite/latex-suite-credits.html | 80+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/doc/latex-suite/latex-suite-maps.html | 52++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/doc/latex-suite/latex-suite-templates.html | 31+++++++++++++++++++++++++++++++
A.vim/doc/latex-suite/latex-viewing-rules.html | 31+++++++++++++++++++++++++++++++
A.vim/doc/latex-suite/latex-viewing.html | 2++
A.vim/doc/latex-suite/ls-completion-custom.html | 22++++++++++++++++++++++
A.vim/doc/latex-suite/ls-completion-ref.html | 63+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/doc/latex-suite/ls-completion-usage.html | 78++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/doc/latex-suite/ls-filename-completion.html | 21+++++++++++++++++++++
A.vim/doc/latex-suite/ls-general-purpose-settings.html | 18++++++++++++++++++
A.vim/doc/latex-suite/ls-new-macros.html | 154+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/doc/latex-suite/package-actions.html | 38++++++++++++++++++++++++++++++++++++++
A.vim/doc/latex-suite/part-compiling.html | 26++++++++++++++++++++++++++
A.vim/doc/latex-suite/recommended-settings.html | 42++++++++++++++++++++++++++++++++++++++++++
A.vim/doc/latex-suite/section-mappings.html | 29+++++++++++++++++++++++++++++
A.vim/doc/latex-suite/smart-keys.html | 24++++++++++++++++++++++++
A.vim/doc/latex-suite/supporting-packages.html | 61+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/doc/latexhelp.txt | 2430+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/doc/matlab.txt | 111+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/doc/tags | 1001+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/doc/vcscommand.txt | 843+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/ftplugin/.DS_Store | 0
A.vim/ftplugin/._.DS_Store | 0
A.vim/ftplugin/._matlab.vim | 0
A.vim/ftplugin/bib_latexSuite.vim | 16++++++++++++++++
A.vim/ftplugin/latex-suite/.DS_Store | 0
A.vim/ftplugin/latex-suite/._.DS_Store | 0
A.vim/ftplugin/latex-suite/bibtex.vim | 266+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/ftplugin/latex-suite/bibtools.py | 221+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/ftplugin/latex-suite/brackets.vim | 145+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/ftplugin/latex-suite/compiler.vim | 871+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/ftplugin/latex-suite/custommacros.vim | 256+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/ftplugin/latex-suite/diacritics.vim | 124+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/ftplugin/latex-suite/dictionaries/SIunits | 289++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/ftplugin/latex-suite/dictionaries/dictionary | 677+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/ftplugin/latex-suite/elementmacros.vim | 330+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/ftplugin/latex-suite/envmacros.vim | 1166+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/ftplugin/latex-suite/folding.vim | 395+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/ftplugin/latex-suite/macros/example | 11+++++++++++
A.vim/ftplugin/latex-suite/main.vim | 1042+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/ftplugin/latex-suite/mathmacros-utf.vim | 729+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/ftplugin/latex-suite/mathmacros.vim | 730+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/ftplugin/latex-suite/multicompile.vim | 17+++++++++++++++++
A.vim/ftplugin/latex-suite/outline.py | 194+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/ftplugin/latex-suite/packages.vim | 677+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/ftplugin/latex-suite/packages/SIunits | 315+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/ftplugin/latex-suite/packages/accents | 28++++++++++++++++++++++++++++
A.vim/ftplugin/latex-suite/packages/acromake | 10++++++++++
A.vim/ftplugin/latex-suite/packages/afterpage | 10++++++++++
A.vim/ftplugin/latex-suite/packages/alltt | 12++++++++++++
A.vim/ftplugin/latex-suite/packages/amsmath | 106+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/ftplugin/latex-suite/packages/amsthm | 21+++++++++++++++++++++
A.vim/ftplugin/latex-suite/packages/amsxtra | 12++++++++++++
A.vim/ftplugin/latex-suite/packages/arabic | 10++++++++++
A.vim/ftplugin/latex-suite/packages/array | 17+++++++++++++++++
A.vim/ftplugin/latex-suite/packages/babel | 98+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/ftplugin/latex-suite/packages/bar | 27+++++++++++++++++++++++++++
A.vim/ftplugin/latex-suite/packages/biblatex | 159+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/ftplugin/latex-suite/packages/bm | 10++++++++++
A.vim/ftplugin/latex-suite/packages/bophook | 12++++++++++++
A.vim/ftplugin/latex-suite/packages/boxedminipage | 10++++++++++
A.vim/ftplugin/latex-suite/packages/caption2 | 43+++++++++++++++++++++++++++++++++++++++++++
A.vim/ftplugin/latex-suite/packages/cases | 12++++++++++++
A.vim/ftplugin/latex-suite/packages/ccaption | 20++++++++++++++++++++
A.vim/ftplugin/latex-suite/packages/changebar | 35+++++++++++++++++++++++++++++++++++
A.vim/ftplugin/latex-suite/packages/chapterbib | 24++++++++++++++++++++++++
A.vim/ftplugin/latex-suite/packages/cite | 32++++++++++++++++++++++++++++++++
A.vim/ftplugin/latex-suite/packages/color | 43+++++++++++++++++++++++++++++++++++++++++++
A.vim/ftplugin/latex-suite/packages/comma | 12++++++++++++
A.vim/ftplugin/latex-suite/packages/csquotes | 104+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/ftplugin/latex-suite/packages/deleq | 36++++++++++++++++++++++++++++++++++++
A.vim/ftplugin/latex-suite/packages/drftcite | 29+++++++++++++++++++++++++++++
A.vim/ftplugin/latex-suite/packages/dropping | 12++++++++++++
A.vim/ftplugin/latex-suite/packages/enumerate | 10++++++++++
A.vim/ftplugin/latex-suite/packages/eqlist | 19+++++++++++++++++++
A.vim/ftplugin/latex-suite/packages/eqparbox | 12++++++++++++
A.vim/ftplugin/latex-suite/packages/everyshi | 10++++++++++
A.vim/ftplugin/latex-suite/packages/exmpl | 55+++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/ftplugin/latex-suite/packages/fixme | 42++++++++++++++++++++++++++++++++++++++++++
A.vim/ftplugin/latex-suite/packages/flafter | 10++++++++++
A.vim/ftplugin/latex-suite/packages/float | 16++++++++++++++++
A.vim/ftplugin/latex-suite/packages/floatflt | 12++++++++++++
A.vim/ftplugin/latex-suite/packages/fn2end | 10++++++++++
A.vim/ftplugin/latex-suite/packages/footmisc | 21+++++++++++++++++++++
A.vim/ftplugin/latex-suite/packages/geometry | 93+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/ftplugin/latex-suite/packages/german | 12++++++++++++
A.vim/ftplugin/latex-suite/packages/graphicx | 69+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/ftplugin/latex-suite/packages/graphpap | 10++++++++++
A.vim/ftplugin/latex-suite/packages/harpoon | 18++++++++++++++++++
A.vim/ftplugin/latex-suite/packages/hhline | 21+++++++++++++++++++++
A.vim/ftplugin/latex-suite/packages/histogram | 13+++++++++++++
A.vim/ftplugin/latex-suite/packages/hyperref | 167+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/ftplugin/latex-suite/packages/ifthen | 21+++++++++++++++++++++
A.vim/ftplugin/latex-suite/packages/inputenc | 29+++++++++++++++++++++++++++++
A.vim/ftplugin/latex-suite/packages/letterspace | 10++++++++++
A.vim/ftplugin/latex-suite/packages/lineno | 60++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/ftplugin/latex-suite/packages/longtable | 35+++++++++++++++++++++++++++++++++++
A.vim/ftplugin/latex-suite/packages/lscape | 10++++++++++
A.vim/ftplugin/latex-suite/packages/manyfoot | 15+++++++++++++++
A.vim/ftplugin/latex-suite/packages/moreverb | 28++++++++++++++++++++++++++++
A.vim/ftplugin/latex-suite/packages/multibox | 10++++++++++
A.vim/ftplugin/latex-suite/packages/multicol | 21+++++++++++++++++++++
A.vim/ftplugin/latex-suite/packages/newalg | 26++++++++++++++++++++++++++
A.vim/ftplugin/latex-suite/packages/ngerman | 12++++++++++++
A.vim/ftplugin/latex-suite/packages/numprint | 18++++++++++++++++++
A.vim/ftplugin/latex-suite/packages/oldstyle | 12++++++++++++
A.vim/ftplugin/latex-suite/packages/outliner | 19+++++++++++++++++++
A.vim/ftplugin/latex-suite/packages/overcite | 34++++++++++++++++++++++++++++++++++
A.vim/ftplugin/latex-suite/packages/pagenote | 26++++++++++++++++++++++++++
A.vim/ftplugin/latex-suite/packages/parallel | 15+++++++++++++++
A.vim/ftplugin/latex-suite/packages/plain | 10++++++++++
A.vim/ftplugin/latex-suite/packages/plates | 16++++++++++++++++
A.vim/ftplugin/latex-suite/packages/polski | 165+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/ftplugin/latex-suite/packages/psgo | 27+++++++++++++++++++++++++++
A.vim/ftplugin/latex-suite/packages/schedule | 20++++++++++++++++++++
A.vim/ftplugin/latex-suite/packages/textfit | 12++++++++++++
A.vim/ftplugin/latex-suite/packages/times | 10++++++++++
A.vim/ftplugin/latex-suite/packages/tipa | 364+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/ftplugin/latex-suite/packages/ulem | 21+++++++++++++++++++++
A.vim/ftplugin/latex-suite/packages/url | 24++++++++++++++++++++++++
A.vim/ftplugin/latex-suite/packages/verbatim | 18++++++++++++++++++
A.vim/ftplugin/latex-suite/packages/version | 12++++++++++++
A.vim/ftplugin/latex-suite/projecttemplate.vim | 11+++++++++++
A.vim/ftplugin/latex-suite/pytools.py | 52++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/ftplugin/latex-suite/smartspace.vim | 102+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/ftplugin/latex-suite/templates.vim | 149+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/ftplugin/latex-suite/templates/IEEEtran.tex | 142+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/ftplugin/latex-suite/templates/article.tex | 99+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/ftplugin/latex-suite/templates/beamer_pres.tex | 202+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/ftplugin/latex-suite/templates/report.tex | 9+++++++++
A.vim/ftplugin/latex-suite/templates/report_two_column.tex | 9+++++++++
A.vim/ftplugin/latex-suite/texmenuconf.vim | 131+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/ftplugin/latex-suite/texproject.vim | 54++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/ftplugin/latex-suite/texrc | 751+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/ftplugin/latex-suite/texviewer.vim | 1069+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/ftplugin/latex-suite/version.vim | 30++++++++++++++++++++++++++++++
A.vim/ftplugin/latex-suite/wizardfuncs.vim | 376+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/ftplugin/matlab.vim | 70++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/ftplugin/tex.vim | 25+++++++++++++++++++++++++
A.vim/ftplugin/tex_latexSuite.vim | 34++++++++++++++++++++++++++++++++++
A.vim/hg.zip | 0
A.vim/indent/._matlab.vim | 0
A.vim/indent/matlab.vim | 146+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/indent/tex.vim | 141+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/latextags | 11+++++++++++
A.vim/license.txt | 24++++++++++++++++++++++++
A.vim/ltags | 78++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/plugin/._vcsbzr.vim | 0
A.vim/plugin/._vcscommand.vim | 0
A.vim/plugin/._vcscvs.vim | 0
A.vim/plugin/._vcsgit.vim | 0
A.vim/plugin/._vcshg.vim | 0
A.vim/plugin/._vcssccs.vim | 0
A.vim/plugin/._vcssvk.vim | 0
A.vim/plugin/._vcssvn.vim | 0
A.vim/plugin/SyntaxFolds.vim | 323+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/plugin/filebrowser.vim | 250+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/plugin/imaps.vim | 831+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/plugin/libList.vim | 249+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/plugin/remoteOpen.vim | 163+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/plugin/vcsbzr.vim | 264+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/plugin/vcscommand.vim | 1527+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/plugin/vcscvs.vim | 453+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/plugin/vcsgit.vim | 249+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/plugin/vcshg.vim | 335+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/plugin/vcssccs.vim | 345+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/plugin/vcssvk.vim | 259+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/plugin/vcssvn.vim | 281+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/skim-vim | 22++++++++++++++++++++++
A.vim/syntax/._HGAnnotate.vim | 0
A.vim/syntax/._SCCSAnnotate.vim | 0
A.vim/syntax/._cvsannotate.vim | 0
A.vim/syntax/._gitannotate.vim | 0
A.vim/syntax/._matlab.vim | 0
A.vim/syntax/._svkannotate.vim | 0
A.vim/syntax/._svnannotate.vim | 0
A.vim/syntax/._vcscommit.vim | 0
A.vim/syntax/HGAnnotate.vim | 41+++++++++++++++++++++++++++++++++++++++++
A.vim/syntax/SCCSAnnotate.vim | 38++++++++++++++++++++++++++++++++++++++
A.vim/syntax/arduino.vim | 58++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/syntax/cvsannotate.vim | 45+++++++++++++++++++++++++++++++++++++++++++++
A.vim/syntax/gitannotate.vim | 44++++++++++++++++++++++++++++++++++++++++++++
A.vim/syntax/matlab.vim | 357+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.vim/syntax/svkannotate.vim | 42++++++++++++++++++++++++++++++++++++++++++
A.vim/syntax/svnannotate.vim | 40++++++++++++++++++++++++++++++++++++++++
A.vim/syntax/vcscommit.vim | 31+++++++++++++++++++++++++++++++
A.vim/vimplugin.zip | 0
278 files changed, 42323 insertions(+), 0 deletions(-)

diff --git a/.vim/.DS_Store b/.vim/.DS_Store Binary files differ. diff --git a/.vim/._.DS_Store b/.vim/._.DS_Store Binary files differ. diff --git a/.vim/._compiler b/.vim/._compiler Binary files differ. diff --git a/.vim/._doc b/.vim/._doc Binary files differ. diff --git a/.vim/._ftplugin b/.vim/._ftplugin Binary files differ. diff --git a/.vim/._indent b/.vim/._indent Binary files differ. diff --git a/.vim/._license.txt b/.vim/._license.txt Binary files differ. diff --git a/.vim/._syntax b/.vim/._syntax Binary files differ. diff --git a/.vim/.netrwhist b/.vim/.netrwhist @@ -0,0 +1,6 @@ +let g:netrw_dirhistmax =10 +let g:netrw_dirhist_cnt =4 +let g:netrw_dirhist_1='/home/adc/code/simple_DEM/output' +let g:netrw_dirhist_2='/home/adc/.config/awesome' +let g:netrw_dirhist_3='/home/adc/.config/chromium' +let g:netrw_dirhist_4='/home/adc/code/dotfiles' diff --git a/.vim/Makefile b/.vim/Makefile @@ -0,0 +1,30 @@ +PREFIX = /usr/local +VIMDIR = $(PREFIX)/share/vim +BINDIR = $(PREFIX)/bin + +VERSION=1.8.23 +REVISION=$(shell svn info -r HEAD 2>/dev/null| head -n 5 | tail -n 1 | cut -d" " -f2) +DATE = $(shell date +%Y%m%d) + +SNAPSHOTNAME = vim-latex-$(VERSION)-$(DATE)-r$(REVISION) + +snapshot: + rm -rf -- ./$(SNAPSHOTNAME) + svn export -r HEAD . $(SNAPSHOTNAME) + make -C $(SNAPSHOTNAME)/doc + tar cvzf ./$(SNAPSHOTNAME).tar.gz ./$(SNAPSHOTNAME) + rm -rf -- ./$(SNAPSHOTNAME) + +install: + install -d "$(DESTDIR)$(VIMDIR)/doc" + install -m 0644 doc/*.txt "$(DESTDIR)$(VIMDIR)/doc" + + install -d "$(DESTDIR)$(VIMDIR)" + cp -R compiler ftplugin indent plugin "$(DESTDIR)$(VIMDIR)" + chmod 0755 "$(DESTDIR)$(VIMDIR)/ftplugin/latex-suite/outline.py" + + install -d "$(DESTDIR)$(BINDIR)" + install latextags ltags "$(DESTDIR)$(BINDIR)" + +upload: snapshot + scp "$(SNAPSHOTNAME).tar.gz" frs.sourceforge.net:/home/frs/project/v/vi/vim-latex/snapshots diff --git a/.vim/Makefile.in b/.vim/Makefile.in @@ -0,0 +1,133 @@ +CVSUSER = srinathava +SSHCMD = ssh1 +DIR1 = $(PWD) + +# The main target. This creates a latex suite archive (zip and tar.gz +# format) ensuring that all the files in the archive are in unix format so +# unix people can use it too... +latexs: + # plugins: + zip -q latexSuite.zip plugin/imaps.vim + zip -q latexSuite.zip plugin/SyntaxFolds.vim + zip -q latexSuite.zip plugin/libList.vim + zip -q latexSuite.zip plugin/remoteOpen.vim + zip -q latexSuite.zip plugin/filebrowser.vim + # ftplugins + zip -q latexSuite.zip ftplugin/tex_latexSuite.vim + zip -q latexSuite.zip ftplugin/bib_latexSuite.vim + zip -q latexSuite.zip ftplugin/tex/*.vim + # files in the latex-suite directory. Skip the CVS files. + zip -q -R latexSuite.zip `find ftplugin/latex-suite -name '*' | grep -v .svn` + # documentation + zip -q latexSuite.zip doc/latex*.txt + zip -q latexSuite.zip doc/imaps*.txt + # indentation + zip -q latexSuite.zip indent/tex.vim + # compiler + zip -q latexSuite.zip compiler/tex.vim + # external tools + zip -q latexSuite.zip ltags + + # Now to make a tar.gz file from the .zip file. + rm -rf $(TMP)/latexSuite0793 + mkdir -p $(TMP)/latexSuite0793 + cp latexSuite.zip $(TMP)/latexSuite0793/ + ( \ + cd $(TMP)/latexSuite0793/ ; \ + unzip -q -o latexSuite.zip ; \ + \rm latexSuite.zip ; \ + tar czf latexSuite.tar.gz * ; \ + \mv latexSuite.tar.gz $(DIR1)/ ; \ + ) + mv latexSuite.zip latexSuite`date +%Y%m%d`.zip ; \ + mv latexSuite.tar.gz latexSuite`date +%Y%m%d`.tar.gz ; \ + +# target for removing archive files. +clean: + rm -f latexSuite200* + +# make a local install directory. +ltt: + rm -rf /tmp/ltt/vimfiles/ftplugin + cp -f latexSuite.zip /tmp/ltt/vimfiles/ + cd /tmp/ltt/vimfiles; unzip latexSuite.zip + +# This target is related to a script I have on my sf.net account. That +# script looks like: +# +# #!/bin/bash +# cd ~/testing/vimfiles; \ +# cvs -q update; \ +# make clean; \ +# make; \ +# cp latexsuite.* ~/htdocs/download/ +# +# Doing a release via sf.net has a couple of advantages: +# - I do not have to bother with CRLF pain anymore because the copy on +# sf.net will always have unix style EOLs. +# - The process is much faster because I only need to communicate a command +# from my computer to sf.net. The rest is done locally on the sf.net +# server. +release: + $(SSHCMD) $(CVSUSER)@vim-latex.sf.net /home/groups/v/vi/vim-latex/bin/upload + +updoc: + $(SSHCMD) $(CVSUSER)@vim-latex.sf.net /home/groups/v/vi/vim-latex/bin/updoc + +# This is another target akin to the release: target. This target updates +# the htdocs directory of the latex-suite project to the latest CVS +# version. +# This is again related to the uphtdocs script on my sf.net account which +# looks like: +# #!/bin/sh +# +# # update the htdocs directory +# cd /home/groups/v/vi/vim-latex/htdocs; cvs -q update +# # update the packages directory +# cd /home/groups/v/vi/vim-latex/htdocs/packages; cvs -q update +uphtdocs: + $(SSHCMD) $(CVSUSER)@vim-latex.sf.net /home/groups/v/vi/vim-latex/bin/uphtdocs + +# Automatically generate the Changelog file using the cvs2cl utility +# +# Arguments: +# -S add a seperating line between filename and log +# --no-wrap Do not attempt to format the Changelog comments +# -f file to write the Changelog to. +changelog: + cvs2cl -S --no-wrap -f ftplugin/latex-suite/ChangeLog + +# rsync is like cp (copy) on steroids. Here are some useful options: +# -C auto ignore like CVS +# -r recurse into directories +# -t preserve times +# -u update (do not overwrite newer files) +# -W whole files, no incremental checks (default for local usage) +# --existing only update files that already exist +# --exclude exclude files matching the pattern +# -n dry run (for testing) + +# Usage: after "cvs update", do +# make install [VIMFILES=path/to/vimfiles] +# Before "cvs commit", do +# make stallin [VIMFILES=path/to/vimfiles] +# If you have made changes in both directories, and want to keep the most +# recent versions, do +# make sync [VIMFILES=path/to/vimfiles] +# Note: defining VIMFILES when you invoke make overrides the value below. +# Warning: install and stallin do not check modification times! + +VIMFILES=${HOME}/.vim +EXCLUDE="--exclude='*~' --exclude='*.swp' --exclude='makefile'" + +install: + rsync -CrtW ${EXCLUDE} . ${VIMFILES} + +# stallin = reverse install +# If you can think of a better name for this target, be my guest! +stallin: + rsync -CrtW --existing ${VIMFILES}/ . + +sync: + rsync -CrtuW ${EXCLUDE} . ${VIMFILES} + rsync -CrtuW --existing ${VIMFILES}/ . diff --git a/.vim/autoload/pathogen.vim b/.vim/autoload/pathogen.vim @@ -0,0 +1,245 @@ +" pathogen.vim - path option manipulation +" Maintainer: Tim Pope <http://tpo.pe/> +" Version: 2.0 + +" Install in ~/.vim/autoload (or ~\vimfiles\autoload). +" +" For management of individually installed plugins in ~/.vim/bundle (or +" ~\vimfiles\bundle), adding `call pathogen#infect()` to your .vimrc +" prior to `filetype plugin indent on` is the only other setup necessary. +" +" The API is documented inline below. For maximum ease of reading, +" :set foldmethod=marker + +if exists("g:loaded_pathogen") || &cp + finish +endif +let g:loaded_pathogen = 1 + +" Point of entry for basic default usage. Give a directory name to invoke +" pathogen#runtime_append_all_bundles() (defaults to "bundle"), or a full path +" to invoke pathogen#runtime_prepend_subdirectories(). Afterwards, +" pathogen#cycle_filetype() is invoked. +function! pathogen#infect(...) abort " {{{1 + let source_path = a:0 ? a:1 : 'bundle' + if source_path =~# '[\\/]' + call pathogen#runtime_prepend_subdirectories(source_path) + else + call pathogen#runtime_append_all_bundles(source_path) + endif + call pathogen#cycle_filetype() +endfunction " }}}1 + +" Split a path into a list. +function! pathogen#split(path) abort " {{{1 + if type(a:path) == type([]) | return a:path | endif + let split = split(a:path,'\\\@<!\%(\\\\\)*\zs,') + return map(split,'substitute(v:val,''\\\([\\,]\)'',''\1'',"g")') +endfunction " }}}1 + +" Convert a list to a path. +function! pathogen#join(...) abort " {{{1 + if type(a:1) == type(1) && a:1 + let i = 1 + let space = ' ' + else + let i = 0 + let space = '' + endif + let path = "" + while i < a:0 + if type(a:000[i]) == type([]) + let list = a:000[i] + let j = 0 + while j < len(list) + let escaped = substitute(list[j],'[,'.space.']\|\\[\,'.space.']\@=','\\&','g') + let path .= ',' . escaped + let j += 1 + endwhile + else + let path .= "," . a:000[i] + endif + let i += 1 + endwhile + return substitute(path,'^,','','') +endfunction " }}}1 + +" Convert a list to a path with escaped spaces for 'path', 'tag', etc. +function! pathogen#legacyjoin(...) abort " {{{1 + return call('pathogen#join',[1] + a:000) +endfunction " }}}1 + +" Remove duplicates from a list. +function! pathogen#uniq(list) abort " {{{1 + let i = 0 + let seen = {} + while i < len(a:list) + if (a:list[i] ==# '' && exists('empty')) || has_key(seen,a:list[i]) + call remove(a:list,i) + elseif a:list[i] ==# '' + let i += 1 + let empty = 1 + else + let seen[a:list[i]] = 1 + let i += 1 + endif + endwhile + return a:list +endfunction " }}}1 + +" \ on Windows unless shellslash is set, / everywhere else. +function! pathogen#separator() abort " {{{1 + return !exists("+shellslash") || &shellslash ? '/' : '\' +endfunction " }}}1 + +" Convenience wrapper around glob() which returns a list. +function! pathogen#glob(pattern) abort " {{{1 + let files = split(glob(a:pattern),"\n") + return map(files,'substitute(v:val,"[".pathogen#separator()."/]$","","")') +endfunction "}}}1 + +" Like pathogen#glob(), only limit the results to directories. +function! pathogen#glob_directories(pattern) abort " {{{1 + return filter(pathogen#glob(a:pattern),'isdirectory(v:val)') +endfunction "}}}1 + +" Turn filetype detection off and back on again if it was already enabled. +function! pathogen#cycle_filetype() " {{{1 + if exists('g:did_load_filetypes') + filetype off + filetype on + endif +endfunction " }}}1 + +" Checks if a bundle is 'disabled'. A bundle is considered 'disabled' if +" its 'basename()' is included in g:pathogen_disabled[]' or ends in a tilde. +function! pathogen#is_disabled(path) " {{{1 + if a:path =~# '\~$' + return 1 + elseif !exists("g:pathogen_disabled") + return 0 + endif + let sep = pathogen#separator() + return index(g:pathogen_disabled, strpart(a:path, strridx(a:path, sep)+1)) != -1 +endfunction "}}}1 + +" Prepend all subdirectories of path to the rtp, and append all 'after' +" directories in those subdirectories. +function! pathogen#runtime_prepend_subdirectories(path) " {{{1 + let sep = pathogen#separator() + let before = filter(pathogen#glob_directories(a:path.sep."*"), '!pathogen#is_disabled(v:val)') + let after = filter(pathogen#glob_directories(a:path.sep."*".sep."after"), '!pathogen#is_disabled(v:val[0:-7])') + let rtp = pathogen#split(&rtp) + let path = expand(a:path) + call filter(rtp,'v:val[0:strlen(path)-1] !=# path') + let &rtp = pathogen#join(pathogen#uniq(before + rtp + after)) + return &rtp +endfunction " }}}1 + +" For each directory in rtp, check for a subdirectory named dir. If it +" exists, add all subdirectories of that subdirectory to the rtp, immediately +" after the original directory. If no argument is given, 'bundle' is used. +" Repeated calls with the same arguments are ignored. +function! pathogen#runtime_append_all_bundles(...) " {{{1 + let sep = pathogen#separator() + let name = a:0 ? a:1 : 'bundle' + if "\n".s:done_bundles =~# "\\M\n".name."\n" + return "" + endif + let s:done_bundles .= name . "\n" + let list = [] + for dir in pathogen#split(&rtp) + if dir =~# '\<after$' + let list += filter(pathogen#glob_directories(substitute(dir,'after$',name,'').sep.'*[^~]'.sep.'after'), '!pathogen#is_disabled(v:val[0:-7])') + [dir] + else + let list += [dir] + filter(pathogen#glob_directories(dir.sep.name.sep.'*[^~]'), '!pathogen#is_disabled(v:val)') + endif + endfor + let &rtp = pathogen#join(pathogen#uniq(list)) + return 1 +endfunction + +let s:done_bundles = '' +" }}}1 + +" Invoke :helptags on all non-$VIM doc directories in runtimepath. +function! pathogen#helptags() " {{{1 + let sep = pathogen#separator() + for dir in pathogen#split(&rtp) + if (dir.sep)[0 : strlen($VIMRUNTIME)] !=# $VIMRUNTIME.sep && filewritable(dir.sep.'doc') == 2 && !empty(glob(dir.sep.'doc'.sep.'*')) && (!filereadable(dir.sep.'doc'.sep.'tags') || filewritable(dir.sep.'doc'.sep.'tags')) + helptags `=dir.'/doc'` + endif + endfor +endfunction " }}}1 + +command! -bar Helptags :call pathogen#helptags() + +" Like findfile(), but hardcoded to use the runtimepath. +function! pathogen#runtime_findfile(file,count) "{{{1 + let rtp = pathogen#join(1,pathogen#split(&rtp)) + return fnamemodify(findfile(a:file,rtp,a:count),':p') +endfunction " }}}1 + +" Backport of fnameescape(). +function! pathogen#fnameescape(string) " {{{1 + if exists('*fnameescape') + return fnameescape(a:string) + elseif a:string ==# '-' + return '\-' + else + return substitute(escape(a:string," \t\n*?[{`$\\%#'\"|!<"),'^[+>]','\\&','') + endif +endfunction " }}}1 + +function! s:find(count,cmd,file,lcd) " {{{1 + let rtp = pathogen#join(1,pathogen#split(&runtimepath)) + let file = pathogen#runtime_findfile(a:file,a:count) + if file ==# '' + return "echoerr 'E345: Can''t find file \"".a:file."\" in runtimepath'" + elseif a:lcd + let path = file[0:-strlen(a:file)-2] + execute 'lcd `=path`' + return a:cmd.' '.pathogen#fnameescape(a:file) + else + return a:cmd.' '.pathogen#fnameescape(file) + endif +endfunction " }}}1 + +function! s:Findcomplete(A,L,P) " {{{1 + let sep = pathogen#separator() + let cheats = { + \'a': 'autoload', + \'d': 'doc', + \'f': 'ftplugin', + \'i': 'indent', + \'p': 'plugin', + \'s': 'syntax'} + if a:A =~# '^\w[\\/]' && has_key(cheats,a:A[0]) + let request = cheats[a:A[0]].a:A[1:-1] + else + let request = a:A + endif + let pattern = substitute(request,'\'.sep,'*'.sep,'g').'*' + let found = {} + for path in pathogen#split(&runtimepath) + let path = expand(path, ':p') + let matches = split(glob(path.sep.pattern),"\n") + call map(matches,'isdirectory(v:val) ? v:val.sep : v:val') + call map(matches,'expand(v:val, ":p")[strlen(path)+1:-1]') + for match in matches + let found[match] = 1 + endfor + endfor + return sort(keys(found)) +endfunction " }}}1 + +command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Ve :execute s:find(<count>,'edit<bang>',<q-args>,0) +command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vedit :execute s:find(<count>,'edit<bang>',<q-args>,0) +command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vopen :execute s:find(<count>,'edit<bang>',<q-args>,1) +command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vsplit :execute s:find(<count>,'split',<q-args>,<bang>1) +command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vvsplit :execute s:find(<count>,'vsplit',<q-args>,<bang>1) +command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vtabedit :execute s:find(<count>,'tabedit',<q-args>,<bang>1) +command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vpedit :execute s:find(<count>,'pedit',<q-args>,<bang>1) +command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vread :execute s:find(<count>,'read',<q-args>,<bang>1) + +" vim:set ft=vim ts=8 sw=2 sts=2: diff --git a/.vim/bundle/vim-powerline b/.vim/bundle/vim-powerline @@ -0,0 +1 @@ +Subproject commit 7f5992f76e2a3cd2390c2d656f812d4713f3a196 diff --git a/.vim/compiler/._mlint.vim b/.vim/compiler/._mlint.vim Binary files differ. diff --git a/.vim/compiler/mlint.vim b/.vim/compiler/mlint.vim @@ -0,0 +1,44 @@ +" Vim compiler file +" Compiler: Matlab mlint code checker +" Maintainer: Fabrice Guy <fabrice.guy at gmail dot com> +" Latest Revision: 2008 Oct 16 +" Comment: mlint messages are either +" - L x (C y): message (where x and y are line number and +" column number) +" - L x (C y-z): message (where x is the line number, y and +" z the column numbers where the error comes from) + + +if exists("current_compiler") + finish +endif +let current_compiler = "mlint" + +if exists(":CompilerSet") != 2 " older Vim always used :setlocal + command -nargs=* CompilerSet setlocal <args> +endif + +" mlint doesn't provide filename information except if multiple +" filenames are given +" With the following command : +" mlint <filename> <filename without extension> +" mlint produces an output like that : +" ========== <filename> ========== +" L x (C y): ID : Message +" L x (C y): ID : Message +" .. +" .. +" ========== <filename without extension> ========== +" L 0 (C 0): MDOTM :Filename 'filename' must end in .m or .M +" +" The filename can then be parsed +CompilerSet makeprg=mlint\ -id\ %\ %< + +CompilerSet errorformat= + \%-P==========\ %f\ ==========, + \%-G%>==========\ %s\ ==========, + \%-G%>L\ %l\ (C\ %c):\ MDOTM%m, + \L\ %l\ (C\ %c):\ %m, + \L\ %l\ (C\ %c-%*[0-9]):\ %m, + \%-Q + diff --git a/.vim/compiler/tex.vim b/.vim/compiler/tex.vim @@ -0,0 +1,294 @@ +" File: tex.vim +" Type: compiler plugin for LaTeX +" Original Author: Artem Chuprina <ran@ran.pp.ru> +" Customization: Srinath Avadhanula <srinath@fastmail.fm> +" CVS: $Id: tex.vim 1070 2009-09-15 18:28:17Z tmaas $ +" Description: {{{ +" This file sets the 'makeprg' and 'errorformat' options for the LaTeX +" compiler. It is customizable to optionally ignore certain warnings and +" provides the ability to set a dynamic 'ignore-warning' level. +" +" By default it is set up in a 'non-verbose', 'ignore-common-warnings' mode, +" which means that irrelevant lines from the compilers output will be +" ignored and also some very common warnings are ignored. +" +" Depending on the 'ignore-level', the following kinds of messages are +" ignored. An ignore level of 3 for instance means that messages 1-3 will be +" ignored. By default, the ignore level is set to 4. +" +" 1. LaTeX Warning: Specifier 'h' changed to 't'. +" This errors occurs when TeX is not able to correctly place a floating +" object at a specified location, because of which it defaulted to the +" top of the page. +" 2. LaTeX Warning: Underfull box ... +" 3. LaTeX Warning: Overfull box ... +" both these warnings (very common) are due to \hbox settings not being +" satisfied nicely. +" 4. LaTeX Warning: You have requested ..., +" This warning occurs in slitex when using the xypic package. +" 5. Missing number error: +" Usually, when the name of an included eps file is spelled incorrectly, +" then the \bb-error message is accompanied by a bunch of "missing +" number, treated as zero" error messages. This level ignores these +" warnings. +" NOTE: number 5 is actually a latex error, not a warning! +" +" Use +" TCLevel <level> +" where level is a number to set the ignore level dynamically. +" +" When TCLevel is called with the unquoted string strict +" TClevel strict +" then the 'efm' switches to a 'verbose', 'no-lines-ignored' mode which is +" useful when you want to make final checks of your document and want to be +" careful not to let things slip by. +" +" TIP: MikTeX has a bug where it sometimes erroneously splits a line number +" into multiple lines. i.e, if the warning is on line 1234. the compiler +" output is: +" LaTeX Warning: ... on input line 123 +" 4. +" In this case, vim will wrongly interpret the line-number as 123 instead +" of 1234. If you have cygwin, a simple remedy around this is to first +" copy the file vimlatex (provided) into your $PATH, make sure its +" executable and then set the variable g:tex_flavor to vimlatex in your +" ~/.vimrc (i.e putting let "g:tex_flavor = 'vimlatex'" in your .vimrc). +" This problem occurs rarely enough that its not a botheration for most +" people. +" +" TODO: +" 1. menu items for dynamically selecting a ignore warning level. +" }}} + +" avoid reinclusion for the same buffer. keep it buffer local so it can be +" externally reset in case of emergency re-sourcing. +if exists('b:doneTexCompiler') && !exists('b:forceRedoTexCompiler') + finish +endif +let b:doneTexCompiler = 1 + +" ============================================================================== +" Customization of 'efm': {{{ +" This section contains the customization variables which the user can set. +" g:Tex_IgnoredWarnings: This variable contains a ¡ seperated list of +" patterns which will be ignored in the TeX compiler's output. Use this +" carefully, otherwise you might end up losing valuable information. +if !exists('g:Tex_IgnoredWarnings') + let g:Tex_IgnoredWarnings = + \'Underfull'."\n". + \'Overfull'."\n". + \'specifier changed to'."\n". + \'You have requested'."\n". + \'Missing number, treated as zero.'."\n". + \'There were undefined references'."\n". + \'Citation %.%# undefined' +endif +" This is the number of warnings in the g:Tex_IgnoredWarnings string which +" will be ignored. +if !exists('g:Tex_IgnoreLevel') + let g:Tex_IgnoreLevel = 7 +endif +" There will be lots of stuff in a typical compiler output which will +" completely fall through the 'efm' parsing. This options sets whether or not +" you will be shown those lines. +if !exists('g:Tex_IgnoreUnmatched') + let g:Tex_IgnoreUnmatched = 1 +endif +" With all this customization, there is a slight risk that you might be +" ignoring valid warnings or errors. Therefore before getting the final copy +" of your work, you might want to reset the 'efm' with this variable set to 1. +" With that value, all the lines from the compiler are shown irrespective of +" whether they match the error or warning patterns. +" NOTE: An easier way of resetting the 'efm' to show everything is to do +" TCLevel strict +if !exists('g:Tex_ShowallLines') + let g:Tex_ShowallLines = 0 +endif + +" }}} +" ============================================================================== +" Customization of 'makeprg': {{{ + +" There are several alternate ways in which 'makeprg' is set up. +" +" Case 1 +" ------ +" The first is when this file is a part of latex-suite. In this case, a +" variable called g:Tex_DefaultTargetFormat exists, which gives the default +" format .tex files should be compiled into. In this case, we use the TTarget +" command provided by latex-suite. +" +" Case 2 +" ------ +" The user is using this file without latex-suite AND he wants to directly +" specify the complete 'makeprg'. Then he should set the g:Tex_CompileRule_dvi +" variable. This is a string which should be directly be able to be cast into +" &makeprg. An example of one such string is: +" +" g:Tex_CompileRule_dvi = 'pdflatex \\nonstopmode \\input\{$*\}' +" +" NOTE: You will need to escape back-slashes, {'s etc yourself if you are +" using this file independently of latex-suite. +" TODO: Should we also have a check for backslash escaping here based on +" platform? +" +" Case 3 +" ------ +" The use is using this file without latex-suite and he doesnt want any +" customization. In this case, this file makes some intelligent guesses based +" on the platform. If he doesn't want to specify the complete 'makeprg' but +" only the name of the compiler program (for example 'pdflatex' or 'latex'), +" then he sets b:tex_flavor or g:tex_flavor. + +if exists('g:Tex_DefaultTargetFormat') + exec 'TTarget '.g:Tex_DefaultTargetFormat +elseif exists('g:Tex_CompileRule_dvi') + let &l:makeprg = g:Tex_CompileRule_dvi +else + " If buffer-local variable 'tex_flavor' exists, it defines TeX flavor, + " otherwize the same for global variable with same name, else it will be LaTeX + if exists("b:tex_flavor") + let current_compiler = b:tex_flavor + elseif exists("g:tex_flavor") + let current_compiler = g:tex_flavor + else + let current_compiler = "latex" + end + if has('win32') + let escChars = '' + else + let escChars = '{}\' + endif + " Furthermore, if 'win32' is detected, then we want to set the arguments up so + " that miktex can handle it. + if has('win32') + let options = '--src-specials' + else + let options = '' + endif + let &l:makeprg = current_compiler . ' ' . options . + \ escape(' \nonstopmode \input{$*}', escChars) +endif + +" }}} +" ============================================================================== +" Functions for setting up a customized 'efm' {{{ + +" IgnoreWarnings: parses g:Tex_IgnoredWarnings for message customization {{{ +" Description: +function! <SID>IgnoreWarnings() + let i = 1 + while s:Strntok(g:Tex_IgnoredWarnings, "\n", i) != '' && + \ i <= g:Tex_IgnoreLevel + let warningPat = s:Strntok(g:Tex_IgnoredWarnings, "\n", i) + let warningPat = escape(substitute(warningPat, '[\,]', '%\\\\&', 'g'), ' ') + exe 'setlocal efm+=%-G%.%#'.warningPat.'%.%#' + let i = i + 1 + endwhile +endfunction + +" }}} +" SetLatexEfm: sets the 'efm' for the latex compiler {{{ +" Description: +function! <SID>SetLatexEfm() + + let pm = ( g:Tex_ShowallLines == 1 ? '+' : '-' ) + + setlocal efm= + + if !g:Tex_ShowallLines + call s:IgnoreWarnings() + endif + + setlocal efm+=%E!\ LaTeX\ %trror:\ %m + setlocal efm+=%E!\ %m + setlocal efm+=%E%f:%l:\ %m + + setlocal efm+=%+WLaTeX\ %.%#Warning:\ %.%#line\ %l%.%# + setlocal efm+=%+W%.%#\ at\ lines\ %l--%*\\d + setlocal efm+=%+WLaTeX\ %.%#Warning:\ %m + + exec 'setlocal efm+=%'.pm.'Cl.%l\ %m' + exec 'setlocal efm+=%'.pm.'Cl.%l\ ' + exec 'setlocal efm+=%'.pm.'C\ \ %m' + exec 'setlocal efm+=%'.pm.'C%.%#-%.%#' + exec 'setlocal efm+=%'.pm.'C%.%#[]%.%#' + exec 'setlocal efm+=%'.pm.'C[]%.%#' + exec 'setlocal efm+=%'.pm.'C%.%#%[{}\\]%.%#' + exec 'setlocal efm+=%'.pm.'C<%.%#>%m' + exec 'setlocal efm+=%'.pm.'C\ \ %m' + exec 'setlocal efm+=%'.pm.'GSee\ the\ LaTeX%m' + exec 'setlocal efm+=%'.pm.'GType\ \ H\ <return>%m' + exec 'setlocal efm+=%'.pm.'G\ ...%.%#' + exec 'setlocal efm+=%'.pm.'G%.%#\ (C)\ %.%#' + exec 'setlocal efm+=%'.pm.'G(see\ the\ transcript%.%#)' + exec 'setlocal efm+=%'.pm.'G\\s%#' + exec 'setlocal efm+=%'.pm.'O(%*[^()])%r' + exec 'setlocal efm+=%'.pm.'P(%f%r' + exec 'setlocal efm+=%'.pm.'P\ %\\=(%f%r' + exec 'setlocal efm+=%'.pm.'P%*[^()](%f%r' + exec 'setlocal efm+=%'.pm.'P(%f%*[^()]' + exec 'setlocal efm+=%'.pm.'P[%\\d%[^()]%#(%f%r' + if g:Tex_IgnoreUnmatched && !g:Tex_ShowallLines + setlocal efm+=%-P%*[^()] + endif + exec 'setlocal efm+=%'.pm.'Q)%r' + exec 'setlocal efm+=%'.pm.'Q%*[^()])%r' + exec 'setlocal efm+=%'.pm.'Q[%\\d%*[^()])%r' + if g:Tex_IgnoreUnmatched && !g:Tex_ShowallLines + setlocal efm+=%-Q%*[^()] + endif + if g:Tex_IgnoreUnmatched && !g:Tex_ShowallLines + setlocal efm+=%-G%.%# + endif + +endfunction + +" }}} +" Strntok: extract the n^th token from a list {{{ +" example: Strntok('1,23,3', ',', 2) = 23 +fun! <SID>Strntok(s, tok, n) + return matchstr( a:s.a:tok[0], '\v(\zs([^'.a:tok.']*)\ze['.a:tok.']){'.a:n.'}') +endfun + +" }}} +" SetTexCompilerLevel: sets the "level" for the latex compiler {{{ +function! <SID>SetTexCompilerLevel(...) + if a:0 > 0 + let level = a:1 + else + call Tex_ResetIncrementNumber(0) + echo substitute(g:Tex_IgnoredWarnings, + \ '^\|\n\zs\S', '\=Tex_IncrementNumber(1)." ".submatch(0)', 'g') + let level = input("\nChoose an ignore level: ") + if level == '' + return + endif + endif + if level == 'strict' + let g:Tex_ShowallLines = 1 + elseif level =~ '^\d\+$' + let g:Tex_ShowallLines = 0 + let g:Tex_IgnoreLevel = level + else + echoerr "SetTexCompilerLevel: Unkwown option [".level."]" + end + call s:SetLatexEfm() +endfunction + +com! -nargs=? TCLevel :call <SID>SetTexCompilerLevel(<f-args>) +" }}} + +" }}} +" ============================================================================== + +call s:SetLatexEfm() + +if !exists('*Tex_Debug') + function! Tex_Debug(...) + endfunction +endif + +call Tex_Debug("compiler/tex.vim: sourcing this file", "comp") + +" vim:fdm=marker:ff=unix:noet:ts=4:sw=4 diff --git a/.vim/doc/._matlab.txt b/.vim/doc/._matlab.txt Binary files differ. diff --git a/.vim/doc/._vcscommand.txt b/.vim/doc/._vcscommand.txt Binary files differ. diff --git a/.vim/doc/Makefile b/.vim/doc/Makefile @@ -0,0 +1,62 @@ +projects = latex-suite latex-suite-quickstart +htmlfiles = $(addsuffix .html, $(projects)) +txtfiles = $(addsuffix .txt, $(projects)) +cssfiles = $(addsuffix .css, $(projects)) +all = $(projects) $(htmlfiles) $(cssfiles) $(txtfiles) + + +xsltproc=xsltproc +db2vim=../../db2vim/db2vim + +# Use for debugging: +#xsltproc=strace -e trace=file xsltproc --nonet --load-trace +# export XML_DEBUG_CATALOG = 1 + +# Specify local catalog to not use system installed dtd/xsl files +# export XML_CATALOG_FILES=catalog.xml + +# User configuration of this Makefile goes into Makefile.local +# E.g. to use a catalog file installed by the user. +-include Makefile.local + +# Default Target is to create all documentation files +all: $(all) + +# create multi page html (chunk xhtml) +$(projects): %: %.xml latex-suite-chunk.xsl latex-suite-common.xsl + $(xsltproc) -o $@/ latex-suite-chunk.xsl $< + +# create single html files +$(htmlfiles): %.html: %.xml latex-suite.xsl latex-suite-common.xsl + $(xsltproc) -o $@ latex-suite.xsl $< + +# create vim flat files +latex-suite.txt: %.txt: %.xml + $(db2vim) --prefix=ls_ $< > $@ + +latex-suite-quickstart.txt: %.txt: %.xml + $(db2vim) --prefix=lq_ $< > $@ + +# validate xml +validate: + for file in *.xml; do \ + xmllint --valid --noout $$file; \ + done + +clean: + rm -f $(htmlfiles) + rm -rf $(projects) + +# $(txtfiles) are currently in revision control, therefore they are not +# removed in the clean target +mr-proper: clean + rm -f $(txtfiles) + +upload: $(all) +# vim-latex-web is configured in ~/.ssh/config +#Host vim-latex-web +# Hostname web.sourceforge.net +# User SOURCEFORGE_USERNAME,vim-latex + rsync --perms --chmod g+w,o-w --delete -lrtvz $(all) vim-latex-web:/home/groups/v/vi/vim-latex/htdocs/documentation/ + +# vim:nowrap diff --git a/.vim/doc/Makefile.in b/.vim/doc/Makefile.in @@ -0,0 +1,29 @@ +# Manual files +ls-flat: + java com.icl.saxon.StyleSheet latex-suite.xml latex-suite.xsl > latex-suite.html + +ls-chunk: + ( \ + cd latex-suite && \ + java com.icl.saxon.StyleSheet ../latex-suite.xml ../latex-suite-chunk.xsl \ + ) + +ls-txt: + db2vim --prefix=ls_ latex-suite.xml > latex-suite.txt + +# Quickstart files +lsq-flat: + java com.icl.saxon.StyleSheet latex-suite-quickstart.xml latex-suite.xsl > latex-suite-quickstart.html + +lsq-chunk: + ( \ + cd latex-suite-quickstart && \ + java com.icl.saxon.StyleSheet ../latex-suite-quickstart.xml ../latex-suite-chunk.xsl \ + ) + +lsq-txt: + db2vim --prefix=lq_ latex-suite-quickstart.xml > latex-suite-quickstart.txt + +cvsci: + cvs ci latex-suite.xml latex-suite.txt +# vim:nowrap diff --git a/.vim/doc/README b/.vim/doc/README @@ -0,0 +1,110 @@ +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +This file is outdated, please look at README.new for updated information +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +==================================== +Generating Latex-Suite documentation +==================================== + +In order to generate the html files and vim-help files from the XML source, +you will need to do follow the following steps. The steps are complex only +for a windows machine. On most (modern) linux machines, the various +utilities are already installed and all you need to do is some +soft-linking. + +1. Download the Docbook XSL stylesheets from + + http://sourceforge.net/project/showfiles.php?group_id=21935 + + I downloaded docbook-xsl-1.61.2.tar.gz. Unpack this archive under the + present directory. You should see something like:: + + ./docbook-xsl-1.XX.X/ + + Rename this to:: + + ./docbook-xsl + + Alternatively, if you are on a modern unix system, the docbook-xsl + stylesheets should already be installed on your system. Soft-linking + will thus work more simply. On a typical Debian box, just do:: + + ln -s /usr/share/sgml/docbook/stylesheet/xsl/nwalsh docbook-xsl + + The docbook-xsl stylesheets can be installed via the docbook-xsl + package on Debian. (Just use apt-get). + +2. Download the Docbook DTD from + + http://www.oasis-open.org/docbook/xml/4.2/docbook-xml-4.2.zip + + Extract this into a subdirectory ``docbook-xml/`` under the present + directory. You should see something like:: + + ./docbook-xml/ + + with a file ``docbookx.dtd`` located there. + + **CAUTION**: + The archive above does not create a top level directory but + unzips directly into the present directory. Therefore, make sure to + run the unzip by first creating ``./docbook-xml/``, copying the zip + file there and then unzipping. + + Alternatively, if you are on a modern unix system, the docbook-xml DTD + will already be installed. Softlinking will thus work. On a typical + Debian box, you could do:: + + ln -s /usr/share/sgml/docbook/dtd/xml/4.2 docbook-xml + + On debian, you need the docbook-xml package on Debian. (Just use + apt-get). + +3. Download saxon.jar from + + http://vim-latex.sourceforge.net/documentation/saxon.jar + + This is the bare .jar file without any of the other things which saxon + comes with. Add the ``saxon.jar`` file to your ``$CLASSPATH`` setting. + + **NOTE:** + The ``$CLASSPATH`` setting should point to the ``saxon.jar`` file, + not the directory where it resides. + + Again, on a unix system, you might not need to download this. For debian + systems, the saxon.jar file resides in:: + + /usr/share/java/saxon.jar + + You can point your ``$CLASSPATH`` to that file. + +4. Download db2vim (created by me :)) via anonymous cvs:: + + mkdir -p ~/bin/db2vim + cvs -d :pserver:anonymous@cvs.vim-latex.sf.net:/cvsroot/vim-latex \ + co -d ~/bin/db2vim db2vim + + Add the ``~/bin/db2vim/`` directory thus created to your ``$PATH`` + setting. + +5. Create a new directory ``latex-suite/`` under the present directory for + the chunked html files to reside in. You should see something like:: + + ./latex-suite/ + +6. Copy ``Makefile.in`` to ``Makefile`` or ``makefile`` and perform any + necessary customizations. For example, if you are using Activestate + python under windows, you will need to change the ls-txt: target as:: + + python e:/srinath/testing/db2vim/db2vim latex-suite.xml > latex-suite.txt + + +Thats it! You are ready. Now you can do:: + + make ls-chunk + make ls-flat + make ls-txt + +to create the 3 formats. + +Author: Srinath Avadhanula <srinath@fastmail.fm> diff --git a/.vim/doc/README.new b/.vim/doc/README.new @@ -0,0 +1,17 @@ +==================================== +Generating Latex-Suite documentation +==================================== + +You need: +- xsltproc +- Docbook XSL stylesheets (*) +- Docbook DTD (*) + +(*) These files will be downloaded every time you create the documentation, +unless you install or download them. + +On Fedora, you can run as root: + +yum install libxslt docbook-style-xsl docbook-dtds + +to install the required packages. diff --git a/.vim/doc/catalog.xml b/.vim/doc/catalog.xml @@ -0,0 +1,12 @@ +<?xml version="1.0"?> +<!DOCTYPE catalog + PUBLIC "-//OASIS/DTD Entity Resolution XML Catalog V1.0//EN" + "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd"> +<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog"> + <rewriteSystem + systemIdStartString="http://docbook.sourceforge.net/release/xsl/current" + rewritePrefix="docbook-xsl/"/> + <rewriteURI + uriStartString="http://docbook.sourceforge.net/release/xsl/current/" + rewritePrefix="docbook-xsl/" /> +</catalog> diff --git a/.vim/doc/imaps.txt b/.vim/doc/imaps.txt @@ -0,0 +1,116 @@ + IMAP -- A fluid replacement for :imap + *imaps.txt* + Srinath Avadhanula <srinath AT fastmail DOT fm> + + + + Abstract + ======== +This plugin provides a function IMAP() which emulates vims |:imap| function. The +motivation for providing this plugin is that |:imap| suffers from problems +which get increasingly annoying with a large number of mappings. + +Consider an example. If you do > + imap lhs something + + +then a mapping is set up. However, there will be the following problems: +1. The 'ttimeout' option will generally limit how easily you can type the lhs. + if you type the left hand side too slowly, then the mapping will not be + activated. + +2. If you mistype one of the letters of the lhs, then the mapping is deactivated + as soon as you backspace to correct the mistake. + +3. The characters in lhs are shown on top of each other. This is fairly + distracting. This becomes a real annoyance when a lot of characters initiate + mappings. + +This script provides a function IMAP() which does not suffer from these +problems. + + + + *imaps.txt-toc* +|im_1| Using IMAP + +================================================================================ +Viewing this file + +This file can be viewed with all the sections and subsections folded to ease +navigation. By default, vim does not fold help documents. To create the folds, +press za now. The folds are created via a foldexpr which can be seen in the +last section of this file. + +See |usr_28.txt| for an introduction to folding and |fold-commands| for key +sequences and commands to work with folds. + +================================================================================ +Using IMAP *im_1* *imaps-usage* + + + +Each call to IMAP is made using the syntax: > + call IMAP (lhs, rhs, ft [, phs, phe]) + + +This is equivalent to having <lhs> map to <rhs> for all files of type <ft>. + +Some characters in the <rhs> have special meaning which help in cursor placement +as described in |imaps-placeholders|. The optional arguments define these +special characters. + +Example One: > + call IMAP ("bit`", "\\begin{itemize}\<cr>\\item <++>\<cr>\\end{itemize}<++>", "tex") + + +This effectively sets up the map for "bit`" whenever you edit a latex file. When +you type in this sequence of letters, the following text is inserted: > + \begin{itemize} + \item * + \end{itemize}<++> + +where * shows the cursor position. The cursor position after inserting the text +is decided by the position of the first "place-holder". Place holders are +special characters which decide cursor placement and movement. In the example +above, the place holder characters are <+ and +>. After you have typed in the +item, press <C-j> and you will be taken to the next set of <++>'s. Therefore by +placing the <++> characters appropriately, you can minimize the use of movement +keys. + +Set g:Imap_UsePlaceHolders to 0 to disable placeholders altogether. + +Set g:Imap_PlaceHolderStart and g:Imap_PlaceHolderEnd to something else if you +want different place holder characters. Also, b:Imap_PlaceHolderStart and +b:Imap_PlaceHolderEnd override the values of g:Imap_PlaceHolderStart and +g:Imap_PlaceHolderEnd respectively. This is useful for setting buffer specific +place holders. + +Example Two: You can use the <C-r> command to insert dynamic elements such as +dates. > + call IMAP ('date`', "\<c-r>=strftime('%b %d %Y')\<cr>", '') + + + +With this mapping, typing date` will insert the present date into the file. + +================================================================================ +About this file + +This file was created automatically from its XML variant using db2vim. db2vim is +a python script which understands a very limited subset of the Docbook XML 4.2 +DTD and outputs a plain text file in vim help format. + +db2vim can be obtained via anonymous CVS from sourceforge.net. Use + +cvs -d:pserver:anonymous@cvs.vim-latex.sf.net:/cvsroot/vim-latex co db2vim + +Or you can visit the web-interface to sourceforge CVS at: +http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/vim-latex/db2vim/ + +The following modelines should nicely fold up this help manual. + +vim:ft=help:fdm=expr:nowrap +vim:foldexpr=getline(v\:lnum-1)=~'-\\{80}'?'>2'\:getline(v\:lnum-1)=~'=\\{80}'?'>1'\:getline(v\:lnum)=~'=\\{80}'?'0'\:getline(v\:lnum)=~'-\\{80}'?'1'\:'=' +vim:foldtext=substitute(v\:folddashes.substitute(getline(v\:foldstart),'\\s*\\*.*',"",""),'^--','--\ \ \ \ ','') +================================================================================ diff --git a/.vim/doc/latex-suite-chunk.xsl b/.vim/doc/latex-suite-chunk.xsl @@ -0,0 +1,52 @@ +<?xml version="1.0"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version="1.0" + xmlns="http://www.w3.org/TR/xhtml1/transitional" + exclude-result-prefixes="#default"> + + <!-- $Id: latex-suite-chunk.xsl 1036 2008-05-31 16:10:30Z tmaas $ --> + + <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/xhtml/chunk.xsl"/> + + <!-- import common customizations --> + <xsl:import href="latex-suite-common.xsl"/> + + <!-- insert customization here --> + + <xsl:param name="default.encoding" select="'ISO-8859-1'"/> + + <xsl:param name="use.id.as.filename" select="'1'"/> + <xsl:param name="section.autolabel" select="1"/> + <xsl:param name="html.stylesheet" select="'../latex-suite.css'"/> + + <!-- Chunk the first top-level section? --> + <xsl:param name="chunk.first.sections" select="1"/> + <!-- Depth to which sections should be chunked --> + <xsl:param name="chunk.section.depth" select="2"/> + + <!-- How deep should recursive sections appear in the TOC? --> + <xsl:param name="toc.section.depth">2</xsl:param> + <!-- Control depth of TOC generation in sections --> + <xsl:param name="generate.section.toc.level" select="3"/> + + <xsl:param name="chunker.output.method" select="'html'"/> + + <xsl:param name="chunker.output.doctype-public" + select="'-//W3C//DTD HTML 4.01 Transitional//EN'"/> + <xsl:param name="chunker.output.doctype-system" + select="'http://www.w3.org/TR/html4/loose.dtd'"/> + + <!-- this enables generation of TOC in appendix --> + <xsl:param name="generate.toc"> +appendix toc +article/appendix toc +article toc +sect1 toc +sect2 toc +sect3 toc +sect4 toc +sect5 toc +section toc + </xsl:param> + +</xsl:stylesheet> diff --git a/.vim/doc/latex-suite-common.xsl b/.vim/doc/latex-suite-common.xsl @@ -0,0 +1,64 @@ +<?xml version="1.0"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version="1.0" + xmlns="http://www.w3.org/TR/xhtml1/transitional" + exclude-result-prefixes="#default"> + + <!-- $Id: latex-suite-common.xsl 997 2006-03-20 09:45:45Z srinathava $ --> + + <!-- Common customizations for all stylesheets --> + + <!-- this omits the trailing '.' in numbered sections --> + <xsl:param name="autotoc.label.separator" select="' '"/> + <xsl:param name="local.l10n.xml" select="document('')"/> + + <l:i18n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0"> + <l:l10n language="en"> + <l:context name="title-numbered"> + <l:template name="section" text="%n %t"/> + </l:context> + </l:l10n> + </l:i18n> + + <!-- override template for revhistory table --> + <xsl:template match="revhistory" mode="titlepage.mode"> + <xsl:variable name="numcols"> + <xsl:choose> + <xsl:when test="//authorinitials">3</xsl:when> + <xsl:otherwise>2</xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <div xmlns="http://www.w3.org/1999/xhtml" class="{name(.)}"> + <table border="2" cellspacing="4" width="100%" summary="Revision history"> + <tr> + <th align="left" valign="top" colspan="{$numcols}"> + <b> + <xsl:call-template name="gentext"> + <xsl:with-param name="key" select="'RevHistory'"/> + </xsl:call-template> + </b> + </th> + </tr> + <xsl:apply-templates mode="titlepage.mode"> + <xsl:with-param name="numcols" select="$numcols"/> + </xsl:apply-templates> + </table> + </div> + </xsl:template> + + <!-- + <xsl:template name="user.header.content"> + <div id="customheader"> + <span class="logo">TeX Refs</span> + </div> + </xsl:template> + + <xsl:template name="user.footer.content"> + <div id="customfooter"> + Copyright &#169; 2002 P. Karp, M. Wiedmann + </div> + </xsl:template> + --> + +</xsl:stylesheet> diff --git a/.vim/doc/latex-suite-quickstart.css b/.vim/doc/latex-suite-quickstart.css @@ -0,0 +1,182 @@ +/* + * Authors: Srinath Avadhanula and Mikolaj Machowski + * This style file borrows some elements from main.css, the style file used + * in cream.sf.net + * + * */ +P { + font-size : 12pt ; + font-family : helvetica, arial, verdana, sans-serif ; + vertical-align : top; +} +DT { + font-size : 11pt ; + font-family : helvetica, arial, verdana, sans-serif ; + vertical-align : top; +} +LI { + font-size : 12pt ; + font-family : helvetica, arial, verdana, sans-serif ; + vertical-align : top; +} + +DIV.header { + margin : 0.5cm ; + width : 800px ; + height : 100 +} +.note { +} + +TD { + font-size : 11pt ; + font-family : helvetica, arial, verdana, sans-serif ; + vertical-align : top; +} +TD.menu { + text-align : center ; + font-family : verdana, helvetica, sans-serif +} +TD.footright { + text-align : right ; + font-size : 10pt ; + font-family : verdana, helvetica, sans-serif +} +TD.leftpanel { + font-size: 14px ; + font-family: verdana, helvetica, sans-serif ; + vertical-align: top ; + width: 150px; + padding: 15px; + background-color: #88aaaa; +} +TD.mainpanel { + font-size : 12pt ; + font-family : helvetica, arial, verdana, sans-serif ; + vertical-align : top; + padding: 15px; +} +TD.footpanel { + font-size: 12px ; + font-family: verdana, helvetica, sans-serif ; + vertical-align: top ; + text-align: right; + padding: 5px; + background-color: #88aaaa; +} +.navigation { + vertical-align: top; + width: 150px; + padding: 15px; + background-color: #445555; + color: #fffcfc; +} +.navheader { + margin-top: -0.5em; + margin-bottom: 0.5em; + text-align: right; + color: #446644; + font-size: 14px; + font-weight: bold; +} + +SPAN.menu { + text-align : center ; + font-size : 12pt ; + font-family : verdana, helvetica, sans-serif +} + +DIV.merit { + margin : 0.5cm ; + width : 800px +} + +TABLE.meritum { + margin : 0.5cm ; + border : 0 +} +.foot { + margin : 0.5cm ; + width : 800px +} +.head { + margin : 0.5cm ; +} + +CODE { + font-family: "Andale Mono", "Courier New", "Courier", monospace; + background-color: #eef0f3; + white-space: nowrap; +} + +.singlesmall { + font-size: 14px; +} + +.doublesmall { + font-size: 12px; +} + + +DIV.footer { + margin : 0.5cm ; + width : 800px +} +.qa { + margin : 0.5cm ; + font-size : 16px; + font-weight : bold; +} +.ans { + margin : 0.5cm ; + font-weight : normal; +} + +H2.hline { + text-align : center ; + font-family : verdana, helvetica, sans-serif +} + +A.extlinks { + font-size : 11pt ; + font-family : verdana, helvetica, sans-serif ; + font-weight : bold +} + +TT { + font-family: courier,sans-serif; + font-size: 11pt; +} +PRE.programlisting { + font-family: courier,sans-serif; + font-size: 10pt; + background-color:#eef0f3; + border-color: #000000; + border-width: 1px; + border-style: solid; +} +SPAN.conflict { + font-size : small ; + font-family: courier,sans-serif; + color : #DD4444; +} +HR.navig { + color: #446644; + height: 1px; + margin-top: 1em; + border-top: 0px; /* Mozilla work-around to eliminate "groove" */ +} +A.question { + color: #000000; + height: 1px; + margin-top: 1em; + border-top: 0px; /* Mozilla work-around to eliminate "groove" */ +} +A.question:hover { + color: #000000; + background-color: #eef0f3; + height: 1px; + margin-top: 1em; + border-top: 0px; /* Mozilla work-around to eliminate "groove" */ +} + diff --git a/.vim/doc/latex-suite-quickstart.html b/.vim/doc/latex-suite-quickstart.html @@ -0,0 +1,353 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>A (very) quick introduction to Latex-Suite</title><link rel="stylesheet" href="latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><meta name="description" content=""></meta></head><body><div xml:lang="en" class="article" title="A (very) quick introduction to Latex-Suite"><div class="titlepage"><div><div><h2 class="title"><a id="id526602"></a>A (very) quick introduction to Latex-Suite</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Srinath</span> <span class="surname">Avadhanula</span></h3><div class="affiliation"><div class="address"><p><code class="email">&lt;<a class="email" href="mailto:srinath AT fastmail DOT fm">srinath AT fastmail DOT fm</a>&gt;</code></p></div></div></div></div><div><div class="abstract" title="Abstract"><p class="title"><b>Abstract</b></p> + Latex-Suite is a comprehensive set of scripts to aid in editing, compiling and + viewing LaTeX documents. A thorough explanation of the full + capabilities of Latex-Suite is described in the user manual. This guide on the + other hand, provides a quick 30-45 minute running start to some of the + more commonly used functionalities of Latex-Suite. + </div></div></div><hr></hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="#lsq-using-tutorial">1 Using this tutorial</a></span></dt><dt><span class="section"><a href="#lsq-inserting-template">2 Inserting a template</a></span></dt><dt><span class="section"><a href="#lsq-lsq-inserting-package">3 Inserting a package</a></span></dt><dt><span class="section"><a href="#lsq-insert-environment">4 Inserting an Environment</a></span></dt><dt><span class="section"><a href="#lsq-keyboard-shortcuts">5 A few keyboard shortcuts</a></span></dt><dt><span class="section"><a href="#lsq-folding">6 Folding in Latex-Suite</a></span></dt><dt><span class="section"><a href="#lsq-inserting-reference">7 Inserting a Reference</a></span></dt><dt><span class="section"><a href="#lsq-compiling">8 Compiling a document</a></span></dt><dd><dl><dt><span class="section"><a href="#lsq-debugging">8.1 Debugging LaTeX source files</a></span></dt></dl></dd><dt><span class="section"><a href="#lsq-viewing-dvi">9 Viewing DVI files</a></span></dt><dd><dl><dt><span class="section"><a href="#lsq-quick-forward-searching">9.1 Performing forward searches</a></span></dt><dt><span class="section"><a href="#lsq-quick-inverse-searching">9.2 Performing inverse searches</a></span></dt></dl></dd><dt><span class="section"><a href="#lsq-conclusions">10 Conclusions</a></span></dt></dl></div><div class="section" title="1 Using this tutorial"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="lsq-using-tutorial"></a>1 Using this tutorial</h2></div></div></div><p> + This tutorial assumes that you have vim version 6.1+ installed on your + machine. To check, open vim and type + </p><pre class="programlisting">:ver</pre><p> + You will see the version in the first line of the output. Get the latest + vim version from <a class="ulink" href="http://vim.sf.net" target="_top">http://vim.sf.net</a>. + </p><p> + Assuming you have Vim 6.1+ already up and running, follow the + instructions <a class="ulink" href="http://vim-latex.sourceforge.net/index.php?subject=download&amp;title=Download" target="_top">here</a> + to set up Latex-Suite. Remember to make sure your + <code class="literal">'grepprg'</code> setting of Vim works. + </p><p> + Good, now you are all set to start the tutorial. Since this tutorial + aims to explain the newbie-friendly version of Latex-Suite, it needs some GUI + functionality. Therefore, at least for this tutorial, open the gui + version of vim. (On MS windows, this is the default). Open up this help + file in either the same gvim session in a split window or in a different + session and follow the (friendly) instructions. + </p></div><div class="section" title="2 Inserting a template"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="lsq-inserting-template"></a>2 Inserting a template</h2></div></div></div><p> + Start up gvim and begin editing a new file. + </p><pre class="programlisting">e newfile.tex</pre><p> + If the installation went well, you should see a new set of + menus appear. Goto <code class="literal">Tex-Suite &gt; Templates</code>. You will see + a number of templates to choose from. For now, choose to insert a + template for an article. You should get the following in the main + vim window (after possibly a hit-enter prompt). + </p><pre class="programlisting"> + 1 % File: sample.tex + 2 % Created: Sun Jun 22 04:00 PM 2003 P + 3 % Last Change: Sun Jun 22 04:00 PM 2003 P + 4 % + 5 \documentclass[a4paper]{article} + 6 \begin{document} + 7 + 8 \end{document} + 9 + 10 ~ + 11 ~ + 12 ~ + 13 ~ +-- INSERT -- 7,1 All +</pre><p> + </p><img src=""></img><p> + The cursor is left on line 7 (just after the + <code class="literal">\begin{document}</code> line) from where you can start + typing straight away. Trying to lessen movement is a recurring theme in + Latex-Suite. + </p></div><div class="section" title="3 Inserting a package"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="lsq-lsq-inserting-package"></a>3 Inserting a package</h2></div></div></div><p> + Assume that we are writing a mathematical paper and we want to use the + popular amsmath package. We will use some functionality which + Latex-Suite provides specifically for including LaTeX packages, + providing options etc. Navigate to before the + <code class="literal">\begin{document}</code> line (The portion of the document + before the <code class="literal">\begin{document}</code> is called the + <span class="emphasis"><em>preamble</em></span> in LaTeX). On an empty line in the + preamble, type the single word <code class="literal">amsmath</code> and then press + <code class="literal">&lt;F5&gt;</code> in normal mode. The line will change to + </p><pre class="programlisting">\usepackage[]{amsmath}&lt;++&gt;</pre><p> + with the cursor positioned conveniently between the + <code class="literal">[]</code>'s. For now, do not worry about the trailing + <code class="literal">&lt;++&gt;</code> at the end of this line. Assume we want to + provide the <code class="literal">sumlimits</code> options to amsmath. You can + either type in this option manually, or choose from a menu of package + options which Latex-Suite automatically creates when you insert a + package using <code class="literal">&lt;F5&gt;</code>. With the cursor still + placed between the <code class="literal">[]</code>, goto <code class="literal">TeX-Suite &gt; + Packages &gt; amsmath Options</code>. Choose the + <code class="literal">sumlimits</code> option. The package line should get + converted to: + </p><pre class="programlisting">\usepackage[sumlimits,]{amsmath}&lt;++&gt;</pre><p> + </p><p> + with the cursor before <code class="literal">]</code>. Press + <code class="literal">&lt;C-j&gt;</code> in insert mode. You will see the cursor + jump to the end of the package line and the trailing + <code class="literal">&lt;++&gt;</code> will disappear. What just happened?! You had + your first taste of <span class="emphasis"><em>Placeholders</em></span>. Read more about + them (later) <a class="ulink" href="http://vim-latex.sourceforge.net/documentation/latex-suite/latex-macros.html" target="_top">here</a>. + In short, pressing <code class="literal">&lt;C-j&gt;</code> in insert mode takes + you to the next <code class="literal">&lt;++&gt;</code> in the text. + </p></div><div class="section" title="4 Inserting an Environment"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="lsq-insert-environment"></a>4 Inserting an Environment</h2></div></div></div><p> + Now let us type in a simple formula in LaTeX. Move back to the body of + the document (The portion of the document between + <code class="literal">\begin{document}</code> and + <code class="literal">\end{document}</code> is called the body). Type in a few + simple sentences and then on an empty line, type the single word + <code class="literal">eqnarray</code>. Escape to normal mode and press + <code class="literal">&lt;F5&gt;</code>. (Remember: + <code class="literal">&lt;F5&gt;</code> is very useful!) This time, the line will + change to: + </p><pre class="programlisting">\begin{eqnarray} + \label{}&lt;++&gt; +\end{eqnarray}&lt;++&gt;</pre><p> + with the cursor between the <code class="literal">{}</code>. Enter a label. We + will use <code class="literal">eqn:euler</code>. After typing in + <code class="literal">eqn:euler</code>, press <code class="literal">&lt;C-j&gt;</code>. This + will take you outside the curly-braces. Another time you used a + Placeholder! + </p></div><div class="section" title="5 A few keyboard shortcuts"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="lsq-keyboard-shortcuts"></a>5 A few keyboard shortcuts</h2></div></div></div><p> + Now to type in the famous Euler formula. Our aim is to type + </p><pre class="programlisting">e^{j\pi} + 1 &amp;=&amp; 0</pre><p> Instead + of typing this blindly, let us use a few shortcuts to reduce + movement. Start out by typing <code class="literal">e^</code>. Now instead of + typing <code class="literal">{</code>, type another <code class="literal">^</code>. You + will see the <code class="literal">e^^</code> change instantly to + <code class="literal">e^{}&lt;++&gt;</code> with the cursor between + <code class="literal">{}</code>'s. (The <code class="literal">^^</code> changed to + <code class="literal">^{}&lt;++&gt;</code>.) Continue with the following sequence of + letters: <code class="literal">j`p</code>. This will change instantly to + <code class="literal">j\pi</code>. (The <code class="literal">`p</code> changed to + <code class="literal">\pi</code>.) Having typed in all we need to type between + the <code class="literal">{}</code>'s, press <code class="literal">&lt;C-j&gt;</code>. + You will pop back out of the curly-braces. Continue typing the rest + of the formula. You can use <code class="literal">==</code> as a shortcut for + <code class="literal">&amp;=&amp;</code>. Latex-Suite provides a large number + of such shortcuts which should making typing much more fun and fast + if you get acquainted with them. A list is provided <a class="ulink" href="http://vim-latex.sourceforge.net/documentation/latex-suite/auc-tex-mappings.html" target="_top">here</a>. Definitely spend some time getting a feel for + them. Most of them are pretty intuitive like <code class="literal">`/</code> + for <code class="literal">\frac{}{}</code>, <code class="literal">`8</code> for + <code class="literal">\infty</code> etc. + </p><p> + In order to understand the next section better, it will be helpful + to have one more <code class="literal">\label</code>. Lets use the handy + <code class="literal">&lt;F5&gt;</code> + key to insert another equation. This time something simple like the + following will do: + </p><pre class="programlisting">\begin{eqnarray} + \label{eqn:simple} + 1 + 1 = 2 +\end{eqnarray}</pre><p> + </p></div><div class="section" title="6 Folding in Latex-Suite"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="lsq-folding"></a>6 Folding in Latex-Suite</h2></div></div></div><p> + Okay, we have typed enough. At this stage, hopefully, your file is + looking something like this: +</p><pre class="programlisting"> + 1 % File: sample.tex + 2 % Created: Sun Jun 22 04:00 PM 2003 P + 3 % Last Change: Mon Dec 15 07:00 PM 2003 + 4 % + 5 \documentclass[a4paper]{article} + 6 + 7 \usepackage[sumlimits,]{amsmath} + 8 + 9 \begin{document} + 10 \begin{eqnarray} + 11 \label{eqn:euler} + 12 e^{j\pi} + 1 &amp;=&amp; 0 + 13 \end{eqnarray} + 14 This is the famous euler equation. I + 15 will type another equation, just as + 16 true: + 17 \begin{eqnarray} + 18 \label{eqn:simple} + 19 1 + 1 &amp;=&amp; 2 + 20 \end{eqnarray} + 21 This is my contribution to mathematics. + 22 \end{document} +</pre><p> + In normal mode, press <code class="literal">\rf</code>. This will fold up the + entire file and you should see the file looking as below: +</p><pre class="programlisting"> + 1 % File: sample.tex + 2 % Created: Sun Jun 22 04:00 PM 2003 P + 3 % Last Change: Mon Dec 15 07:00 PM 2003 + 4 % + 5 +-- 4 lines: Preamble: \documentclass[a4paper]{article} ----- + 9 \begin{document} + 10 +-- 4 lines: eqnarray (eqn:euler) \label{eqn:euler} ----------- + 14 This is the famous euler equation. I + 15 will type another equation, just as + 16 true: + 10 +-- 4 lines: eqnarray (eqn:simple) \label{eqn:simple} --------- + 21 This is my contribution to mathematics. + 22 \end{document} +</pre><p> + What has happened is that Latex-Suite folded away blocks of LaTeX code into + folded regions. You can open and close folds by using the command + <code class="literal">za</code> in normal mode. + </p></div><div class="section" title="7 Inserting a Reference"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="lsq-inserting-reference"></a>7 Inserting a Reference</h2></div></div></div><p> + A necessary part of LaTeX editing is referencing equations, figures, + bibliographic entries etc. This is done with the + <code class="literal">\ref</code> and the <code class="literal">\cite</code> commands. + Latex-Suite provides an easy way to do this. Somewhere in the body of + the document, type in the following sentence + </p><pre class="programlisting">This is a reference to (\ref{}).</pre><p> + With the cursor between the <code class="literal">{}</code> press + <code class="literal">&lt;F9&gt;</code> in insert mode. Your vim session will + sprout two new windows and it should look like below: +</p><pre class="programlisting"> + 9 \begin{document} + 10 +-- 4 lines: eqnarray (eqn:euler) : \label{eqn:euler}----------------------- + 14 This is the famous euler equation. I + 15 will type another equation, just as + 16 true: + 17 +-- 4 lines: eqnarray (eqn:simple) : \label{eqn:simple}--------------------- + 21 This is my contribution to mathematics. + 22 This is a reference to (\ref{}&lt;++&gt;)&lt;++&gt; + 23 \end{document} +~ +~ +~ +test.tex [+] 22,29 Bot +test.tex|11| \label{eqn:euler} +test.tex|18| \label{eqn:simple} +~ +~ +~ +[Error List] 1,1 All + 7 \usepackage[sumlimits,]{amsmath} + 8 + 9 \begin{document} + 10 \begin{eqnarray} + 11 \label{eqn:euler} + 12 e^{j\pi} + 1 &amp;=&amp; 0 + 13 \end{eqnarray} + 14 This is the famous euler equation. I + 15 will type another equation, just as + 16 true: +test.tex [Preview][+] 11,2-5 46% +</pre><p> + </p><img src=""></img><p> + The cursor will relocate to the middle window which shows all + <code class="literal">\label</code>s found in all the <code class="literal">.tex</code> file + in the current directory. + You can scroll up and down in the middle window till you reach the + reference you want to insert. Notice how when you scroll in the + middle window, the bottom "Preview" window scrolls automatically to + show you the location of the current selection. This helps you + identify the reference with greater ease because often times, + <code class="literal">\labels</code> are not descriptive enough or there might be too + many of them. To insert the reference, just position the cursor on + the relevant line in the middle window and press + <code class="literal">&lt;enter&gt;</code>. The line which you were editing will change + to: + </p><pre class="programlisting">This is a reference to (\ref{eqn:euler})</pre><p> + and the bottom windows close automatically. + </p><p> + The <code class="literal">&lt;F9&gt;</code> key also works for inserting + <code class="literal">\cite</code> commands to reference bibliographic entries, + inserting file names for the <code class="literal">\inputgraphics</code> command + and just plain searching for words. Click <a class="ulink" href="http://vim-latex.sourceforge.net/documentation/latex-suite/latex-completion.html" target="_top">here</a> + for more information. + </p></div><div class="section" title="8 Compiling a document"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="lsq-compiling"></a>8 Compiling a document</h2></div></div></div><p> + Great! We have just created a small latex file. The next step is to + make the latex compiler create a .dvi file from it. Compiling via + latex-suite is simple. Goto normal mode and press <code class="literal">\ll</code> + (replace <code class="literal">\</code> with whatever <code class="literal">mapleader</code> setting you + have). This will call the latex compiler. If all goes well, then + the focus should return to the vim window. + </p><p> + Nothing happend? Ouch! You might need to do some additional settings as + described <a class="ulink" href="http://vim-latex.sourceforge.net/index.php?subject=faq&amp;title=FAQ#faq-2" target="_top">here.</a> + </p><div class="section" title="8.1 Debugging LaTeX source files"><div class="titlepage"><div><div><h3 class="title"><a id="lsq-debugging"></a>8.1 Debugging LaTeX source files</h3></div></div></div><p> + To illustrate the debugging procedure, let's create a few mistakes + in the file. Insert the following ``mistakes'' in the file: + </p><pre class="programlisting">This is a $\mistake$. +And this is $\another$</pre><p> + Now press <code class="literal">\ll</code> again. This time you will notice that + after compilation finishes, the cursor automatically lands on + <code class="literal">$\mistake$</code>. In addition, 2 new windows will appear + as shown here: + </p><img src=""></img><p> + The middle window is an <span class="emphasis"><em>Error List</em></span> window + showing you the errors which the latex compiler found. Th bottom + window is a <span class="emphasis"><em>Log Preview</em></span> window, which shows you + the context of the error made by displaying the relevant portion of + the <code class="literal">.log</code> file created during the latex + compilation procedure. Jump to the <span class="emphasis"><em>Error List</em></span> + window and try scrolling around in it using either the <code class="literal">j, + k</code> keys or the arrow keys. You will notice that the + <span class="emphasis"><em>Log Preview</em></span> window scrolls automatically to + retain the context of the error you are currently located on. If you + press <code class="literal">&lt;enter&gt;</code> on any line, you will see the + cursor jump to the location of the error. Latex-Suite tries to guess + the column location as best as it can so you can continue typing + straight away. + </p></div><p> + Having got a taste for compiling, proceed by deleting the erroneous + lines and re-compiling. + </p><p> + The Latex-Suite compiler is capable of much more including + selectively filtering out common errors which you might want to + ignore for the moment, compiling parts of a document, setting + levels of verbosity in the compiler output etc. See <a class="ulink" href="http://vim-latex.sourceforge.net/documentation/latex-suite/latex-compiling.html" target="_top">here</a> + for more. + </p></div><div class="section" title="9 Viewing DVI files"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="lsq-viewing-dvi"></a>9 Viewing DVI files</h2></div></div></div><p> + Now that you have compiled your first latex source, its time to + view it. Again, this should be pretty simple. Press + <code class="literal">\lv</code> in normal mode. Depending on your platform, a DVI + viewer program should open up and display the dvi file generated in + compilation step previously. + </p><p> + Nothing happend? Ouch! You might need to do some additional settings as + described <a class="ulink" href="http://vim-latex.sourceforge.net/index.php?subject=faq&amp;title=FAQ#faq-3" target="_top">here.</a> + </p><div class="section" title="9.1 Performing forward searches"><div class="titlepage"><div><div><h3 class="title"><a id="lsq-quick-forward-searching"></a>9.1 Performing forward searches</h3></div></div></div><p> + If you are using a modern DVI viewer, then it is possible to do what + is called forward and inverse searching. However, you will need to + customize the standard Latex-Suite distribution in order to utilize + this functionality. Type in the following on the command line: + + </p><pre class="programlisting">:let g:Tex_CompileRule_dvi = 'latex -src-specials -interaction=nonstopmode $*' +:TCTarget dvi</pre><p> + + Now recompile the latex file by pressing <code class="literal">\ll</code>. + This time, instead of pressing <code class="literal">\lv</code> to view the + file, press <code class="literal">\ls</code> from within the tex file. If the + DVI viewer supports forward searching (most of them do), then the + viewer will actually display the portion of the DVI file + corresponding to the location where you were editing the tex file. + </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> + The reason Latex-Suite does not have this setting by default is + that on some systems this causes unpredictable results in the DVI + output. If you find the DVI output satisfactory, then you can + insert the first of the 2 lines above into your + <code class="literal">$VIM/ftplugin/tex.vim</code> file. + <code class="literal">$VIM</code> is <code class="literal">~/vimfiles</code> for + windows and <code class="literal">~/.vim</code> for *nix machines. + </p></div></div><div class="section" title="9.2 Performing inverse searches"><div class="titlepage"><div><div><h3 class="title"><a id="lsq-quick-inverse-searching"></a>9.2 Performing inverse searches</h3></div></div></div><p> + Most DVI viewers also support inverse searching, whereby you can + make the DVI viewer ask vim to display the tex source corresponding + to the DVI file being shown. This is extremely helpful while + proofreading large documents. + </p><p> + Simply double-click anywhere in the viewer window. If the viewer + supports it, then it will attempt to open an editor window at the + location corresponding to where you double-clicked. On *nix + platforms, Latex-Suite attempts to start the viewer program in such + a way that it already knows to use vim to open the tex source. Thus + you should see a vim window open up showing the tex file. However, + if there is an error, or some other program is used, you will need + to tell the viewer program to use gvim as the editor. On windows + platforms, if you use the commonly available <code class="literal">yap</code> + viewer (available as part of the miktex distribution), then this + option can be set from <code class="literal">View &gt; Options &gt; Inverse + Search</code>. In the <code class="literal">Command line:</code> window, + write + </p><pre class="programlisting">"C:\Program Files\vim\vim61\gvim" -c ":RemoteOpen +%l %f"</pre><p> + (Customize the path according to where you have installed gvim). + If you double click in the view pane now, you will see gvim start + up and take you to the relevant portion of the tex file. + </p></div></div><div class="section" title="10 Conclusions"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="lsq-conclusions"></a>10 Conclusions</h2></div></div></div><p> + Thats all folks! By now, you should know enough of the basic functions + of latex-suite. Ofcourse, latex-suite is capable of much, much more such + as compiling files multiple times to resolve changed labels, compiling + dependencies, handling user packages and more. To get a feel for that, + you will need to take a look at the <a class="ulink" href="http://vim-latex.sourceforge.net/index.php?subject=manual&amp;title=Manual#user-manual" target="_top">Latex-Suite + user manual.</a> + </p></div></div></body></html> diff --git a/.vim/doc/latex-suite-quickstart.txt b/.vim/doc/latex-suite-quickstart.txt @@ -0,0 +1,448 @@ + A (very) quick introduction to Latex-Suite + *latex-suite-quickstart.txt* + Srinath Avadhanula <srinath AT fastmail DOT fm> + + + + Abstract + ======== +Latex-Suite is a comprehensive set of scripts to aid in editing, compiling and +viewing LaTeX documents. A thorough explanation of the full capabilities of +Latex-Suite is described in the user manual. This guide on the other hand, +provides a quick 30-45 minute running start to some of the more commonly used +functionalities of Latex-Suite. + + *latex-suite-quickstart.txt-toc* +|lq_1| Using this tutorial +|lq_2| Inserting a template +|lq_3| Inserting a package +|lq_4| Inserting an Environment +|lq_5| A few keyboard shortcuts +|lq_6| Folding in Latex-Suite +|lq_7| Inserting a Reference +|lq_8| Compiling a document + |lq_8_1| Debugging LaTeX source files +|lq_9| Viewing DVI files + |lq_9_1| Performing forward searches + |lq_9_2| Performing inverse searches +|lq_10| Conclusions + +================================================================================ +Viewing this file + +This file can be viewed with all the sections and subsections folded to ease +navigation. By default, vim does not fold help documents. To create the folds, +press za now. The folds are created via a foldexpr which can be seen in the +last section of this file. + +See |usr_28.txt| for an introduction to folding and |fold-commands| for key +sequences and commands to work with folds. + +================================================================================ +Using this tutorial *lq_1* *lq_a_bc* + *lsq-using-tutorial* + + + +This tutorial assumes that you have vim version 6.1+ installed on your machine. +To check, open vim and type > + :ver +You will see the version in the first line of the output. Get the latest vim +version from http://vim.sf.net |lq_u_1|. + +Assuming you have Vim 6.1+ already up and running, follow the instructions here +|lq_u_2| to set up Latex-Suite. Remember to make sure your 'grepprg' setting of +Vim works. + +Good, now you are all set to start the tutorial. Since this tutorial aims to +explain the newbie-friendly version of Latex-Suite, it needs some GUI +functionality. Therefore, at least for this tutorial, open the gui version of +vim. (On MS windows, this is the default). Open up this help file in either the +same gvim session in a split window or in a different session and follow the +(friendly) instructions. + +================================================================================ +Inserting a template *lq_2* *lq_a_bd* + *lsq-inserting-template* + + + +Start up gvim and begin editing a new file. > + e newfile.tex +If the installation went well, you should see a new set of menus appear. Goto +Tex-Suite > Templates. You will see a number of templates to choose from. For +now, choose to insert a template for an article. You should get the following in +the main vim window (after possibly a hit-enter prompt). > + + 1 % File: sample.tex + 2 % Created: Sun Jun 22 04:00 PM 2003 P + 3 % Last Change: Sun Jun 22 04:00 PM 2003 P + 4 % + 5 \documentclass[a4paper]{article} + 6 \begin{document} + 7 + 8 \end{document} + 9 + 10 ~ + 11 ~ + 12 ~ + 13 ~ + -- INSERT -- 7,1 All + + + +The cursor is left on line 7 (just after the \begin{document} line) from where +you can start typing straight away. Trying to lessen movement is a recurring +theme in Latex-Suite. + +================================================================================ +Inserting a package *lq_3* *lq_a_be* + *lsq-lsq-inserting-package* + + + +Assume that we are writing a mathematical paper and we want to use the popular +amsmath package. We will use some functionality which Latex-Suite provides +specifically for including LaTeX packages, providing options etc. Navigate to +before the \begin{document} line (The portion of the document before the +\begin{document} is called the _preamble_ in LaTeX). On an empty line in the +preamble, type the single word amsmath and then press <F5> in normal mode. The +line will change to > + \usepackage[]{amsmath}<++> +with the cursor positioned conveniently between the []'s. For now, do not worry +about the trailing <++> at the end of this line. Assume we want to provide the +sumlimits options to amsmath. You can either type in this option manually, or +choose from a menu of package options which Latex-Suite automatically creates +when you insert a package using <F5>. With the cursor still placed between the +[], goto TeX-Suite > Packages > amsmath Options. Choose the sumlimits option. +The package line should get converted to: > + \usepackage[sumlimits,]{amsmath}<++> + + +with the cursor before ]. Press <C-j> in insert mode. You will see the cursor +jump to the end of the package line and the trailing <++> will disappear. What +just happened?! You had your first taste of _Placeholders_. Read more about them +(later) here |lq_u_3|. In short, pressing <C-j> in insert mode takes you to the +next <++> in the text. + +================================================================================ +Inserting an Environment *lq_4* *lq_a_bf* + *lsq-insert-environment* + + + +Now let us type in a simple formula in LaTeX. Move back to the body of the +document (The portion of the document between \begin{document} and +\end{document} is called the body). Type in a few simple sentences and then on +an empty line, type the single word eqnarray. Escape to normal mode and press +<F5>. (Remember: <F5> is very useful!) This time, the line will change to: > + \begin{eqnarray} + \label{}<++> + \end{eqnarray}<++> +<with the cursor between the {}. Enter a label. We will use eqn:euler. After +typing in eqn:euler, press <C-j>. This will take you outside the curly-braces. +Another time you used a Placeholder! + +================================================================================ +A few keyboard shortcuts *lq_5* *lq_a_bg* + *lsq-keyboard-shortcuts* + + + +Now to type in the famous Euler formula. Our aim is to type > + e^{j\pi} + 1 &=& 0 +Instead of typing this blindly, let us use a few shortcuts to reduce movement. +Start out by typing e^. Now instead of typing {, type another ^. You will see +the e^^ change instantly to e^{}<++> with the cursor between {}'s. (The ^^ +changed to ^{}<++>.) Continue with the following sequence of letters: j`p. This +will change instantly to j\pi. (The `p changed to \pi.) Having typed in all we +need to type between the {}'s, press <C-j>. You will pop back out of the +curly-braces. Continue typing the rest of the formula. You can use == as a +shortcut for &=&. Latex-Suite provides a large number of such shortcuts which +should making typing much more fun and fast if you get acquainted with them. A +list is provided here |lq_u_4|. Definitely spend some time getting a feel for +them. Most of them are pretty intuitive like `/ for \frac{}{}, `8 for \infty +etc. + +In order to understand the next section better, it will be helpful to have one +more \label. Lets use the handy <F5> key to insert another equation. This time +something simple like the following will do: > + \begin{eqnarray} + \label{eqn:simple} + 1 + 1 = 2 + \end{eqnarray} + + +================================================================================ +Folding in Latex-Suite *lq_6* *lq_a_bh* *lsq-folding* + + + +Okay, we have typed enough. At this stage, hopefully, your file is looking +something like this: > + + 1 % File: sample.tex + 2 % Created: Sun Jun 22 04:00 PM 2003 P + 3 % Last Change: Mon Dec 15 07:00 PM 2003 + 4 % + 5 \documentclass[a4paper]{article} + 6 + 7 \usepackage[sumlimits,]{amsmath} + 8 + 9 \begin{document} + 10 \begin{eqnarray} + 11 \label{eqn:euler} + 12 e^{j\pi} + 1 &=& 0 + 13 \end{eqnarray} + 14 This is the famous euler equation. I + 15 will type another equation, just as + 16 true: + 17 \begin{eqnarray} + 18 \label{eqn:simple} + 19 1 + 1 &=& 2 + 20 \end{eqnarray} + 21 This is my contribution to mathematics. + 22 \end{document} + +In normal mode, press \rf. This will fold up the entire file and you should see +the file looking as below: > + + 1 % File: sample.tex + 2 % Created: Sun Jun 22 04:00 PM 2003 P + 3 % Last Change: Mon Dec 15 07:00 PM 2003 + 4 % + 5 +-- 4 lines: Preamble: \documentclass[a4paper]{article} ----- + 9 \begin{document} + 10 +-- 4 lines: eqnarray (eqn:euler) \label{eqn:euler} ----------- + 14 This is the famous euler equation. I + 15 will type another equation, just as + 16 true: + 10 +-- 4 lines: eqnarray (eqn:simple) \label{eqn:simple} --------- + 21 This is my contribution to mathematics. + 22 \end{document} + +What has happened is that Latex-Suite folded away blocks of LaTeX code into +folded regions. You can open and close folds by using the command za in normal +mode. + +================================================================================ +Inserting a Reference *lq_7* *lq_a_bi* + *lsq-inserting-reference* + + + +A necessary part of LaTeX editing is referencing equations, figures, +bibliographic entries etc. This is done with the \ref and the \cite commands. +Latex-Suite provides an easy way to do this. Somewhere in the body of the +document, type in the following sentence > + This is a reference to (\ref{}). +With the cursor between the {} press <F9> in insert mode. Your vim session will +sprout two new windows and it should look like below: > + + 9 \begin{document} + 10 +-- 4 lines: eqnarray (eqn:euler) : \label{eqn:euler}----------------------- + 14 This is the famous euler equation. I + 15 will type another equation, just as + 16 true: + 17 +-- 4 lines: eqnarray (eqn:simple) : \label{eqn:simple}--------------------- + 21 This is my contribution to mathematics. + 22 This is a reference to (\ref{}<++>)<++> + 23 \end{document} + ~ + ~ + ~ + test.tex [+] 22,29 Bot + test.tex|11| \label{eqn:euler} + test.tex|18| \label{eqn:simple} + ~ + ~ + ~ + [Error List] 1,1 All + 7 \usepackage[sumlimits,]{amsmath} + 8 + 9 \begin{document} + 10 \begin{eqnarray} + 11 \label{eqn:euler} + 12 e^{j\pi} + 1 &=& 0 + 13 \end{eqnarray} + 14 This is the famous euler equation. I + 15 will type another equation, just as + 16 true: + test.tex [Preview][+] 11,2-5 46% + + + +The cursor will relocate to the middle window which shows all \labels found in +all the .tex file in the current directory. You can scroll up and down in the +middle window till you reach the reference you want to insert. Notice how when +you scroll in the middle window, the bottom "Preview" window scrolls +automatically to show you the location of the current selection. This helps you +identify the reference with greater ease because often times, \labels are not +descriptive enough or there might be too many of them. To insert the reference, +just position the cursor on the relevant line in the middle window and press +<enter>. The line which you were editing will change to: > + This is a reference to (\ref{eqn:euler}) +<and the bottom windows close automatically. + +The <F9> key also works for inserting \cite commands to reference bibliographic +entries, inserting file names for the \inputgraphics command and just plain +searching for words. Click here |lq_u_5| for more information. + +================================================================================ +Compiling a document *lq_8* *lq_a_bj* + *lsq-compiling* + +|lq_8_1| Debugging LaTeX source files + + +Great! We have just created a small latex file. The next step is to make the +latex compiler create a .dvi file from it. Compiling via latex-suite is simple. +Goto normal mode and press \ll (replace \ with whatever mapleader setting you +have). This will call the latex compiler. If all goes well, then the focus +should return to the vim window. + +Nothing happend? Ouch! You might need to do some additional settings as +described here. |lq_u_6| + + +-------------------------------------------------------------------------------- +Debugging LaTeX source files *lq_8_1* *lq_a_bk* + *lsq-debugging* + +To illustrate the debugging procedure, let's create a few mistakes in the file. +Insert the following ``mistakes'' in the file: > + This is a $\mistake$. + And this is $\another$ +Now press \ll again. This time you will notice that after compilation finishes, +the cursor automatically lands on $\mistake$. In addition, 2 new windows will +appear as shown here: + +The middle window is an _Error List_ window showing you the errors which the +latex compiler found. Th bottom window is a _Log Preview_ window, which shows +you the context of the error made by displaying the relevant portion of the .log +file created during the latex compilation procedure. Jump to the _Error List_ +window and try scrolling around in it using either the j, k keys or the arrow +keys. You will notice that the _Log Preview_ window scrolls automatically to +retain the context of the error you are currently located on. If you press +<enter> on any line, you will see the cursor jump to the location of the error. +Latex-Suite tries to guess the column location as best as it can so you can +continue typing straight away. +Having got a taste for compiling, proceed by deleting the erroneous lines and +re-compiling. + +The Latex-Suite compiler is capable of much more including selectively filtering +out common errors which you might want to ignore for the moment, compiling parts +of a document, setting levels of verbosity in the compiler output etc. See here +|lq_u_7| for more. + +================================================================================ +Viewing DVI files *lq_9* *lq_a_bl* + *lsq-viewing-dvi* + +|lq_9_1| Performing forward searches +|lq_9_2| Performing inverse searches + + +Now that you have compiled your first latex source, its time to view it. Again, +this should be pretty simple. Press \lv in normal mode. Depending on your +platform, a DVI viewer program should open up and display the dvi file generated +in compilation step previously. + +Nothing happend? Ouch! You might need to do some additional settings as +described here. |lq_u_8| + + +-------------------------------------------------------------------------------- +Performing forward searches *lq_9_1* *lq_a_bm* + *lsq-quick-forward-searching* + +If you are using a modern DVI viewer, then it is possible to do what is called +forward and inverse searching. However, you will need to customize the standard +Latex-Suite distribution in order to utilize this functionality. Type in the +following on the command line: > + :let g:Tex_CompileRule_dvi = 'latex -src-specials -interaction=nonstopmode $*' + :TCTarget dvi + + +Now recompile the latex file by pressing \ll. This time, instead of pressing \lv +to view the file, press \ls from within the tex file. If the DVI viewer supports +forward searching (most of them do), then the viewer will actually display the +portion of the DVI file corresponding to the location where you were editing the +tex file. + +NOTE: The reason Latex-Suite does not have this setting by default is that on + some systems this causes unpredictable results in the DVI output. If you + find the DVI output satisfactory, then you can insert the first of the 2 + lines above into your $VIM/ftplugin/tex.vim file. $VIM is ~/vimfiles for + windows and ~/.vim for *nix machines. + + + +-------------------------------------------------------------------------------- +Performing inverse searches *lq_9_2* *lq_a_bn* + *lsq-quick-inverse-searching* + +Most DVI viewers also support inverse searching, whereby you can make the DVI +viewer ask vim to display the tex source corresponding to the DVI file being +shown. This is extremely helpful while proofreading large documents. + +Simply double-click anywhere in the viewer window. If the viewer supports it, +then it will attempt to open an editor window at the location corresponding to +where you double-clicked. On *nix platforms, Latex-Suite attempts to start the +viewer program in such a way that it already knows to use vim to open the tex +source. Thus you should see a vim window open up showing the tex file. However, +if there is an error, or some other program is used, you will need to tell the +viewer program to use gvim as the editor. On windows platforms, if you use the +commonly available yap viewer (available as part of the miktex distribution), +then this option can be set from View > Options > Inverse Search. In the Command +line: window, write > + "C:\Program Files\vim\vim61\gvim" -c ":RemoteOpen +%l %f" +(Customize the path according to where you have installed gvim). If you double +click in the view pane now, you will see gvim start up and take you to the +relevant portion of the tex file. + +================================================================================ +Conclusions *lq_10* *lq_a_bo* + *lsq-conclusions* + + + +Thats all folks! By now, you should know enough of the basic functions of +latex-suite. Ofcourse, latex-suite is capable of much, much more such as +compiling files multiple times to resolve changed labels, compiling +dependencies, handling user packages and more. To get a feel for that, you will +need to take a look at the Latex-Suite user manual. |lq_u_9| + +================================================================================ +URLs used in this file + +*lq_u_1* : http://vim.sf.net +*lq_u_2* : http://vim-latex.sourceforge.net/index.php?subject=download&title=Download +*lq_u_3* : http://vim-latex.sourceforge.net/documentation/latex-suite/latex-macros.html +*lq_u_4* : http://vim-latex.sourceforge.net/documentation/latex-suite/auc-tex-mappings.html +*lq_u_5* : http://vim-latex.sourceforge.net/documentation/latex-suite/latex-completion.html +*lq_u_6* : http://vim-latex.sourceforge.net/index.php?subject=faq&title=FAQ#faq-2 +*lq_u_7* : http://vim-latex.sourceforge.net/documentation/latex-suite/latex-compiling.html +*lq_u_8* : http://vim-latex.sourceforge.net/index.php?subject=faq&title=FAQ#faq-3 +*lq_u_9* : http://vim-latex.sourceforge.net/index.php?subject=manual&title=Manual#user-manual + +================================================================================ +About this file + +This file was created automatically from its XML variant using db2vim. db2vim is +a python script which understands a very limited subset of the Docbook XML 4.2 +DTD and outputs a plain text file in vim help format. + +db2vim can be obtained via anonymous CVS from sourceforge.net. Use + +cvs -d:pserver:anonymous@cvs.vim-latex.sf.net:/cvsroot/vim-latex co db2vim + +Or you can visit the web-interface to sourceforge CVS at: +http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/vim-latex/db2vim/ + +The following modelines should nicely fold up this help manual. + +vim:ft=help:fdm=expr:nowrap +vim:foldexpr=getline(v\:lnum-1)=~'-\\{80}'?'>2'\:getline(v\:lnum-1)=~'=\\{80}'?'>1'\:getline(v\:lnum)=~'=\\{80}'?'0'\:getline(v\:lnum)=~'-\\{80}'?'1'\:'=' +vim:foldtext=substitute(v\:folddashes.substitute(getline(v\:foldstart),'\\s*\\*.*',"",""),'^--','\ \ \ \ \ \ ','') +================================================================================ diff --git a/.vim/doc/latex-suite-quickstart.xml b/.vim/doc/latex-suite-quickstart.xml @@ -0,0 +1,471 @@ +<?xml version='1.0' encoding='ISO-8859-1'?> + +<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" + "docbook-xml/docbookx.dtd" +[<!ENTITY dummy "dummy"> +<!ENTITY date "$Date: 2006-03-20 10:45:45 +0100 (Mo, 20. Mär 2006) $"> +<!ENTITY ls "Latex-Suite"> +<!ENTITY latex "LaTeX"> +<!ENTITY vim "Vim"> +<!ENTITY ph "&lt;++&gt;"> +]> +<article lang="en"> + <articleinfo id="lsq-articleinfo"> + + <title id="lsq-articleinfo-title">A (very) quick introduction to Latex-Suite</title> + + <author> + <firstname>Srinath</firstname> + <surname>Avadhanula</surname> + <affiliation> + <address><email>srinath AT fastmail DOT fm</email></address> + </affiliation> + </author> + + <abstract> + &ls; is a comprehensive set of scripts to aid in editing, compiling and + viewing &latex; documents. A thorough explanation of the full + capabilities of &ls; is described in the user manual. This guide on the + other hand, provides a quick 30-45 minute running start to some of the + more commonly used functionalities of &ls;. + </abstract> + + <date>&date;</date> + + </articleinfo> + <section id="lsq-using-tutorial"> + <title id="using-tutorial">Using this tutorial</title> + <para> + This tutorial assumes that you have vim version 6.1+ installed on your + machine. To check, open vim and type + <programlisting>:ver</programlisting> + You will see the version in the first line of the output. Get the latest + vim version from <ulink url="http://vim.sf.net">http://vim.sf.net</ulink>. + </para> + <para> + Assuming you have Vim 6.1+ already up and running, follow the + instructions <ulink + url="http://vim-latex.sourceforge.net/index.php?subject=download&amp;title=Download">here</ulink> + to set up Latex-Suite. Remember to make sure your + <literal>'grepprg'</literal> setting of &vim; works. + </para> + <para> + Good, now you are all set to start the tutorial. Since this tutorial + aims to explain the newbie-friendly version of &ls;, it needs some GUI + functionality. Therefore, at least for this tutorial, open the gui + version of vim. (On MS windows, this is the default). Open up this help + file in either the same gvim session in a split window or in a different + session and follow the (friendly) instructions. + </para> + </section> + <section id="lsq-inserting-template"> + <title id="inserting-template-title">Inserting a template</title> + <para> + Start up gvim and begin editing a new file. + <programlisting>e newfile.tex</programlisting> + If the installation went well, you should see a new set of + menus appear. Goto <literal>Tex-Suite &gt; Templates</literal>. You will see + a number of templates to choose from. For now, choose to insert a + template for an article. You should get the following in the main + vim window (after possibly a hit-enter prompt). + <programlisting> + 1 % File: sample.tex + 2 % Created: Sun Jun 22 04:00 PM 2003 P + 3 % Last Change: Sun Jun 22 04:00 PM 2003 P + 4 % + 5 \documentclass[a4paper]{article} + 6 \begin{document} + 7 + 8 \end{document} + 9 + 10 ~ + 11 ~ + 12 ~ + 13 ~ +-- INSERT -- 7,1 All +</programlisting> + </para> + <imageobject> + <imagedata fileref="" format="png"></imagedata> + </imageobject> + <para> + The cursor is left on line 7 (just after the + <literal>\begin{document}</literal> line) from where you can start + typing straight away. Trying to lessen movement is a recurring theme in + Latex-Suite. + </para> + </section> + <section id="lsq-lsq-inserting-package"> + <title>Inserting a package</title> + <para> + Assume that we are writing a mathematical paper and we want to use the + popular amsmath package. We will use some functionality which + Latex-Suite provides specifically for including LaTeX packages, + providing options etc. Navigate to before the + <literal>\begin{document}</literal> line (The portion of the document + before the <literal>\begin{document}</literal> is called the + <emphasis>preamble</emphasis> in LaTeX). On an empty line in the + preamble, type the single word <literal>amsmath</literal> and then press + <literal>&lt;F5&gt;</literal> in normal mode. The line will change to + <programlisting>\usepackage[]{amsmath}&ph;</programlisting> + with the cursor positioned conveniently between the + <literal>[]</literal>'s. For now, do not worry about the trailing + <literal>&ph;</literal> at the end of this line. Assume we want to + provide the <literal>sumlimits</literal> options to amsmath. You can + either type in this option manually, or choose from a menu of package + options which Latex-Suite automatically creates when you insert a + package using <literal>&lt;F5&gt;</literal>. With the cursor still + placed between the <literal>[]</literal>, goto <literal>TeX-Suite &gt; + Packages &gt; amsmath Options</literal>. Choose the + <literal>sumlimits</literal> option. The package line should get + converted to: + <programlisting>\usepackage[sumlimits,]{amsmath}&ph;</programlisting> + </para> + <para> + with the cursor before <literal>]</literal>. Press + <literal>&lt;C-j&gt;</literal> in insert mode. You will see the cursor + jump to the end of the package line and the trailing + <literal>&ph;</literal> will disappear. What just happened?! You had + your first taste of <emphasis>Placeholders</emphasis>. Read more about + them (later) <ulink + url="http://vim-latex.sourceforge.net/documentation/latex-suite/latex-macros.html">here</ulink>. + In short, pressing <literal>&lt;C-j&gt;</literal> in insert mode takes + you to the next <literal>&ph;</literal> in the text. + </para> + </section> + <section id="lsq-insert-environment"> + <title>Inserting an Environment</title> + <para> + Now let us type in a simple formula in LaTeX. Move back to the body of + the document (The portion of the document between + <literal>\begin{document}</literal> and + <literal>\end{document}</literal> is called the body). Type in a few + simple sentences and then on an empty line, type the single word + <literal>eqnarray</literal>. Escape to normal mode and press + <literal>&lt;F5&gt;</literal>. (Remember: + <literal>&lt;F5&gt;</literal> is very useful!) This time, the line will + change to: + <programlisting>\begin{eqnarray} + \label{}&ph; +\end{eqnarray}&ph;</programlisting> + with the cursor between the <literal>{}</literal>. Enter a label. We + will use <literal>eqn:euler</literal>. After typing in + <literal>eqn:euler</literal>, press <literal>&lt;C-j&gt;</literal>. This + will take you outside the curly-braces. Another time you used a + Placeholder! + </para> + </section> + <section id="lsq-keyboard-shortcuts"> + <title>A few keyboard shortcuts</title> + <para> + Now to type in the famous Euler formula. Our aim is to type + <programlisting>e^{j\pi} + 1 &amp;=&amp; 0</programlisting> Instead + of typing this blindly, let us use a few shortcuts to reduce + movement. Start out by typing <literal>e^</literal>. Now instead of + typing <literal>{</literal>, type another <literal>^</literal>. You + will see the <literal>e^^</literal> change instantly to + <literal>e^{}&ph;</literal> with the cursor between + <literal>{}</literal>'s. (The <literal>^^</literal> changed to + <literal>^{}&ph;</literal>.) Continue with the following sequence of + letters: <literal>j`p</literal>. This will change instantly to + <literal>j\pi</literal>. (The <literal>`p</literal> changed to + <literal>\pi</literal>.) Having typed in all we need to type between + the <literal>{}</literal>'s, press <literal>&lt;C-j&gt;</literal>. + You will pop back out of the curly-braces. Continue typing the rest + of the formula. You can use <literal>==</literal> as a shortcut for + <literal>&amp;=&amp;</literal>. Latex-Suite provides a large number + of such shortcuts which should making typing much more fun and fast + if you get acquainted with them. A list is provided <ulink + url="http://vim-latex.sourceforge.net/documentation/latex-suite/auc-tex-mappings.html">here</ulink>. Definitely spend some time getting a feel for + them. Most of them are pretty intuitive like <literal>`/</literal> + for <literal>\frac{}{}</literal>, <literal>`8</literal> for + <literal>\infty</literal> etc. + </para> + <para> + In order to understand the next section better, it will be helpful + to have one more <literal>\label</literal>. Lets use the handy + <literal>&lt;F5&gt;</literal> + key to insert another equation. This time something simple like the + following will do: + <programlisting>\begin{eqnarray} + \label{eqn:simple} + 1 + 1 = 2 +\end{eqnarray}</programlisting> + </para> + </section> + <section id="lsq-folding"> + <title>Folding in &ls;</title> + <para> + Okay, we have typed enough. At this stage, hopefully, your file is + looking something like this: +<programlisting> + 1 % File: sample.tex + 2 % Created: Sun Jun 22 04:00 PM 2003 P + 3 % Last Change: Mon Dec 15 07:00 PM 2003 + 4 % + 5 \documentclass[a4paper]{article} + 6 + 7 \usepackage[sumlimits,]{amsmath} + 8 + 9 \begin{document} + 10 \begin{eqnarray} + 11 \label{eqn:euler} + 12 e^{j\pi} + 1 &amp;=&amp; 0 + 13 \end{eqnarray} + 14 This is the famous euler equation. I + 15 will type another equation, just as + 16 true: + 17 \begin{eqnarray} + 18 \label{eqn:simple} + 19 1 + 1 &amp;=&amp; 2 + 20 \end{eqnarray} + 21 This is my contribution to mathematics. + 22 \end{document} +</programlisting> + In normal mode, press <literal>\rf</literal>. This will fold up the + entire file and you should see the file looking as below: +<programlisting> + 1 % File: sample.tex + 2 % Created: Sun Jun 22 04:00 PM 2003 P + 3 % Last Change: Mon Dec 15 07:00 PM 2003 + 4 % + 5 +-- 4 lines: Preamble: \documentclass[a4paper]{article} ----- + 9 \begin{document} + 10 +-- 4 lines: eqnarray (eqn:euler) \label{eqn:euler} ----------- + 14 This is the famous euler equation. I + 15 will type another equation, just as + 16 true: + 10 +-- 4 lines: eqnarray (eqn:simple) \label{eqn:simple} --------- + 21 This is my contribution to mathematics. + 22 \end{document} +</programlisting> + What has happened is that &ls; folded away blocks of &latex; code into + folded regions. You can open and close folds by using the command + <literal>za</literal> in normal mode. + </para> + </section> + <section id="lsq-inserting-reference"> + <title>Inserting a Reference</title> + <para> + A necessary part of LaTeX editing is referencing equations, figures, + bibliographic entries etc. This is done with the + <literal>\ref</literal> and the <literal>\cite</literal> commands. + Latex-Suite provides an easy way to do this. Somewhere in the body of + the document, type in the following sentence + <programlisting>This is a reference to (\ref{}).</programlisting> + With the cursor between the <literal>{}</literal> press + <literal>&lt;F9&gt;</literal> in insert mode. Your vim session will + sprout two new windows and it should look like below: +<programlisting> + 9 \begin{document} + 10 +-- 4 lines: eqnarray (eqn:euler) : \label{eqn:euler}----------------------- + 14 This is the famous euler equation. I + 15 will type another equation, just as + 16 true: + 17 +-- 4 lines: eqnarray (eqn:simple) : \label{eqn:simple}--------------------- + 21 This is my contribution to mathematics. + 22 This is a reference to (\ref{}&lt;++&gt;)&lt;++&gt; + 23 \end{document} +~ +~ +~ +test.tex [+] 22,29 Bot +test.tex|11| \label{eqn:euler} +test.tex|18| \label{eqn:simple} +~ +~ +~ +[Error List] 1,1 All + 7 \usepackage[sumlimits,]{amsmath} + 8 + 9 \begin{document} + 10 \begin{eqnarray} + 11 \label{eqn:euler} + 12 e^{j\pi} + 1 &amp;=&amp; 0 + 13 \end{eqnarray} + 14 This is the famous euler equation. I + 15 will type another equation, just as + 16 true: +test.tex [Preview][+] 11,2-5 46% +</programlisting> + </para> + <imageobject> + <imagedata fileref="" format=""></imagedata> + </imageobject> + <para> + The cursor will relocate to the middle window which shows all + <literal>\label</literal>s found in all the <literal>.tex</literal> file + in the current directory. + You can scroll up and down in the middle window till you reach the + reference you want to insert. Notice how when you scroll in the + middle window, the bottom "Preview" window scrolls automatically to + show you the location of the current selection. This helps you + identify the reference with greater ease because often times, + <literal>\labels</literal> are not descriptive enough or there might be too + many of them. To insert the reference, just position the cursor on + the relevant line in the middle window and press + <literal>&lt;enter&gt;</literal>. The line which you were editing will change + to: + <programlisting>This is a reference to (\ref{eqn:euler})</programlisting> + and the bottom windows close automatically. + </para> + <para> + The <literal>&lt;F9&gt;</literal> key also works for inserting + <literal>\cite</literal> commands to reference bibliographic entries, + inserting file names for the <literal>\inputgraphics</literal> command + and just plain searching for words. Click <ulink + url="http://vim-latex.sourceforge.net/documentation/latex-suite/latex-completion.html">here</ulink> + for more information. + </para> + </section> + <section id="lsq-compiling"> + <title>Compiling a document</title> + <para> + Great! We have just created a small latex file. The next step is to + make the latex compiler create a .dvi file from it. Compiling via + latex-suite is simple. Goto normal mode and press <literal>\ll</literal> + (replace <literal>\</literal> with whatever <literal>mapleader</literal> setting you + have). This will call the latex compiler. If all goes well, then + the focus should return to the vim window. + </para> + <para> + Nothing happend? Ouch! You might need to do some additional settings as + described <ulink + url="http://vim-latex.sourceforge.net/index.php?subject=faq&amp;title=FAQ#faq-2">here.</ulink> + </para> + <section id="lsq-debugging"> + <title>Debugging LaTeX source files</title> + <para> + To illustrate the debugging procedure, let's create a few mistakes + in the file. Insert the following ``mistakes'' in the file: + <programlisting>This is a $\mistake$. +And this is $\another$</programlisting> + Now press <literal>\ll</literal> again. This time you will notice that + after compilation finishes, the cursor automatically lands on + <literal>$\mistake$</literal>. In addition, 2 new windows will appear + as shown here: + </para> + <imageobject> + <imagedata fileref="" format=""></imagedata> + </imageobject> + <para> + The middle window is an <emphasis>Error List</emphasis> window + showing you the errors which the latex compiler found. Th bottom + window is a <emphasis>Log Preview</emphasis> window, which shows you + the context of the error made by displaying the relevant portion of + the <literal>.log</literal> file created during the latex + compilation procedure. Jump to the <emphasis>Error List</emphasis> + window and try scrolling around in it using either the <literal>j, + k</literal> keys or the arrow keys. You will notice that the + <emphasis>Log Preview</emphasis> window scrolls automatically to + retain the context of the error you are currently located on. If you + press <literal>&lt;enter&gt;</literal> on any line, you will see the + cursor jump to the location of the error. Latex-Suite tries to guess + the column location as best as it can so you can continue typing + straight away. + </para> + </section> + <para> + Having got a taste for compiling, proceed by deleting the erroneous + lines and re-compiling. + </para> + <para> + The Latex-Suite compiler is capable of much more including + selectively filtering out common errors which you might want to + ignore for the moment, compiling parts of a document, setting + levels of verbosity in the compiler output etc. See <ulink + url="http://vim-latex.sourceforge.net/documentation/latex-suite/latex-compiling.html">here</ulink> + for more. + </para> + </section> + <section id="lsq-viewing-dvi"> + <title>Viewing DVI files</title> + <para> + Now that you have compiled your first latex source, its time to + view it. Again, this should be pretty simple. Press + <literal>\lv</literal> in normal mode. Depending on your platform, a DVI + viewer program should open up and display the dvi file generated in + compilation step previously. + </para> + <para> + Nothing happend? Ouch! You might need to do some additional settings as + described <ulink + url="http://vim-latex.sourceforge.net/index.php?subject=faq&amp;title=FAQ#faq-3">here.</ulink> + </para> + <section id="lsq-quick-forward-searching"> + <title>Performing forward searches</title> + <para> + If you are using a modern DVI viewer, then it is possible to do what + is called forward and inverse searching. However, you will need to + customize the standard Latex-Suite distribution in order to utilize + this functionality. Type in the following on the command line: + + <programlisting>:let g:Tex_CompileRule_dvi = 'latex -src-specials -interaction=nonstopmode $*' +:TCTarget dvi</programlisting> + + Now recompile the latex file by pressing <literal>\ll</literal>. + This time, instead of pressing <literal>\lv</literal> to view the + file, press <literal>\ls</literal> from within the tex file. If the + DVI viewer supports forward searching (most of them do), then the + viewer will actually display the portion of the DVI file + corresponding to the location where you were editing the tex file. + </para> + <note> + <para> + The reason Latex-Suite does not have this setting by default is + that on some systems this causes unpredictable results in the DVI + output. If you find the DVI output satisfactory, then you can + insert the first of the 2 lines above into your + <literal>$VIM/ftplugin/tex.vim</literal> file. + <literal>$VIM</literal> is <literal>~/vimfiles</literal> for + windows and <literal>~/.vim</literal> for *nix machines. + </para> + </note> + </section> + <section id="lsq-quick-inverse-searching"> + <title>Performing inverse searches</title> + <para> + Most DVI viewers also support inverse searching, whereby you can + make the DVI viewer ask vim to display the tex source corresponding + to the DVI file being shown. This is extremely helpful while + proofreading large documents. + </para> + + <para> + Simply double-click anywhere in the viewer window. If the viewer + supports it, then it will attempt to open an editor window at the + location corresponding to where you double-clicked. On *nix + platforms, Latex-Suite attempts to start the viewer program in such + a way that it already knows to use vim to open the tex source. Thus + you should see a vim window open up showing the tex file. However, + if there is an error, or some other program is used, you will need + to tell the viewer program to use gvim as the editor. On windows + platforms, if you use the commonly available <literal>yap</literal> + viewer (available as part of the miktex distribution), then this + option can be set from <literal>View &gt; Options &gt; Inverse + Search</literal>. In the <literal>Command line:</literal> window, + write + <programlisting>"C:\Program Files\vim\vim61\gvim" -c ":RemoteOpen +%l %f"</programlisting> + (Customize the path according to where you have installed gvim). + If you double click in the view pane now, you will see gvim start + up and take you to the relevant portion of the tex file. + </para> + </section> + </section> + <section id="lsq-conclusions"> + <title>Conclusions</title> + <para> + Thats all folks! By now, you should know enough of the basic functions + of latex-suite. Ofcourse, latex-suite is capable of much, much more such + as compiling files multiple times to resolve changed labels, compiling + dependencies, handling user packages and more. To get a feel for that, + you will need to take a look at the <ulink + url="http://vim-latex.sourceforge.net/index.php?subject=manual&amp;title=Manual#user-manual">&ls; + user manual.</ulink> + </para> + </section> +</article> + +<!-- +vim: et:sw=1:ts=1 +--> diff --git a/.vim/doc/latex-suite-quickstart/index.html b/.vim/doc/latex-suite-quickstart/index.html @@ -0,0 +1,8 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>A (very) quick introduction to Latex-Suite</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><meta name="description" content=""></meta><link rel="home" href="index.html" title="A (very) quick introduction to Latex-Suite"></link><link rel="next" href="lsq-using-tutorial.html" title="1 Using this tutorial"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">A (very) quick introduction to Latex-Suite</th></tr><tr><td width="20%" align="left"> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="lsq-using-tutorial.html">Next</a></td></tr></table><hr></hr></div><div xml:lang="en" class="article" title="A (very) quick introduction to Latex-Suite"><div class="titlepage"><div><div><h2 class="title"><a id="id331654"></a>A (very) quick introduction to Latex-Suite</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Srinath</span> <span class="surname">Avadhanula</span></h3><div class="affiliation"><div class="address"><p><code class="email">&lt;<a class="email" href="mailto:srinath AT fastmail DOT fm">srinath AT fastmail DOT fm</a>&gt;</code></p></div></div></div></div><div><div class="abstract" title="Abstract"><p class="title"><b>Abstract</b></p> + Latex-Suite is a comprehensive set of scripts to aid in editing, compiling and + viewing LaTeX documents. A thorough explanation of the full + capabilities of Latex-Suite is described in the user manual. This guide on the + other hand, provides a quick 30-45 minute running start to some of the + more commonly used functionalities of Latex-Suite. + </div></div></div><hr></hr></div><div class="toc"><dl><dt><span class="section"><a href="lsq-using-tutorial.html">1 Using this tutorial</a></span></dt><dt><span class="section"><a href="lsq-inserting-template.html">2 Inserting a template</a></span></dt><dt><span class="section"><a href="lsq-lsq-inserting-package.html">3 Inserting a package</a></span></dt><dt><span class="section"><a href="lsq-insert-environment.html">4 Inserting an Environment</a></span></dt><dt><span class="section"><a href="lsq-keyboard-shortcuts.html">5 A few keyboard shortcuts</a></span></dt><dt><span class="section"><a href="lsq-folding.html">6 Folding in Latex-Suite</a></span></dt><dt><span class="section"><a href="lsq-inserting-reference.html">7 Inserting a Reference</a></span></dt><dt><span class="section"><a href="lsq-compiling.html">8 Compiling a document</a></span></dt><dd><dl><dt><span class="section"><a href="lsq-debugging.html">8.1 Debugging LaTeX source files</a></span></dt></dl></dd><dt><span class="section"><a href="lsq-viewing-dvi.html">9 Viewing DVI files</a></span></dt><dd><dl><dt><span class="section"><a href="lsq-quick-forward-searching.html">9.1 Performing forward searches</a></span></dt><dt><span class="section"><a href="lsq-quick-inverse-searching.html">9.2 Performing inverse searches</a></span></dt></dl></dd><dt><span class="section"><a href="lsq-conclusions.html">10 Conclusions</a></span></dt></dl></div></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="lsq-using-tutorial.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"> </td><td width="20%" align="center"> </td><td width="40%" align="right" valign="top"> 1 Using this tutorial</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite-quickstart/lsq-compiling.html b/.vim/doc/latex-suite-quickstart/lsq-compiling.html @@ -0,0 +1,21 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>8 Compiling a document</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="A (very) quick introduction to Latex-Suite"></link><link rel="up" href="index.html" title="A (very) quick introduction to Latex-Suite"></link><link rel="prev" href="lsq-inserting-reference.html" title="7 Inserting a Reference"></link><link rel="next" href="lsq-debugging.html" title="8.1 Debugging LaTeX source files"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">8 Compiling a document</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="lsq-inserting-reference.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="lsq-debugging.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="8 Compiling a document"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="lsq-compiling"></a>8 Compiling a document</h2></div></div></div><div class="toc"><dl><dt><span class="section"><a href="lsq-debugging.html">8.1 Debugging LaTeX source files</a></span></dt></dl></div><p> + Great! We have just created a small latex file. The next step is to + make the latex compiler create a .dvi file from it. Compiling via + latex-suite is simple. Goto normal mode and press <code class="literal">\ll</code> + (replace <code class="literal">\</code> with whatever <code class="literal">mapleader</code> setting you + have). This will call the latex compiler. If all goes well, then + the focus should return to the vim window. + </p><p> + Nothing happend? Ouch! You might need to do some additional settings as + described <a class="ulink" href="http://vim-latex.sourceforge.net/index.php?subject=faq&amp;title=FAQ#faq-2" target="_top">here.</a> + </p><p> + Having got a taste for compiling, proceed by deleting the erroneous + lines and re-compiling. + </p><p> + The Latex-Suite compiler is capable of much more including + selectively filtering out common errors which you might want to + ignore for the moment, compiling parts of a document, setting + levels of verbosity in the compiler output etc. See <a class="ulink" href="http://vim-latex.sourceforge.net/documentation/latex-suite/latex-compiling.html" target="_top">here</a> + for more. + </p></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="lsq-inserting-reference.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="lsq-debugging.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">7 Inserting a Reference </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 8.1 Debugging LaTeX source files</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite-quickstart/lsq-conclusions.html b/.vim/doc/latex-suite-quickstart/lsq-conclusions.html @@ -0,0 +1,9 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>10 Conclusions</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="A (very) quick introduction to Latex-Suite"></link><link rel="up" href="index.html" title="A (very) quick introduction to Latex-Suite"></link><link rel="prev" href="lsq-quick-inverse-searching.html" title="9.2 Performing inverse searches"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">10 Conclusions</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="lsq-quick-inverse-searching.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> </td></tr></table><hr></hr></div><div class="section" title="10 Conclusions"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="lsq-conclusions"></a>10 Conclusions</h2></div></div></div><p> + Thats all folks! By now, you should know enough of the basic functions + of latex-suite. Ofcourse, latex-suite is capable of much, much more such + as compiling files multiple times to resolve changed labels, compiling + dependencies, handling user packages and more. To get a feel for that, + you will need to take a look at the <a class="ulink" href="http://vim-latex.sourceforge.net/index.php?subject=manual&amp;title=Manual#user-manual" target="_top">Latex-Suite + user manual.</a> + </p></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="lsq-quick-inverse-searching.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> </td></tr><tr><td width="40%" align="left" valign="top">9.2 Performing inverse searches </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> </td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite-quickstart/lsq-debugging.html b/.vim/doc/latex-suite-quickstart/lsq-debugging.html @@ -0,0 +1,26 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>8.1 Debugging LaTeX source files</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="A (very) quick introduction to Latex-Suite"></link><link rel="up" href="lsq-compiling.html" title="8 Compiling a document"></link><link rel="prev" href="lsq-compiling.html" title="8 Compiling a document"></link><link rel="next" href="lsq-viewing-dvi.html" title="9 Viewing DVI files"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">8.1 Debugging LaTeX source files</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="lsq-compiling.html">Prev</a> </td><th width="60%" align="center">8 Compiling a document</th><td width="20%" align="right"> <a accesskey="n" href="lsq-viewing-dvi.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="8.1 Debugging LaTeX source files"><div class="titlepage"><div><div><h3 class="title"><a id="lsq-debugging"></a>8.1 Debugging LaTeX source files</h3></div></div></div><p> + To illustrate the debugging procedure, let's create a few mistakes + in the file. Insert the following ``mistakes'' in the file: + </p><pre class="programlisting">This is a $\mistake$. +And this is $\another$</pre><p> + Now press <code class="literal">\ll</code> again. This time you will notice that + after compilation finishes, the cursor automatically lands on + <code class="literal">$\mistake$</code>. In addition, 2 new windows will appear + as shown here: + </p><img src=""></img><p> + The middle window is an <span class="emphasis"><em>Error List</em></span> window + showing you the errors which the latex compiler found. Th bottom + window is a <span class="emphasis"><em>Log Preview</em></span> window, which shows you + the context of the error made by displaying the relevant portion of + the <code class="literal">.log</code> file created during the latex + compilation procedure. Jump to the <span class="emphasis"><em>Error List</em></span> + window and try scrolling around in it using either the <code class="literal">j, + k</code> keys or the arrow keys. You will notice that the + <span class="emphasis"><em>Log Preview</em></span> window scrolls automatically to + retain the context of the error you are currently located on. If you + press <code class="literal">&lt;enter&gt;</code> on any line, you will see the + cursor jump to the location of the error. Latex-Suite tries to guess + the column location as best as it can so you can continue typing + straight away. + </p></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="lsq-compiling.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="lsq-compiling.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="lsq-viewing-dvi.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">8 Compiling a document </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 9 Viewing DVI files</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite-quickstart/lsq-folding.html b/.vim/doc/latex-suite-quickstart/lsq-folding.html @@ -0,0 +1,49 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>6 Folding in Latex-Suite</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="A (very) quick introduction to Latex-Suite"></link><link rel="up" href="index.html" title="A (very) quick introduction to Latex-Suite"></link><link rel="prev" href="lsq-keyboard-shortcuts.html" title="5 A few keyboard shortcuts"></link><link rel="next" href="lsq-inserting-reference.html" title="7 Inserting a Reference"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">6 Folding in Latex-Suite</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="lsq-keyboard-shortcuts.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="lsq-inserting-reference.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="6 Folding in Latex-Suite"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="lsq-folding"></a>6 Folding in Latex-Suite</h2></div></div></div><p> + Okay, we have typed enough. At this stage, hopefully, your file is + looking something like this: +</p><pre class="programlisting"> + 1 % File: sample.tex + 2 % Created: Sun Jun 22 04:00 PM 2003 P + 3 % Last Change: Mon Dec 15 07:00 PM 2003 + 4 % + 5 \documentclass[a4paper]{article} + 6 + 7 \usepackage[sumlimits,]{amsmath} + 8 + 9 \begin{document} + 10 \begin{eqnarray} + 11 \label{eqn:euler} + 12 e^{j\pi} + 1 &amp;=&amp; 0 + 13 \end{eqnarray} + 14 This is the famous euler equation. I + 15 will type another equation, just as + 16 true: + 17 \begin{eqnarray} + 18 \label{eqn:simple} + 19 1 + 1 &amp;=&amp; 2 + 20 \end{eqnarray} + 21 This is my contribution to mathematics. + 22 \end{document} +</pre><p> + In normal mode, press <code class="literal">\rf</code>. This will fold up the + entire file and you should see the file looking as below: +</p><pre class="programlisting"> + 1 % File: sample.tex + 2 % Created: Sun Jun 22 04:00 PM 2003 P + 3 % Last Change: Mon Dec 15 07:00 PM 2003 + 4 % + 5 +-- 4 lines: Preamble: \documentclass[a4paper]{article} ----- + 9 \begin{document} + 10 +-- 4 lines: eqnarray (eqn:euler) \label{eqn:euler} ----------- + 14 This is the famous euler equation. I + 15 will type another equation, just as + 16 true: + 10 +-- 4 lines: eqnarray (eqn:simple) \label{eqn:simple} --------- + 21 This is my contribution to mathematics. + 22 \end{document} +</pre><p> + What has happened is that Latex-Suite folded away blocks of LaTeX code into + folded regions. You can open and close folds by using the command + <code class="literal">za</code> in normal mode. + </p></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="lsq-keyboard-shortcuts.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="lsq-inserting-reference.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">5 A few keyboard shortcuts </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 7 Inserting a Reference</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite-quickstart/lsq-insert-environment.html b/.vim/doc/latex-suite-quickstart/lsq-insert-environment.html @@ -0,0 +1,20 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>4 Inserting an Environment</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="A (very) quick introduction to Latex-Suite"></link><link rel="up" href="index.html" title="A (very) quick introduction to Latex-Suite"></link><link rel="prev" href="lsq-lsq-inserting-package.html" title="3 Inserting a package"></link><link rel="next" href="lsq-keyboard-shortcuts.html" title="5 A few keyboard shortcuts"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">4 Inserting an Environment</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="lsq-lsq-inserting-package.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="lsq-keyboard-shortcuts.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="4 Inserting an Environment"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="lsq-insert-environment"></a>4 Inserting an Environment</h2></div></div></div><p> + Now let us type in a simple formula in LaTeX. Move back to the body of + the document (The portion of the document between + <code class="literal">\begin{document}</code> and + <code class="literal">\end{document}</code> is called the body). Type in a few + simple sentences and then on an empty line, type the single word + <code class="literal">eqnarray</code>. Escape to normal mode and press + <code class="literal">&lt;F5&gt;</code>. (Remember: + <code class="literal">&lt;F5&gt;</code> is very useful!) This time, the line will + change to: + </p><pre class="programlisting">\begin{eqnarray} + \label{}&lt;++&gt; +\end{eqnarray}&lt;++&gt;</pre><p> + with the cursor between the <code class="literal">{}</code>. Enter a label. We + will use <code class="literal">eqn:euler</code>. After typing in + <code class="literal">eqn:euler</code>, press <code class="literal">&lt;C-j&gt;</code>. This + will take you outside the curly-braces. Another time you used a + Placeholder! + </p></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="lsq-lsq-inserting-package.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="lsq-keyboard-shortcuts.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">3 Inserting a package </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 5 A few keyboard shortcuts</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite-quickstart/lsq-inserting-reference.html b/.vim/doc/latex-suite-quickstart/lsq-inserting-reference.html @@ -0,0 +1,66 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>7 Inserting a Reference</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="A (very) quick introduction to Latex-Suite"></link><link rel="up" href="index.html" title="A (very) quick introduction to Latex-Suite"></link><link rel="prev" href="lsq-folding.html" title="6 Folding in Latex-Suite"></link><link rel="next" href="lsq-compiling.html" title="8 Compiling a document"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">7 Inserting a Reference</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="lsq-folding.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="lsq-compiling.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="7 Inserting a Reference"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="lsq-inserting-reference"></a>7 Inserting a Reference</h2></div></div></div><p> + A necessary part of LaTeX editing is referencing equations, figures, + bibliographic entries etc. This is done with the + <code class="literal">\ref</code> and the <code class="literal">\cite</code> commands. + Latex-Suite provides an easy way to do this. Somewhere in the body of + the document, type in the following sentence + </p><pre class="programlisting">This is a reference to (\ref{}).</pre><p> + With the cursor between the <code class="literal">{}</code> press + <code class="literal">&lt;F9&gt;</code> in insert mode. Your vim session will + sprout two new windows and it should look like below: +</p><pre class="programlisting"> + 9 \begin{document} + 10 +-- 4 lines: eqnarray (eqn:euler) : \label{eqn:euler}----------------------- + 14 This is the famous euler equation. I + 15 will type another equation, just as + 16 true: + 17 +-- 4 lines: eqnarray (eqn:simple) : \label{eqn:simple}--------------------- + 21 This is my contribution to mathematics. + 22 This is a reference to (\ref{}&lt;++&gt;)&lt;++&gt; + 23 \end{document} +~ +~ +~ +test.tex [+] 22,29 Bot +test.tex|11| \label{eqn:euler} +test.tex|18| \label{eqn:simple} +~ +~ +~ +[Error List] 1,1 All + 7 \usepackage[sumlimits,]{amsmath} + 8 + 9 \begin{document} + 10 \begin{eqnarray} + 11 \label{eqn:euler} + 12 e^{j\pi} + 1 &amp;=&amp; 0 + 13 \end{eqnarray} + 14 This is the famous euler equation. I + 15 will type another equation, just as + 16 true: +test.tex [Preview][+] 11,2-5 46% +</pre><p> + </p><img src=""></img><p> + The cursor will relocate to the middle window which shows all + <code class="literal">\label</code>s found in all the <code class="literal">.tex</code> file + in the current directory. + You can scroll up and down in the middle window till you reach the + reference you want to insert. Notice how when you scroll in the + middle window, the bottom "Preview" window scrolls automatically to + show you the location of the current selection. This helps you + identify the reference with greater ease because often times, + <code class="literal">\labels</code> are not descriptive enough or there might be too + many of them. To insert the reference, just position the cursor on + the relevant line in the middle window and press + <code class="literal">&lt;enter&gt;</code>. The line which you were editing will change + to: + </p><pre class="programlisting">This is a reference to (\ref{eqn:euler})</pre><p> + and the bottom windows close automatically. + </p><p> + The <code class="literal">&lt;F9&gt;</code> key also works for inserting + <code class="literal">\cite</code> commands to reference bibliographic entries, + inserting file names for the <code class="literal">\inputgraphics</code> command + and just plain searching for words. Click <a class="ulink" href="http://vim-latex.sourceforge.net/documentation/latex-suite/latex-completion.html" target="_top">here</a> + for more information. + </p></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="lsq-folding.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="lsq-compiling.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">6 Folding in Latex-Suite </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 8 Compiling a document</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite-quickstart/lsq-inserting-template.html b/.vim/doc/latex-suite-quickstart/lsq-inserting-template.html @@ -0,0 +1,31 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>2 Inserting a template</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="A (very) quick introduction to Latex-Suite"></link><link rel="up" href="index.html" title="A (very) quick introduction to Latex-Suite"></link><link rel="prev" href="lsq-using-tutorial.html" title="1 Using this tutorial"></link><link rel="next" href="lsq-lsq-inserting-package.html" title="3 Inserting a package"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">2 Inserting a template</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="lsq-using-tutorial.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="lsq-lsq-inserting-package.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="2 Inserting a template"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="lsq-inserting-template"></a>2 Inserting a template</h2></div></div></div><p> + Start up gvim and begin editing a new file. + </p><pre class="programlisting">e newfile.tex</pre><p> + If the installation went well, you should see a new set of + menus appear. Goto <code class="literal">Tex-Suite &gt; Templates</code>. You will see + a number of templates to choose from. For now, choose to insert a + template for an article. You should get the following in the main + vim window (after possibly a hit-enter prompt). + </p><pre class="programlisting"> + 1 % File: sample.tex + 2 % Created: Sun Jun 22 04:00 PM 2003 P + 3 % Last Change: Sun Jun 22 04:00 PM 2003 P + 4 % + 5 \documentclass[a4paper]{article} + 6 \begin{document} + 7 + 8 \end{document} + 9 + 10 ~ + 11 ~ + 12 ~ + 13 ~ +-- INSERT -- 7,1 All +</pre><p> + </p><img src=""></img><p> + The cursor is left on line 7 (just after the + <code class="literal">\begin{document}</code> line) from where you can start + typing straight away. Trying to lessen movement is a recurring theme in + Latex-Suite. + </p></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="lsq-using-tutorial.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="lsq-lsq-inserting-package.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">1 Using this tutorial </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 3 Inserting a package</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite-quickstart/lsq-keyboard-shortcuts.html b/.vim/doc/latex-suite-quickstart/lsq-keyboard-shortcuts.html @@ -0,0 +1,34 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>5 A few keyboard shortcuts</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="A (very) quick introduction to Latex-Suite"></link><link rel="up" href="index.html" title="A (very) quick introduction to Latex-Suite"></link><link rel="prev" href="lsq-insert-environment.html" title="4 Inserting an Environment"></link><link rel="next" href="lsq-folding.html" title="6 Folding in Latex-Suite"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">5 A few keyboard shortcuts</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="lsq-insert-environment.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="lsq-folding.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="5 A few keyboard shortcuts"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="lsq-keyboard-shortcuts"></a>5 A few keyboard shortcuts</h2></div></div></div><p> + Now to type in the famous Euler formula. Our aim is to type + </p><pre class="programlisting">e^{j\pi} + 1 &amp;=&amp; 0</pre><p> Instead + of typing this blindly, let us use a few shortcuts to reduce + movement. Start out by typing <code class="literal">e^</code>. Now instead of + typing <code class="literal">{</code>, type another <code class="literal">^</code>. You + will see the <code class="literal">e^^</code> change instantly to + <code class="literal">e^{}&lt;++&gt;</code> with the cursor between + <code class="literal">{}</code>'s. (The <code class="literal">^^</code> changed to + <code class="literal">^{}&lt;++&gt;</code>.) Continue with the following sequence of + letters: <code class="literal">j`p</code>. This will change instantly to + <code class="literal">j\pi</code>. (The <code class="literal">`p</code> changed to + <code class="literal">\pi</code>.) Having typed in all we need to type between + the <code class="literal">{}</code>'s, press <code class="literal">&lt;C-j&gt;</code>. + You will pop back out of the curly-braces. Continue typing the rest + of the formula. You can use <code class="literal">==</code> as a shortcut for + <code class="literal">&amp;=&amp;</code>. Latex-Suite provides a large number + of such shortcuts which should making typing much more fun and fast + if you get acquainted with them. A list is provided <a class="ulink" href="http://vim-latex.sourceforge.net/documentation/latex-suite/auc-tex-mappings.html" target="_top">here</a>. Definitely spend some time getting a feel for + them. Most of them are pretty intuitive like <code class="literal">`/</code> + for <code class="literal">\frac{}{}</code>, <code class="literal">`8</code> for + <code class="literal">\infty</code> etc. + </p><p> + In order to understand the next section better, it will be helpful + to have one more <code class="literal">\label</code>. Lets use the handy + <code class="literal">&lt;F5&gt;</code> + key to insert another equation. This time something simple like the + following will do: + </p><pre class="programlisting">\begin{eqnarray} + \label{eqn:simple} + 1 + 1 = 2 +\end{eqnarray}</pre><p> + </p></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="lsq-insert-environment.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="lsq-folding.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">4 Inserting an Environment </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 6 Folding in Latex-Suite</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite-quickstart/lsq-lsq-inserting-package.html b/.vim/doc/latex-suite-quickstart/lsq-lsq-inserting-package.html @@ -0,0 +1,34 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>3 Inserting a package</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="A (very) quick introduction to Latex-Suite"></link><link rel="up" href="index.html" title="A (very) quick introduction to Latex-Suite"></link><link rel="prev" href="lsq-inserting-template.html" title="2 Inserting a template"></link><link rel="next" href="lsq-insert-environment.html" title="4 Inserting an Environment"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">3 Inserting a package</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="lsq-inserting-template.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="lsq-insert-environment.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="3 Inserting a package"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="lsq-lsq-inserting-package"></a>3 Inserting a package</h2></div></div></div><p> + Assume that we are writing a mathematical paper and we want to use the + popular amsmath package. We will use some functionality which + Latex-Suite provides specifically for including LaTeX packages, + providing options etc. Navigate to before the + <code class="literal">\begin{document}</code> line (The portion of the document + before the <code class="literal">\begin{document}</code> is called the + <span class="emphasis"><em>preamble</em></span> in LaTeX). On an empty line in the + preamble, type the single word <code class="literal">amsmath</code> and then press + <code class="literal">&lt;F5&gt;</code> in normal mode. The line will change to + </p><pre class="programlisting">\usepackage[]{amsmath}&lt;++&gt;</pre><p> + with the cursor positioned conveniently between the + <code class="literal">[]</code>'s. For now, do not worry about the trailing + <code class="literal">&lt;++&gt;</code> at the end of this line. Assume we want to + provide the <code class="literal">sumlimits</code> options to amsmath. You can + either type in this option manually, or choose from a menu of package + options which Latex-Suite automatically creates when you insert a + package using <code class="literal">&lt;F5&gt;</code>. With the cursor still + placed between the <code class="literal">[]</code>, goto <code class="literal">TeX-Suite &gt; + Packages &gt; amsmath Options</code>. Choose the + <code class="literal">sumlimits</code> option. The package line should get + converted to: + </p><pre class="programlisting">\usepackage[sumlimits,]{amsmath}&lt;++&gt;</pre><p> + </p><p> + with the cursor before <code class="literal">]</code>. Press + <code class="literal">&lt;C-j&gt;</code> in insert mode. You will see the cursor + jump to the end of the package line and the trailing + <code class="literal">&lt;++&gt;</code> will disappear. What just happened?! You had + your first taste of <span class="emphasis"><em>Placeholders</em></span>. Read more about + them (later) <a class="ulink" href="http://vim-latex.sourceforge.net/documentation/latex-suite/latex-macros.html" target="_top">here</a>. + In short, pressing <code class="literal">&lt;C-j&gt;</code> in insert mode takes + you to the next <code class="literal">&lt;++&gt;</code> in the text. + </p></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="lsq-inserting-template.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="lsq-insert-environment.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">2 Inserting a template </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 4 Inserting an Environment</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite-quickstart/lsq-quick-forward-searching.html b/.vim/doc/latex-suite-quickstart/lsq-quick-forward-searching.html @@ -0,0 +1,25 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>9.1 Performing forward searches</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="A (very) quick introduction to Latex-Suite"></link><link rel="up" href="lsq-viewing-dvi.html" title="9 Viewing DVI files"></link><link rel="prev" href="lsq-viewing-dvi.html" title="9 Viewing DVI files"></link><link rel="next" href="lsq-quick-inverse-searching.html" title="9.2 Performing inverse searches"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">9.1 Performing forward searches</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="lsq-viewing-dvi.html">Prev</a> </td><th width="60%" align="center">9 Viewing DVI files</th><td width="20%" align="right"> <a accesskey="n" href="lsq-quick-inverse-searching.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="9.1 Performing forward searches"><div class="titlepage"><div><div><h3 class="title"><a id="lsq-quick-forward-searching"></a>9.1 Performing forward searches</h3></div></div></div><p> + If you are using a modern DVI viewer, then it is possible to do what + is called forward and inverse searching. However, you will need to + customize the standard Latex-Suite distribution in order to utilize + this functionality. Type in the following on the command line: + + </p><pre class="programlisting">:let g:Tex_CompileRule_dvi = 'latex -src-specials -interaction=nonstopmode $*' +:TCTarget dvi</pre><p> + + Now recompile the latex file by pressing <code class="literal">\ll</code>. + This time, instead of pressing <code class="literal">\lv</code> to view the + file, press <code class="literal">\ls</code> from within the tex file. If the + DVI viewer supports forward searching (most of them do), then the + viewer will actually display the portion of the DVI file + corresponding to the location where you were editing the tex file. + </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> + The reason Latex-Suite does not have this setting by default is + that on some systems this causes unpredictable results in the DVI + output. If you find the DVI output satisfactory, then you can + insert the first of the 2 lines above into your + <code class="literal">$VIM/ftplugin/tex.vim</code> file. + <code class="literal">$VIM</code> is <code class="literal">~/vimfiles</code> for + windows and <code class="literal">~/.vim</code> for *nix machines. + </p></div></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="lsq-viewing-dvi.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="lsq-viewing-dvi.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="lsq-quick-inverse-searching.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">9 Viewing DVI files </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 9.2 Performing inverse searches</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite-quickstart/lsq-quick-inverse-searching.html b/.vim/doc/latex-suite-quickstart/lsq-quick-inverse-searching.html @@ -0,0 +1,25 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>9.2 Performing inverse searches</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="A (very) quick introduction to Latex-Suite"></link><link rel="up" href="lsq-viewing-dvi.html" title="9 Viewing DVI files"></link><link rel="prev" href="lsq-quick-forward-searching.html" title="9.1 Performing forward searches"></link><link rel="next" href="lsq-conclusions.html" title="10 Conclusions"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">9.2 Performing inverse searches</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="lsq-quick-forward-searching.html">Prev</a> </td><th width="60%" align="center">9 Viewing DVI files</th><td width="20%" align="right"> <a accesskey="n" href="lsq-conclusions.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="9.2 Performing inverse searches"><div class="titlepage"><div><div><h3 class="title"><a id="lsq-quick-inverse-searching"></a>9.2 Performing inverse searches</h3></div></div></div><p> + Most DVI viewers also support inverse searching, whereby you can + make the DVI viewer ask vim to display the tex source corresponding + to the DVI file being shown. This is extremely helpful while + proofreading large documents. + </p><p> + Simply double-click anywhere in the viewer window. If the viewer + supports it, then it will attempt to open an editor window at the + location corresponding to where you double-clicked. On *nix + platforms, Latex-Suite attempts to start the viewer program in such + a way that it already knows to use vim to open the tex source. Thus + you should see a vim window open up showing the tex file. However, + if there is an error, or some other program is used, you will need + to tell the viewer program to use gvim as the editor. On windows + platforms, if you use the commonly available <code class="literal">yap</code> + viewer (available as part of the miktex distribution), then this + option can be set from <code class="literal">View &gt; Options &gt; Inverse + Search</code>. In the <code class="literal">Command line:</code> window, + write + </p><pre class="programlisting">"C:\Program Files\vim\vim61\gvim" -c ":RemoteOpen +%l %f"</pre><p> + (Customize the path according to where you have installed gvim). + If you double click in the view pane now, you will see gvim start + up and take you to the relevant portion of the tex file. + </p></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="lsq-quick-forward-searching.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="lsq-viewing-dvi.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="lsq-conclusions.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">9.1 Performing forward searches </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 10 Conclusions</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite-quickstart/lsq-using-tutorial.html b/.vim/doc/latex-suite-quickstart/lsq-using-tutorial.html @@ -0,0 +1,20 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>1 Using this tutorial</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="A (very) quick introduction to Latex-Suite"></link><link rel="up" href="index.html" title="A (very) quick introduction to Latex-Suite"></link><link rel="prev" href="index.html" title="A (very) quick introduction to Latex-Suite"></link><link rel="next" href="lsq-inserting-template.html" title="2 Inserting a template"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">1 Using this tutorial</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="index.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="lsq-inserting-template.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="1 Using this tutorial"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="lsq-using-tutorial"></a>1 Using this tutorial</h2></div></div></div><p> + This tutorial assumes that you have vim version 6.1+ installed on your + machine. To check, open vim and type + </p><pre class="programlisting">:ver</pre><p> + You will see the version in the first line of the output. Get the latest + vim version from <a class="ulink" href="http://vim.sf.net" target="_top">http://vim.sf.net</a>. + </p><p> + Assuming you have Vim 6.1+ already up and running, follow the + instructions <a class="ulink" href="http://vim-latex.sourceforge.net/index.php?subject=download&amp;title=Download" target="_top">here</a> + to set up Latex-Suite. Remember to make sure your + <code class="literal">'grepprg'</code> setting of Vim works. + </p><p> + Good, now you are all set to start the tutorial. Since this tutorial + aims to explain the newbie-friendly version of Latex-Suite, it needs some GUI + functionality. Therefore, at least for this tutorial, open the gui + version of vim. (On MS windows, this is the default). Open up this help + file in either the same gvim session in a split window or in a different + session and follow the (friendly) instructions. + </p></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="index.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="lsq-inserting-template.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">A (very) quick introduction to Latex-Suite </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 2 Inserting a template</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite-quickstart/lsq-viewing-dvi.html b/.vim/doc/latex-suite-quickstart/lsq-viewing-dvi.html @@ -0,0 +1,11 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>9 Viewing DVI files</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="A (very) quick introduction to Latex-Suite"></link><link rel="up" href="index.html" title="A (very) quick introduction to Latex-Suite"></link><link rel="prev" href="lsq-debugging.html" title="8.1 Debugging LaTeX source files"></link><link rel="next" href="lsq-quick-forward-searching.html" title="9.1 Performing forward searches"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">9 Viewing DVI files</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="lsq-debugging.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="lsq-quick-forward-searching.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="9 Viewing DVI files"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="lsq-viewing-dvi"></a>9 Viewing DVI files</h2></div></div></div><div class="toc"><dl><dt><span class="section"><a href="lsq-quick-forward-searching.html">9.1 Performing forward searches</a></span></dt><dt><span class="section"><a href="lsq-quick-inverse-searching.html">9.2 Performing inverse searches</a></span></dt></dl></div><p> + Now that you have compiled your first latex source, its time to + view it. Again, this should be pretty simple. Press + <code class="literal">\lv</code> in normal mode. Depending on your platform, a DVI + viewer program should open up and display the dvi file generated in + compilation step previously. + </p><p> + Nothing happend? Ouch! You might need to do some additional settings as + described <a class="ulink" href="http://vim-latex.sourceforge.net/index.php?subject=faq&amp;title=FAQ#faq-3" target="_top">here.</a> + </p></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="lsq-debugging.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="lsq-quick-forward-searching.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">8.1 Debugging LaTeX source files </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 9.1 Performing forward searches</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite.css b/.vim/doc/latex-suite.css @@ -0,0 +1,182 @@ +/* + * Authors: Srinath Avadhanula and Mikolaj Machowski + * This style file borrows some elements from main.css, the style file used + * in cream.sf.net + * + * */ +P { + font-size : 12pt ; + font-family : helvetica, arial, verdana, sans-serif ; + vertical-align : top; +} +DT { + font-size : 11pt ; + font-family : helvetica, arial, verdana, sans-serif ; + vertical-align : top; +} +LI { + font-size : 12pt ; + font-family : helvetica, arial, verdana, sans-serif ; + vertical-align : top; +} + +DIV.header { + margin : 0.5cm ; + width : 800px ; + height : 100 +} +.note { +} + +TD { + font-size : 11pt ; + font-family : helvetica, arial, verdana, sans-serif ; + vertical-align : top; +} +TD.menu { + text-align : center ; + font-family : verdana, helvetica, sans-serif +} +TD.footright { + text-align : right ; + font-size : 10pt ; + font-family : verdana, helvetica, sans-serif +} +TD.leftpanel { + font-size: 14px ; + font-family: verdana, helvetica, sans-serif ; + vertical-align: top ; + width: 150px; + padding: 15px; + background-color: #88aaaa; +} +TD.mainpanel { + font-size : 12pt ; + font-family : helvetica, arial, verdana, sans-serif ; + vertical-align : top; + padding: 15px; +} +TD.footpanel { + font-size: 12px ; + font-family: verdana, helvetica, sans-serif ; + vertical-align: top ; + text-align: right; + padding: 5px; + background-color: #88aaaa; +} +.navigation { + vertical-align: top; + width: 150px; + padding: 15px; + background-color: #445555; + color: #fffcfc; +} +.navheader { + margin-top: -0.5em; + margin-bottom: 0.5em; + text-align: right; + color: #446644; + font-size: 14px; + font-weight: bold; +} + +SPAN.menu { + text-align : center ; + font-size : 12pt ; + font-family : verdana, helvetica, sans-serif +} + +DIV.merit { + margin : 0.5cm ; + width : 800px +} + +TABLE.meritum { + margin : 0.5cm ; + border : 0 +} +.foot { + margin : 0.5cm ; + width : 800px +} +.head { + margin : 0.5cm ; +} + +CODE { + font-family: "Andale Mono", "Courier New", "Courier", monospace; + background-color: #eef0f3; + white-space: nowrap; +} + +.singlesmall { + font-size: 14px; +} + +.doublesmall { + font-size: 12px; +} + + +DIV.footer { + margin : 0.5cm ; + width : 800px +} +.qa { + margin : 0.5cm ; + font-size : 16px; + font-weight : bold; +} +.ans { + margin : 0.5cm ; + font-weight : normal; +} + +H2.hline { + text-align : center ; + font-family : verdana, helvetica, sans-serif +} + +A.extlinks { + font-size : 11pt ; + font-family : verdana, helvetica, sans-serif ; + font-weight : bold +} + +TT { + font-family: courier,sans-serif; + font-size: 11pt; +} +PRE.programlisting { + font-family: courier,sans-serif; + font-size: 10pt; + background-color:#eef0f3; + border-color: #000000; + border-width: 1px; + border-style: solid; +} +SPAN.conflict { + font-size : small ; + font-family: courier,sans-serif; + color : #DD4444; +} +HR.navig { + color: #446644; + height: 1px; + margin-top: 1em; + border-top: 0px; /* Mozilla work-around to eliminate "groove" */ +} +A.question { + color: #000000; + height: 1px; + margin-top: 1em; + border-top: 0px; /* Mozilla work-around to eliminate "groove" */ +} +A.question:hover { + color: #000000; + background-color: #eef0f3; + height: 1px; + margin-top: 1em; + border-top: 0px; /* Mozilla work-around to eliminate "groove" */ +} + diff --git a/.vim/doc/latex-suite.html b/.vim/doc/latex-suite.html @@ -0,0 +1,2673 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Latex-Suite Reference</title><link rel="stylesheet" href="latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><meta name="description" content="Latex-Suite attempts to provide a comprehensive set of tools to view, edit and compile LaTeX documents in Vim. Together, they provide tools starting from macros to speed up editing LaTeX documents to functions for forward searching .dvi documents. Latex-Suite has been possible because of the contributions of many people. Please see latex-suite-credits for a list of people who have helped. Latex-Suite is released under the Vim charityware license. For license and conditions of use look at |copyright|. Replace all occurrences of ``Vim'' with ``Latex-Suite''. The current copyright holders of Latex-Suite are Srinath Avadhanula and Mikolaj Machowski. Homepage: http://vim-latex.sourceforge.net"></meta></head><body><div xml:lang="en" class="article" title="Latex-Suite Reference"><div class="titlepage"><div><div><h2 class="title"><a id="id462120"></a>Latex-Suite Reference</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Srinath</span> <span class="surname">Avadhanula</span></h3><div class="affiliation"><div class="address"><p><code class="email">&lt;<a class="email" href="mailto:srinath AT fastmail DOT fm">srinath AT fastmail DOT fm</a>&gt;</code></p></div></div></div></div><div><div class="author"><h3 class="author"><span class="firstname">Mikolaj</span> <span class="surname">Machowski</span></h3><div class="affiliation"><div class="address"><p><code class="email">&lt;<a class="email" href="mailto:mikmach AT wp DOT pl">mikmach AT wp DOT pl</a>&gt;</code></p></div></div></div></div><div><div class="abstract" title="Abstract"><p class="title"><b>Abstract</b></p><p> + Latex-Suite attempts to provide a comprehensive set of tools to + view, edit and compile LaTeX documents in Vim. Together, they + provide tools starting from macros to speed up editing LaTeX + documents to functions for forward searching .dvi documents. + Latex-Suite has been possible because of the contributions of many + people. Please see <a class="link" href="#latex-suite-credits" title="12 Credits">latex-suite-credits</a> for a list of + people who have helped. + </p><p> + Latex-Suite is released under the Vim charityware license. For + license and conditions of use look at |copyright|. Replace all + occurrences of ``Vim'' with ``Latex-Suite''. The current copyright + holders of Latex-Suite are Srinath Avadhanula and Mikolaj Machowski. + </p><p> + Homepage: <a class="ulink" href="http://vim-latex.sourceforge.net" target="_top">http://vim-latex.sourceforge.net</a> + </p></div></div></div><hr></hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="#recommended-settings">1 Installation and recommended Settings</a></span></dt><dt><span class="section"><a href="#latex-suite-templates">2 Inserting Templates</a></span></dt><dt><span class="section"><a href="#latex-macros">3 Latex-Suite Macros</a></span></dt><dd><dl><dt><span class="section"><a href="#environment-mappings">3.1 Environment Mappings</a></span></dt><dt><span class="section"><a href="#latex-command-maps">3.2 Command Mappings</a></span></dt><dt><span class="section"><a href="#font-maps">3.3 Font Mappings</a></span></dt><dt><span class="section"><a href="#section-mappings">3.4 Section Mappings</a></span></dt><dt><span class="section"><a href="#greek-letter-mappings">3.5 Greek Letter Mappings</a></span></dt><dt><span class="section"><a href="#auc-tex-mappings">3.6 Auc-Tex Key Bindings</a></span></dt><dt><span class="section"><a href="#diacritic-mappings">3.7 Diacritics</a></span></dt><dt><span class="section"><a href="#bibtex-bindings">3.8 BibTeX Shortcuts</a></span></dt><dt><span class="section"><a href="#smart-keys">3.9 Smart Key Mappings</a></span></dt><dt><span class="section"><a href="#altkey-mappings">3.10 Alt Key Macros</a></span></dt><dt><span class="section"><a href="#custom-macros-menu">3.11 Custom Macros</a></span></dt><dt><span class="section"><a href="#ls-new-macros">3.12 Making your own Macros via <code class="literal">IMAP()</code></a></span></dt></dl></dd><dt><span class="section"><a href="#latex-packages">4 Package Handling</a></span></dt><dd><dl><dt><span class="section"><a href="#inserting-packages">4.1 Inserting package commands</a></span></dt><dt><span class="section"><a href="#package-actions">4.2 Actions taken for supported packages</a></span></dt><dt><span class="section"><a href="#automatic-package-detection">4.3 Automatic Package detection</a></span></dt><dt><span class="section"><a href="#supporting-packages">4.4 Writing supporting for a package</a></span></dt></dl></dd><dt><span class="section"><a href="#latex-completion">5 Latex Completion</a></span></dt><dd><dl><dt><span class="section"><a href="#ls-completion-usage">5.1 Latex-Suite completion example</a></span></dt><dt><span class="section"><a href="#ls-completion-ref">5.2 Latex-Suite \ref completion</a></span></dt><dt><span class="section"><a href="#latex-completion-cite">5.3 Latex-Suite <code class="literal">\cite</code> completion</a></span></dt><dt><span class="section"><a href="#ls-filename-completion">5.4 Latex-Suite filename completion</a></span></dt><dt><span class="section"><a href="#ls-completion-custom">5.5 Custom command completion</a></span></dt></dl></dd><dt><span class="section"><a href="#latex-compiling">6 LaTeX Compiling</a></span></dt><dd><dl><dt><span class="section"><a href="#compiler-rules">6.1 Setting Compilation rules</a></span></dt><dt><span class="section"><a href="#compiler-dependency">6.2 Handling dependencies in compilation</a></span></dt><dt><span class="section"><a href="#compiling-multiple">6.3 Compiling multiple times</a></span></dt><dt><span class="section"><a href="#compiler-output-customization">6.4 Customizing the compiler output</a></span></dt><dt><span class="section"><a href="#part-compiling">6.5 Compiling parts of a file</a></span></dt></dl></dd><dt><span class="section"><a href="#latex-viewing">7 Latex Viewing and Searching</a></span></dt><dd><dl><dt><span class="section"><a href="#latex-viewing-rules">7.1 Setting Viewing rules</a></span></dt><dt><span class="section"><a href="#forward-searching">7.2 Forward Searching documents</a></span></dt><dt><span class="section"><a href="#inverse-searching">7.3 Inverse Searching</a></span></dt></dl></dd><dt><span class="section"><a href="#latex-folding">8 Latex Folding</a></span></dt><dd><dl><dt><span class="section"><a href="#default-folding">8.1 Default Folding Scheme in Latex-Suite</a></span></dt><dt><span class="section"><a href="#customizing-what-to-fold">8.2 Customizing what to fold</a></span></dt><dt><span class="section"><a href="#editing-folding">8.3 Editing the folding.vim file directly</a></span></dt></dl></dd><dt><span class="section"><a href="#latex-project">9 Multiple file LaTeX projects</a></span></dt><dd><dl><dt><span class="section"><a href="#latex-project-settings">9.1 Latex-Suite project settings</a></span></dt><dt><span class="section"><a href="#latex-master-file">9.2 Specifying which file to compile</a></span></dt></dl></dd><dt><span class="section"><a href="#latex-suite-commands-maps">10 Latex-Suite Commands and Maps</a></span></dt><dd><dl><dt><span class="section"><a href="#latex-suite-maps">10.1 Latex-Suite Maps</a></span></dt><dt><span class="section"><a href="#latex-suite-commands">10.2 Latex Suite Commands</a></span></dt></dl></dd><dt><span class="section"><a href="#customizing-latex-suite">11 Customizing Latex-Suite</a></span></dt><dd><dl><dt><span class="section"><a href="#ls-general-purpose-settings">11.1 General Settings</a></span></dt><dt><span class="section"><a href="#customizing-place-holders">11.2 Place-Holder Customization</a></span></dt><dt><span class="section"><a href="#customizing-macros">11.3 Macro Customization</a></span></dt><dt><span class="section"><a href="#customizing-smart-keys">11.4 Smart Key Customization</a></span></dt><dt><span class="section"><a href="#customizing-latex-completion">11.5 Latex Completion Customization</a></span></dt><dt><span class="section"><a href="#customizing-compiling">11.6 Compiler Customization</a></span></dt><dt><span class="section"><a href="#customizing-viewing">11.7 Viewer Customization</a></span></dt><dt><span class="section"><a href="#customizing-menus">11.8 Menu Customization</a></span></dt><dt><span class="section"><a href="#customizing-folding">11.9 Folding Customization</a></span></dt><dt><span class="section"><a href="#customizing-packages">11.10 Package Handling Customization</a></span></dt></dl></dd><dt><span class="section"><a href="#latex-suite-credits">12 Credits</a></span></dt></dl></div><div class="section" title="1 Installation and recommended Settings"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="recommended-settings"></a>1 Installation and recommended Settings</h2></div></div></div><p> + If you are reading this, it most probably means that you have already + installed Latex-Suite and the help files. If this is not the case, follow the + detailed instructions on <a class="ulink" href="http://vim-latex.sourceforge.net/index.php?subject=download" target="_top">Latex-Suite's + download page</a>. + </p><p> + Make sure that you create a few necessary settings in your + <code class="literal">~/.vimrc.</code> + </p><pre class="programlisting"> +" REQUIRED. This makes vim invoke Latex-Suite when you open a tex file. +filetype plugin on + +" IMPORTANT: win32 users will need to have 'shellslash' set so that latex +" can be called correctly. +set shellslash + +" IMPORTANT: grep will sometimes skip displaying the file name if you +" search in a singe file. This will confuse Latex-Suite. Set your grep +" program to always generate a file-name. +set grepprg=grep\ -nH\ $* + +" OPTIONAL: This enables automatic indentation as you type. +filetype indent on + +" OPTIONAL: Starting with Vim 7, the filetype of empty .tex files defaults to +" 'plaintex' instead of 'tex', which results in vim-latex not being loaded. +" The following changes the default filetype back to 'tex': +let g:tex_flavor='latex' +</pre><p> + </p><p> + In addition, the following settings could go in your ~/.vim/ftplugin/tex.vim + file: + </p><pre class="programlisting">" this is mostly a matter of taste. but LaTeX looks good with just a bit +" of indentation. +set sw=2 +" TIP: if you write your \label's as \label{fig:something}, then if you +" type in \ref{fig: and press &lt;C-n&gt; you will automatically cycle through +" all the figure labels. Very useful! +set iskeyword+=: +</pre><p> + </p></div><div class="section" title="2 Inserting Templates"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="latex-suite-templates"></a>2 Inserting Templates</h2></div></div></div><p> + This functionality is available via the <code class="literal">TeX-Suite &gt; + Templates</code> menu. + This module provides a way to insert custom templates at the beginning of the + current file. + </p><p> + When Latex-Suite first starts up, it scans the + <code class="literal">$VIM/ftplugin/latex-suite/templates/</code> + directory and creates menu items based on the files found there. When + you select a template from this menu, the file will be read in above + the first line of the current file. + </p><p> + A template file can utilize placeholders for initializing the cursor + position when the template is read in and subsequent movement. In + addition, template files can contain dynamic elements such as the + time of creation of a file etc, by using vim expressions. + </p><p> + You can place your own templates in the + <code class="literal">$VIM/ftplugin/latex-suite/templates/</code> directory in + order for them to be available via the menu. Unless Latex-Suite releases a + template with the same name, these files should not get over-written + when you install a new release over an existing one. + </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> + Templates are also accessible for non-gui users with the command + |<code class="literal">:TTemplate</code>|. The argument should be name of + the corresponding template file. If the command is called + without arguments (preferred usage), then a list of available + templates is displayed and the user is asked to choose one of + them. + </p></div></div><div class="section" title="3 Latex-Suite Macros"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="latex-macros"></a>3 Latex-Suite Macros</h2></div></div></div><p> + Latex-Suite ships with a very comprehensive set of insert mode and + |visual-mode| mappings and menu items to typeset most of the LaTeX + elements. + </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> + These mappings are are not standard mappings in the sense that + only the last character is mapped. See plugin/imaps.vim for + further documentation. For example, in the case of the mapping + <code class="literal">EFI</code> provided by Latex-Suite you can press the characters + '<code class="literal">E</code>', '<code class="literal">F</code>' and '<code class="literal">I</code>' + as slowly as you wish (unlike the normal <code class="literal">imap</code> command + where <code class="literal">timeout</code> issues are involved). The characters are + visible as you type them (unlike normal <code class="literal">imap</code>s) and you + can use the movement or backspace key to correct yourself unlike normal + mappings. + </p></div><a id="place-holder"></a><div class="note" title="Place Holders" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title"><a id="place-holders"></a>Place Holders</h3><p> + Almost all macros provided in Latex-Suite implement Stephen Riem's bracketing + system and Gergely Kontra's <code class="literal">JumpFunc()</code> for handling + place-holders. This consists of using "place-holders" to mark off + locations where the next relevant editing has to be done. As an example, + when you type <code class="literal">EFI</code> in |insert-mode|, you will get the + following: + </p><pre class="programlisting">\begin{figure}[h] + \centerline{\psfig{figure=&lt;+eps file+&gt;}} + \caption{&lt;+caption text+&gt;} + \label{fig:&lt;+label+&gt;} +\end{figure}&lt;++&gt;</pre><p> + The text <code class="literal">&lt;+eps file+&gt;</code> will be selected and + you will be left in |select-mode| so that you can continue typing + straight away. After having typed in the file name, you can press + <code class="literal">&lt;Ctrl-J&gt;</code> (while still in insert-mode). This will + take you directly to the next "place-holder". i.e, <code class="literal">&lt;+caption + text+&gt;</code> will be visually selected with Vim in select mode + again for typing in the caption. This saves on a lot of key presses. + </p></div><div class="note" title="Over-riding Latex-Suite Macros" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title"><a id="overriding-macros"></a>Over-riding Latex-Suite Macros</h3><p> + If you wish to change these macros from their default values, for + example, if you wish to change <code class="literal">`w</code> to expand to + <code class="literal">\omega</code> instead of its default expansion to + <code class="literal">\wedge</code>, you should use the <code class="literal">IMAP</code> + function as described in the <a class="link" href="#ls-new-macros" title="3.12 Making your own Macros via IMAP()">Using + IMAP()</a> section. + </p><p> + An important thing to note is that if you wish to over-ride macros + created by Latex-Suite rather than merely create new macros, you should place + the <code class="literal">IMAP()</code> calls in a script which gets sourced + after the files in Latex-Suite. A good place typically is as a file-type + plugin file in the + <code class="literal">~/.vim/after/ftplugin/</code> directory. (Use + <code class="literal">~/vimfiles</code> if you are using + <code class="literal">WINDOWS</code>). For example to over-ride + <code class="literal">`w</code> to <code class="literal">\omega</code> instead of + <code class="literal">\wedge</code>, place the following line in (say) + <code class="literal">~/.vim/after/ftplugin/tex_macros.vim</code>: + </p><pre class="programlisting">call IMAP('`w', '\omega', 'tex')</pre><p> + </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> + It is important to use a file-name which will get sourced on a + <code class="literal">FileType</code> event. Therefore you must use a file-name + which conforms to the standards as described in + <code class="literal">|ftplugin-name|</code>. + </p></div></div><div class="note" title="Pausing Macro expansion" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title"><a id="pausing-imaps"></a>Pausing Macro expansion</h3><p> + If you wish to temporarily suspend the imaps functionality, then you + can set the <code class="literal">Imap_FreezeImap</code> to 1. If you set + <code class="literal">g:Imap_FreezeImap</code> to 1, then it will be a + system-wide setting. Setting <code class="literal">b:Imap_FreezeImap</code> will + affect only the current buffer. + </p></div><p> + The following sections describe the various editing macros provided + by Latex-Suite. + </p><div class="section" title="3.1 Environment Mappings"><div class="titlepage"><div><div><h3 class="title"><a id="environment-mappings"></a>3.1 Environment Mappings</h3></div></div></div> + Latex-Suite provides a rich set of mappings to insert, enclose and modify + LaTeX environments, i.e, <code class="literal">\begin{...} ... \end{...}</code> + pairs. + <div class="section" title="3.1.1 Inserting Environments"><div class="titlepage"><div><div><h4 class="title"><a id="inserting-environments"></a>3.1.1 Inserting Environments</h4></div></div></div><p> + Latex-Suite provides the following ways to insert environments + </p><div class="section" title="3.1.1.1 Method 1: Pressing &lt;F5&gt;"><div class="titlepage"><div><div><h5 class="title"><a id="inserting-env-f5"></a>3.1.1.1 Method 1: Pressing <code class="literal">&lt;F5&gt;</code></h5></div></div></div><p> + If you press <code class="literal">&lt;F5&gt;</code> in the insert or normal + mode while on an empty line, Latex-Suite prompts you with a list of + environments you might want to insert. You can either choose one + from the list or type in a new environment name. If you press + <code class="literal">&lt;F5&gt;</code> on a line which already has a word, + then that word is used instead of prompting. + </p><p> + See <a class="link" href="#Tex_Env_name" title="11.3.1 Tex_Env_name">Tex_Env_name</a> for a + description of how Latex-Suite uses the word to form the expansion and how + to modify Latex-Suite's behavior. + </p><p> + The list of environments which Latex-Suite prompts you with (when + <code class="literal">&lt;F5&gt;</code> is pressed on an empty line) is formed + from the <a class="link" href="#Tex_PromptedEnvironments" title="11.3.10 g:Tex_PromptedEnvironments">Tex_PromptedEnvironments</a> + setting. + </p><p> + In addition to this setting, Latex-Suite also lists environments found in + custom packages as described in the section <a class="link" href="#package-actions" title="4.2 Actions taken for supported packages">Package actions.</a> + </p></div><div class="section" title="3.1.1.2 Method 2: Using &lt;S-F1&gt;-&lt;S-F4&gt;"><div class="titlepage"><div><div><h5 class="title"><a id="inserting-env-shift-f1"></a>3.1.1.2 Method 2: Using <code class="literal">&lt;S-F1&gt;</code>-<code class="literal">&lt;S-F4&gt;</code></h5></div></div></div><p> + The shifted function keys, <code class="literal">&lt;S-F1&gt;</code> to + <code class="literal">&lt;S-F4&gt;</code> can be mapped to insert very commonly + used environments. The environments mapped to each key can be + customized via the <a class="link" href="#Tex_HotKeyMappings" title="11.3.11 g:Tex_HotKeyMappings">g:Tex_HotKeyMappings</a> setting. + </p></div><div class="section" title="3.1.1.3 Method 3: Using three letter sequences"><div class="titlepage"><div><div><h5 class="title"><a id="inserting-env-threeletter"></a>3.1.1.3 Method 3: Using three letter sequences</h5></div></div></div><p> + Environments can also be inserted by pressing a 3 capital letter + sequence starting with an <code class="literal">E</code>. The sequence of 3 + letters generally tries to follow the following rules: + </p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"> + All environment mappings begin with <code class="literal">E</code></li><li class="listitem"> + If the environment can be broken up into 2 distinct words, + such as flushright (flush + right), then the next 2 letters + are the first letters of the 2 words. Example: + <pre class="programlisting">flushleft (_f_lush + _l_eft) ---&gt; EFL +flushright (_f_lush + _r_ight) ---&gt; EFR +eqnarray (_e_qn + _a_rray) ---&gt; EEA</pre> + If on the other hand, the environment name cannot be broken + up into 2 distinct words, then the next 2 letters are the + first 2 letters of the name of the environment. + Example: + <pre class="programlisting">equation (_eq_uation) ---&gt; EEQ</pre></li></ol></div><p> + Unfortunately there are some environments that cannot be + split in two words and first two letters in name are + identical. In this case shortcut is created from E, first and + last letter. Example: + </p><pre class="programlisting">quote (_q_uot_e_) ---&gt; EQE +quotation (_q_uotatio_n_) ---&gt; EQN</pre><p> + Of course, not every last one of the environments can follow + this rule because of ambiguities. In case of doubt, pull down + the Tex-Environments menu. The menu item should give the hint + for the map. + </p></div></div><div class="section" title="3.1.2 Enclosing in Environments"><div class="titlepage"><div><div><h4 class="title"><a id="enclosing-environments"></a>3.1.2 Enclosing in Environments</h4></div></div></div><p> + Latex-Suite provides visual-mode mappings which enclose visually + selected portions of text in environments. There are two ways provided + to do this. + </p><div class="section" title="3.1.2.1 Method 1: Pressing &lt;F5&gt;"><div class="titlepage"><div><div><h5 class="title"><a id="enclosing-env-f5"></a>3.1.2.1 Method 1: Pressing <code class="literal">&lt;F5&gt;</code></h5></div></div></div><p> + You can also select a portion of text visually and press + <code class="literal">&lt;F5&gt;</code> while still in visual mode. This will + prompt you with a list of environments. (This list can be customized + via the <a class="link" href="#Tex_PromptedEnvironments" title="11.3.10 g:Tex_PromptedEnvironments">g:Tex_PromptedEnvironments</a> + setting). You can either choose from this list or type in a new + environment name. Once the selection is done, Latex-Suite encloses the + visually selected portion in the chosen environment. + </p></div><div class="section" title="3.1.2.2 Method 2: Using three letter mappings"><div class="titlepage"><div><div><h5 class="title"><a id="enclosing-env-threeletter"></a>3.1.2.2 Method 2: Using three letter mappings</h5></div></div></div><p> + You can also select text visually and press a sequence of three + characters beginning with <code class="literal">,</code> (the single comma + character) and the selected text will be enclosed in the chosen + environment. The three letter sequence follows directly from the + three letter sequence used to insert environments as described <a class="link" href="#inserting-env-threeletter" title="3.1.1.3 Method 3: Using three letter sequences">here</a>. The following + example describes the rule used: + </p><p> + If <code class="literal">ECE</code> inserts a + <code class="literal">\begin{center}...\end{center}</code> environment, then to + enclose a block of selected text in + <code class="literal">\begin{center}...\end{center}</code>, simply select the + text and press <code class="literal">,ce</code>. The rule simply says that the + leading <code class="literal">E</code> is converted to <code class="literal">,</code> and + the next 2 letters are small case. + </p></div><p> + Some of the visual mode mappings are sensitive to whether you + choose line-wise or character-wise. For example, if you choose a + word and press <code class="literal">,ce</code>, then you get + <code class="literal">\centerline{word}</code>, whereas if you press + <code class="literal">,ce</code> on a line-wise selection, you get: + </p><pre class="programlisting">\begin{center} + line +\end{center}</pre><p> + </p></div><div class="section" title="3.1.3 Changing Environments"><div class="titlepage"><div><div><h4 class="title"><a id="changing-environments"></a>3.1.3 Changing Environments</h4></div></div></div><p> + Pressing <code class="literal">&lt;S-F5&gt;</code> in normal mode detects which + environment the cursor is presently located in and prompts you to + replace it with a new one. The innermost environment is detected. For + example, in the following source: + </p><pre class="programlisting">\begin{eqnarray} + \begin{array}{ccc} + 2 &amp; 3 &amp; 4 + \end{array} +\end{eqnarray}</pre><p> + if you are located in the middle "2 &amp; 3 &amp; 4" line, then pressing + <code class="literal">&lt;S-F5&gt;</code> will prompt you to change the array + environment, not the eqnarray environment. In addition, Latex-Suite will also + try to change lines within the environment to be consistent with the + new environment. For example, if the original environment was an + <code class="literal">eqnarray</code> environment with a + <code class="literal">\label</code> command, then changing it to an + <code class="literal">eqnarray*</code> environment will delete the + <code class="literal">\label</code>. + </p><p> + Pressing <code class="literal">&lt;F5&gt;</code> in normal mode has the same + effect as pressing <code class="literal">&lt;F5&gt;</code> in insert-mode, + namely you will be prompted to choose an environment to insert. + </p></div></div><div class="section" title="3.2 Command Mappings"><div class="titlepage"><div><div><h3 class="title"><a id="latex-command-maps"></a>3.2 Command Mappings</h3></div></div></div> + Latex-Suite provides a rich set of mappings to insert, enclose and modify + LaTeX commands. + <div class="section" title="3.2.1 Inserting LaTeX commands"><div class="titlepage"><div><div><h4 class="title"><a id="inserting-commands"></a>3.2.1 Inserting LaTeX commands</h4></div></div></div><a id="ls-imap-f7"></a><a id="ls-imap-s-f7"></a><p> + Pressing <code class="literal">&lt;F7&gt;</code> in insert or normal mode while + the cursor is touching a word will insert a command formed from the + word touching the cursor. + </p><p> + For certain common commands, Latex-Suite will expand them to include + additional arguments as needed. For example, <code class="literal">frac</code> + becomes <code class="literal">\frac{&lt;++&gt;}{&lt;++&gt;}&lt;++&gt;</code>. Otherwise, it will + simply change the word under the cursor as follows + </p><pre class="programlisting">word --&gt; \word{&lt;++&gt;}&lt;++&gt;</pre><p> + You can define custom expansions + of commands using the <code class="literal">Tex_Com_{name}</code> setting as + described in <a class="link" href="#Tex_Com_name" title="11.3.2 Tex_Com_name">here</a>. + </p><p> + If <code class="literal">&lt;F7&gt;</code> is pressed when the cursor is on + white-space, then Latex-Suite will prompt you to choose a command and insert + that instead.The list of commands is constructed from the <a class="link" href="#Tex_PromptedCommands" title="11.3.12 g:Tex_PromptedCommands"><code class="literal">g:Tex_PromptedCommands</code></a> + setting and also from commands which Latex-Suite finds while scanning custom + packages which Latex-Suite finds. See the <a class="link" href="#package-actions" title="4.2 Actions taken for supported packages">Package actions</a> section for details + on which files are scanned etc. + </p></div><div class="section" title="3.2.2 Enclosing in a command"><div class="titlepage"><div><div><h4 class="title"><a id="enclosing-commands"></a>3.2.2 Enclosing in a command</h4></div></div></div><p> + You can select a portion of text visually and press + <code class="literal">&lt;F7&gt;</code> while still in visual mode. This will + prompt you with a list of commands. (This list can be customized + via the <a class="link" href="#Tex_PromptedCommands" title="11.3.12 g:Tex_PromptedCommands">g:Tex_PromptedCommands</a> + setting). You can either choose from this list or type in a new + command name. Once the selection is done, Latex-Suite encloses the + visually selected portion in the chosen command. + </p></div><div class="section" title="3.2.3 Changing commands"><div class="titlepage"><div><div><h4 class="title"><a id="changing-commands"></a>3.2.3 Changing commands</h4></div></div></div><a id="ls-vmap-f7"></a><p> + In both insert and normal mode <code class="literal">&lt;S-F7&gt;</code> will + find out if you are presently within an environment and then prompt you + with a list of commands to change it to. + </p></div></div><div class="section" title="3.3 Font Mappings"><div class="titlepage"><div><div><h3 class="title"><a id="font-maps"></a>3.3 Font Mappings</h3></div></div></div><p> + These mappings insert font descriptions such as: + <code class="literal">\textsf{&lt;++&gt;}&lt;++&gt;</code> + with the cursor left in place of the first <a class="link" href="#place-holders" title="Place Holders">placeholder</a> (the &lt;++&gt; characters). + </p><p> + Mnemonic: + </p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">first letter is always F (F for font)</li><li class="listitem">next 2 letters are the 2 letters describing the font.</li></ol></div><p> + </p><p> + Example: Typing <code class="literal">FEM</code> in insert-mode expands to + <code class="literal">\emph{&lt;++&gt;}&lt;++&gt;</code>. + </p><p> + Just like environment mappings, you can visually select an area and press + <code class="literal">`sf</code> to have it enclosed in: + <code class="literal">\textsf{word}</code> + or + </p><pre class="programlisting">{\sffamily +line +}</pre><p> + depending on character-wise or line-wise selection. + </p></div><div class="section" title="3.4 Section Mappings"><div class="titlepage"><div><div><h3 class="title"><a id="section-mappings"></a>3.4 Section Mappings</h3></div></div></div><p> + These maps insert LaTeX sections such as: + </p><pre class="programlisting">\section{&lt;++&gt;}&lt;++&gt;</pre><p> + etc. Just as in the case of environments and fonts, can be enclosed with a + visual selection. The enclosing is not sensitive to character or line-wise + selection. + </p><p> + Mnemonic: (make your own!) + </p><pre class="programlisting">SPA for part +SCH for chapter +SSE for section +SSS for subsection +SS2 for subsubsection +SPG for paragraph +SSP for subparagraph</pre><p> + </p><p> + Example: + SSE in insert mode inserts + </p><pre class="programlisting">\section{&lt;++&gt;}&lt;++&gt;</pre><p> + If you select a word or line and press <code class="literal">,se</code>, then you + get + </p><pre class="programlisting">\section{section name}</pre><p> + The menu item in Tex-Environments.Sections have a sub-menu called + 'Advanced'. Choosing an item from this sub-menu asks a couple of questions + (whether you want to include the section in the table of contents, whether + there is a shorter name for the table of contents) and then creates a more + intelligent template. + </p></div><div class="section" title="3.5 Greek Letter Mappings"><div class="titlepage"><div><div><h3 class="title"><a id="greek-letter-mappings"></a>3.5 Greek Letter Mappings</h3></div></div></div><p> + Lower case + </p><code class="literal">`a</code> through <code class="literal">`z</code> expand to + <code class="literal">\alpha</code> through <code class="literal">\zeta</code>. + <p> + Upper case: + </p><pre class="programlisting">`D = \Delta +`F = \Phi +`G = \Gamma +`Q = \Theta +`L = \Lambda +`X = \Xi +`Y = \Psi +`S = \Sigma +`U = \Upsilon +`W = \Omega</pre><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>LaTeX does not support upper case for all greek alphabets.</p></div><p>Just like other Latex-Suite mappings, these mappings are not created using + the standard <code class="literal">imap</code> command. Thus you can type slowly, + correct using <code class="literal">&lt;BS&gt;</code> etc.</p></div><div class="section" title="3.6 Auc-Tex Key Bindings"><div class="titlepage"><div><div><h3 class="title"><a id="auc-tex-mappings"></a>3.6 Auc-Tex Key Bindings</h3></div></div></div><p> + These are simple 2 key expansions for some very commonly used LaTeX + elements: + </p><pre class="programlisting">`^ Expands To \Hat{&lt;++&gt;}&lt;++&gt; +`_ expands to \bar{&lt;++&gt;}&lt;++&gt; +`6 expands to \partial +`8 expands to \infty +`/ expands to \frac{&lt;++&gt;}{&lt;++&gt;}&lt;++&gt; +`% expands to \frac{&lt;++&gt;}{&lt;++&gt;}&lt;++&gt; +`@ expands to \circ +`0 expands to ^\circ +`= expands to \equiv +`\ expands to \setminus +`. expands to \cdot +`* expands to \times +`&amp; expands to \wedge +`- expands to \bigcap +`+ expands to \bigcup +`( expands to \subset +`) expands to \supset +`&lt; expands to \le +`&gt; expands to \ge +`, expands to \nonumber +`~ expands to \tilde{&lt;++&gt;}&lt;++&gt; +`; expands to \dot{&lt;++&gt;}&lt;++&gt; +`: expands to \ddot{&lt;++&gt;}&lt;++&gt; +`2 expands to \sqrt{&lt;++&gt;}&lt;++&gt; +`| expands to \Big| +`I expands to \int_{&lt;++&gt;}^{&lt;++&gt;}&lt;++&gt;</pre><p> + (again, notice the convenient place-holders) + </p><p> + In addition the visual mode macros are provided: + </p><pre class="programlisting">`( encloses selection in \left( and \right) +`[ encloses selection in \left[ and \right] +`{ encloses selection in \left\{ and \right\} +`$ encloses selection in $$ or \[ \] depending on characterwise or + linewise selection</pre></div><div class="section" title="3.7 Diacritics"><div class="titlepage"><div><div><h3 class="title"><a id="diacritic-mappings"></a>3.7 Diacritics</h3></div></div></div><p> + These mappings speed up typing European languages which contain diacritic + characters such as a-umlaut etc. + </p><pre class="programlisting">+&lt;l&gt; expands to \v{&lt;l&gt;} +=&lt;l&gt; expands to \'{&lt;l&gt;}</pre><p> + where <code class="literal">&lt;l&gt;</code> is an alphabet. + </p><pre class="programlisting">+} expands to \"{a} ++: expands to \^{o}</pre><p> + Latex-Suite also ships with <a class="link" href="#smart-backspace">smart + backspacing</a> functionality which provides another convenience while + editing languages with diacritics. + </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>Diacritics are disabled by default in Latex-Suite because they can + sometimes be a little too intrusive. Moreover, most European users can + nowadays use font encodings which display diacritic characters directly + instead of having to rely on Latex-Suite's method of displaying diacritics.</p><p>Set the <a class="link" href="#Tex_Diacritics" title="11.3.7 g:Tex_Diacritics">g:Tex_Diacritics</a> + variable to enable diacritics.</p></div></div><div class="section" title="3.8 BibTeX Shortcuts"><div class="titlepage"><div><div><h3 class="title"><a id="bibtex-bindings"></a>3.8 BibTeX Shortcuts</h3></div></div></div><p> + Latex-Suite provides an easy way of entering bibliographic entries. Four + insert-mode mappings: <code class="literal">BBB</code>, <code class="literal">BBL</code>, + <code class="literal">BBH</code> and <code class="literal">BBX</code> are provided, all of + which essentially act in the same manner. When you type any of these in + insert-mode, you will get a prompt asking you to choose a entry type + for the bibliographic entry. + </p><p> + When you choose an entry type, a bibliographic entry template will be + inserted. For example, if you choose the option + <code class="literal">'book'</code> via the map <code class="literal">BBB</code>, then + the following template will be inserted: + </p><pre class="programlisting">@BOOK{&lt;+key+&gt;, + author = {&lt;++&gt;}, + editor = {&lt;++&gt;}, + title = {&lt;++&gt;}, + publisher = {&lt;++&gt;}, + year = {&lt;++&gt;}, + otherinfo = {&lt;++&gt;} +}&lt;++&gt;</pre><p> + </p><p> + <code class="literal">&lt;+key+&gt;</code> will be highlighted in select-mode and + you can type in the bib-key. After that you can use + <code class="literal">&lt;Ctrl-J&gt;</code> to navigate to successive locations + in the template and enter new values. + </p><p> + <code class="literal">BBB</code> inserts a template with only the fields + mandatorily required for a given entry type. <code class="literal">BBL</code> + inserts a template with commonly used extra options. + <code class="literal">BBH</code> inserts a template with more options which are + not as commonly used. <code class="literal">BBX</code> inserts a template with + all the fields which the entry type supports. + </p><div class="note" title="Mnemonic" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Mnemonic</h3><p> + <code class="literal">B</code> for Bibliographic entry, <code class="literal">L</code> + for Large entry, <code class="literal">H</code> for Huge entry, and + <code class="literal">X</code> stands for all eXtras. + </p></div><div class="section" title="3.8.1 Customizing Bib-TeX fields"><div class="titlepage"><div><div><h4 class="title"><a id="adding-bib-options"></a>3.8.1 Customizing Bib-TeX fields</h4></div></div></div><p> + If you wish the <code class="literal">BBB</code> command to insert a few + additional fields in addition to the fields it creates, then you will + need to define global variables of the form + </p><pre class="programlisting">g:Bib_{type}_options</pre><p> + in you <code class="literal">$VIM/ftplugin/bib.vim</code> file, where + <code class="literal">{type}</code> is a string like + <code class="literal">'article'</code>, <code class="literal">'book'</code> etc. This + variable should contain one of the letters defined in the following + table + </p><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><thead><tr><th>Character</th><th>Field Type</th></tr></thead><tbody><tr><td>w</td><td>address</td></tr><tr><td>a</td><td>author</td></tr><tr><td>b</td><td>booktitle</td></tr><tr><td>c</td><td>chapter</td></tr><tr><td>d</td><td>edition</td></tr><tr><td>e</td><td>editor</td></tr><tr><td>h</td><td>howpublished</td></tr><tr><td>i</td><td>institution</td></tr><tr><td>k</td><td>isbn</td></tr><tr><td>j</td><td>journal</td></tr><tr><td>m</td><td>month</td></tr><tr><td>z</td><td>note</td></tr><tr><td>n</td><td>number</td></tr><tr><td>o</td><td>organization</td></tr><tr><td>p</td><td>pages</td></tr><tr><td>q</td><td>publisher</td></tr><tr><td>r</td><td>school</td></tr><tr><td>s</td><td>series</td></tr><tr><td>t</td><td>title</td></tr><tr><td>u</td><td>type</td></tr><tr><td>v</td><td>volume</td></tr><tr><td>y</td><td>year</td></tr></tbody></table></div><p> + For example, by default, choosing <code class="literal">'article'</code> via + <code class="literal">BBB</code> inserts the following template by default + </p><pre class="programlisting">@ARTICLE{&lt;+key+&gt;, + author = {&lt;++&gt;}, + title = {&lt;++&gt;}, + journal = {&lt;++&gt;}, + year = {&lt;++&gt;}, + otherinfo = {&lt;++&gt;} +}&lt;++&gt;</pre><p> + However, if <code class="literal">g:Bib_article_options</code> is defined as + <code class="literal">'mnp'</code>, then <code class="literal">'article'</code> will + insert the following template + </p><pre class="programlisting">@ARTICLE{&lt;+key+&gt;, + author = {&lt;++&gt;}, + title = {&lt;++&gt;}, + journal = {&lt;++&gt;}, + year = {&lt;++&gt;}, + month = {&lt;++&gt;}, + number = {&lt;++&gt;}, + pages = {&lt;++&gt;}, + otherinfo = {&lt;++&gt;} +}&lt;++&gt;</pre><p> + </p><p> + If you have some other fields you wish to associate with an article + which are not listed above, then you will have to use the + <code class="literal">Bib_{type}_extrafields</code> option. This is a newline + separated string of complete field names which will be included in the + template. For example, if you define + </p><pre class="programlisting">let g:Bib_article_extrafields = "crossref\nabstract"</pre><p> + then the article template will include the lines + </p><pre class="programlisting">crossref = {&lt;++&gt;}, +abstract = {&lt;++&gt;},</pre><p> + </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> + You will need to define <code class="literal">Bib_*</code> settings in your + <code class="literal">$VIMRUNTIME/ftplugin/bib.vim</code> file. + </p></div></div></div><div class="section" title="3.9 Smart Key Mappings"><div class="titlepage"><div><div><h3 class="title"><a id="smart-keys"></a>3.9 Smart Key Mappings</h3></div></div></div><p> + Latex-Suite ships with the following smart keys: + </p><p title="Smart Backspace"><a id="smart-backspace"></a><b>Smart Backspace. </b> + Pressing <code class="literal">&lt;BS&gt;</code> in insert mode checks to see + whether we are just after something like <code class="literal">\'{a}</code> and + if so, deletes all of it. i.e, diacritics are treated as single + characters for backspacing. + </p><p title="Smart Quotes"><b>Smart Quotes. </b> + Pressing <code class="literal">"</code> (English double quote) will insert + <code class="literal">``</code> or <code class="literal">''</code> by making an + intelligent guess about whether we intended to open or close a quote. + </p><p title="Smart Space"><b>Smart Space. </b> + Latex-Suite maps the <code class="literal">&lt;space&gt;</code> key in such a + way that $ characters are not broken across lines. It does this by + first setting <code class="literal">tw=0</code> so that Vim will not + automatically break lines and then maps the + <code class="literal">&lt;space&gt;</code> key to insert newlines keeping + <code class="literal">$$</code>'s on the same line. + </p><p title="Smart Dots"><b>Smart Dots. </b> + Pressing <code class="literal">...</code> (3 dots) results in + <code class="literal">\ldots</code> outside math mode and + <code class="literal">\cdots</code> in math mode. + </p></div><div class="section" title="3.10 Alt Key Macros"><div class="titlepage"><div><div><h3 class="title"><a id="altkey-mappings"></a>3.10 Alt Key Macros</h3></div></div></div><p> + Latex-Suite utilizes a set of macros originally created by Carl Mueller in + auctex.vim to make inserting all the <code class="literal">\left ... \right</code> + stuff very easy and to also make some use of the heavily under-utilized + <code class="literal">&lt;Alt&gt;</code> key. + </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> + By default, typing <code class="literal">Alt-&lt;key&gt;</code> in Vim takes + focus to the menu bar if a menu with the hotkey + <code class="literal">&lt;key&gt;</code> exists. If in your case, there are + conflicts due to this behavior, you will need to set + </p><pre class="programlisting">set winaltkeys=no</pre><p> + in your <code class="literal">$VIM/ftplugin/tex.vim</code> in order to use these + maps. + </p></div><div class="note" title="Customizing the maps" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Customizing the maps</h3><p> + If for some reason, you wish to not map the + <code class="literal">&lt;Alt&gt;</code> keys, (some European users need to use + the <code class="literal">&lt;Alt&gt;</code> key to enter diacritics), you can + change these maps to other keys as described in the section <a class="link" href="#customize-alt-key-maps" title="10.1.2 Alt-Key mappings">Customizing Alt-key maps</a>. + </p></div><div class="section" title="3.10.1 &lt;Alt-L&gt;"><div class="titlepage"><div><div><h4 class="title"><a id="Alt-L"></a>3.10.1 <code class="literal">&lt;Alt-L&gt;</code></h4></div></div></div><p> + This is a polymorphic insert-mode mapping which expands to one of the + following depending on the character just before the cursor location. + </p><div class="informaltable"><table border="1"><colgroup><col width="0.5in" align="cener"></col><col width="0.5in"></col></colgroup><thead><tr><th align="cener">Character before cursor</th><th>Expansion</th></tr></thead><tbody><tr><td align="cener">(</td><td><code class="literal">\left( &lt;++&gt; \right)</code></td></tr><tr><td align="cener">[</td><td><code class="literal">\left[ &lt;++&gt; \right]</code></td></tr><tr><td align="cener">|</td><td><code class="literal">\left| &lt;++&gt; \right|</code></td></tr><tr><td align="cener">{</td><td><code class="literal">\left\{ &lt;++&gt; \right\}</code></td></tr><tr><td align="cener">&lt;</td><td><code class="literal">\langle &lt;++&gt; \rangle</code></td></tr><tr><td align="cener">q</td><td><code class="literal">\lefteqn{&lt;++&gt;}&lt;++&gt;</code></td></tr></tbody></table></div><p> + If the character before the cursor is none of the above, then it will + simply insert a <code class="literal">\label{&lt;++&gt;}&lt;++&gt;</code>. + </p></div><div class="section" title="3.10.2 &lt;Alt-B&gt;"><div class="titlepage"><div><div><h4 class="title"><a id="Alt-B"></a>3.10.2 <code class="literal">&lt;Alt-B&gt;</code></h4></div></div></div><p> + This insert-mode mapping encloses the previous character in + <code class="literal">\mathbf{}</code>. + </p></div><div class="section" title="3.10.3 &lt;Alt-C&gt;"><div class="titlepage"><div><div><h4 class="title"><a id="Alt-C"></a>3.10.3 <code class="literal">&lt;Alt-C&gt;</code></h4></div></div></div><p> + In insert mode, this key is polymorphic as follows: + </p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"> + If the previous character is a letter or number, then capitalize it and + enclose it in <code class="literal">\mathcal{}</code>. + </li><li class="listitem"> + otherwise insert <code class="literal">\cite{}</code>. + </li></ol></div><p> + In visual mode, it will simply enclose the selection in + <code class="literal">\mathcal{}</code> + </p></div><div class="section" title="3.10.4 &lt;Alt-I&gt;"><div class="titlepage"><div><div><h4 class="title"><a id="Alt-I"></a>3.10.4 <code class="literal">&lt;Alt-I&gt;</code></h4></div></div></div><p> + This mapping inserts an <code class="literal">\item</code> command at the + current cursor location depending on which environment the cursor is + enclosed in. The style of the <code class="literal">\item</code> command is + dependent on the enclosing environment. By default, + <code class="literal">&lt;Alt-I&gt;</code> has styles defined forthe following + environments: + </p><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><thead><tr><th>Environment</th><th>Style</th></tr></thead><tbody><tr><td>itemize</td><td>\item </td></tr><tr><td>enumerate</td><td>\item </td></tr><tr><td>theindex</td><td>\item </td></tr><tr><td>thebibliography</td><td>\item[&lt;+biblabel+&gt;]{&lt;+bibkey+&gt;} &lt;++&gt;</td></tr><tr><td>description</td><td>\item[&lt;+label+&gt;] &lt;++&gt;</td></tr></tbody></table></div><p> + <code class="literal">&lt;Alt-I&gt;</code> is intelligent enough to + account for nested environments. For example, + </p><pre class="programlisting">\begin{itemize} + \item first item + \item second item + \begin{description} + \item[label1] first desc + \item[label2] second + % &lt;Alt-I&gt; will insert "\item[&lt;+label+&gt;] &lt;++&gt;" if + % used here + \end{description} + \item third item + % &lt;Alt-I&gt; will insert "\item " when if used here. +\end{itemize} +% &lt;Alt-I&gt; will insert nothing ("") if used here</pre><p> + </p><p> + The style used by <code class="literal">&lt;Alt-I&gt;</code> can be customized + using the <a class="link" href="#Tex_ItemStyle_environment" title="11.3.13 Tex_ItemStyle_environment"><code class="literal">g:Tex_ItemStyle_environment</code></a> + variable. + </p></div></div><div class="section" title="3.11 Custom Macros"><div class="titlepage"><div><div><h3 class="title"><a id="custom-macros-menu"></a>3.11 Custom Macros</h3></div></div></div><p> + This functionality available via the TeX-Suite.Macros menu, provides + a way of inserting customized macros into the current file via the + menu. + </p><p> + When Latex-Suite starts up, it scans the + <code class="literal">$VIM/ftplugin/latex-suite/macros/</code> directory and + creates a menu from the files found there. Each file is considered as + a single macro. You can place your own macros in this directory, + using <a class="link" href="#place-holders" title="Place Holders">placeholders</a> if wanted. + </p><p> + When you choose a macro from the menu, the corresponding file is read + into the current buffer after the current cursor position. In non-gui + mode, you can use the |TMacro| command instead of choosing from the + menu. This command takes the macro file name as an argument. When + called without arguments (preferred usage), then a list of available + macro files is displayed and the user is prompted to choose one of + them). + </p><p> + There are some other tools provided in this menu, namely: + </p><div class="informaltable"><table border="0"><colgroup><col width="0.5in"></col><col width="0.5in"></col></colgroup><tbody><tr><td>{New}</td><td> + Creates a new (unnamed) buffer in the + latex-suite/macros/ directory. Use the command + :TexMacroNew in non-gui mode. + </td></tr><tr><td>{Edit}</td><td> + Opens up the corresponding macro file for editing. Use + |:TexMacroEdit| in non-gui mode. When you try to edit {macro} + not from local directory Latex-Suite will copy it to your local + directory with suffix "-local". If local copy already exists + Latex-Suite prompt for overwriting it. + </td></tr><tr><td>{Delete}</td><td> + Deletes the corresponding macro. Use the prefixed numbers for + fast navigation of menus. Use |:TexMacroDelete| in non-gui mode. + When you choose to delete {macro} which is not in your local + directory Latex-Suite will refuse to delete it. + </td></tr><tr><td>{Redraw}</td><td> + Rescans the macros/ directories and refreshes the macros list. + </td></tr></tbody></table></div></div><div class="section" title="3.12 Making your own Macros via IMAP()"><div class="titlepage"><div><div><h3 class="title"><a id="ls-new-macros"></a>3.12 Making your own Macros via <code class="literal">IMAP()</code></h3></div></div></div><p> + If you find the need to create your own macros, then you can use the + <code class="literal">IMAP()</code> function provided with Latex-Suite. See <a class="link" href="#why-IMAP" title="3.12.1 Why use IMAP()">Why use <code class="literal">IMAP()</code></a> for a short + explanation of why you might prefer <code class="literal">IMAP()</code> over + Vim's standard <code class="literal">:imap</code> command. An example best + explains the usage: + </p><pre class="programlisting">:call IMAP('NOM', '\nomenclature{&lt;++&gt;}&lt;++&gt;', 'tex')</pre><p> + This will create a Latex-Suite-style mapping, where if you type + <code class="literal">NOM</code> in insert mode, you will get + <code class="literal">\nomenclature{&lt;++&gt;}&lt;++&gt;</code> with the cursor left in + place of the first <code class="literal">&lt;++&gt;</code> characters. See <a class="link" href="#ls-imaps-syntax" title="3.12.2 IMAP() syntax">IMAP() syntax</a> for + a detailed explanation of the <code class="literal">IMAP()</code> command. + </p><p> + For maps which are triggered for a given filetype, the + <code class="literal">IMAP()</code> command above should be put in the filetype + plugin script for that file. For example, for tex-specific mappings, + the <code class="literal">IMAP()</code> calls should go in + <code class="literal">$VIM/ftplugin/tex.vim</code>. For globally visible maps, + you will need to use the following in either your + <code class="literal">~/.vimrc</code> or a file in your + <code class="literal">$VIM/plugin</code> directory. + </p><pre class="programlisting">augroup MyIMAPs + au! + au VimEnter * call IMAP('Foo', 'foo', '') +augroup END</pre><p> + </p><div class="section" title="3.12.1 Why use IMAP()"><div class="titlepage"><div><div><h4 class="title"><a id="why-IMAP"></a>3.12.1 Why use <code class="literal">IMAP()</code></h4></div></div></div><p> + Using <code class="literal">IMAP</code> instead of Vim's built-in + <code class="literal">:imap</code> command has a couple of advantages: + </p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"> + The 'ttimeout' option will generally limit how easily you can type + the left hand side for a normal <code class="literal">:imap</code>. if you type + the left hand side too slowly, then the mapping will not be + activated. + </li><li class="listitem"> + If you mistype one of the letters of the lhs, then the mapping is + deactivated as soon as you backspace to correct the mistake. + </li><li class="listitem"> + The characters in lhs are shown on top of each other. This is fairly + distracting. This becomes a real annoyance when a lot of characters + initiate mappings. + </li></ol></div><p> + </p></div><div class="section" title="3.12.2 IMAP() syntax"><div class="titlepage"><div><div><h4 class="title"><a id="ls-imaps-syntax"></a>3.12.2 IMAP() syntax</h4></div></div></div><p> + Formally, the syntax which is used for the <code class="literal">IMAP</code> + function is: + </p><pre class="programlisting">call IMAP (lhs, rhs, ft [, phs, phe])</pre><p> + </p><p> + </p><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><thead><tr><th>Argument</th><th>Explanation</th></tr></thead><tbody><tr><td>lhs</td><td> + <p> + This is the "left-hand-side" of the mapping. When you use + <code class="literal">IMAP</code>, only the last character of this word is + actually mapped, although the effect is that the whole word is + mapped. + </p> + <p> + If you have two mappings which end in a common + <code class="literal">lhs</code>, then the mapping with the longer + <code class="literal">lhs</code> is used. For example, if you do + </p><pre class="programlisting">call IMAP('BarFoo', 'something', 'tex') +call IMAP('Foo', 'something else', 'tex')</pre><p> + Then typing <code class="literal">BarFoo</code> inserts + <code class="literal">"something"</code>, whereas <code class="literal">Foo</code> by + itself inserts <code class="literal">"something else"</code>. + </p> + <p> + Also, the nature of <code class="literal">IMAP()</code> makes creating + certain combination of mappings impossible. For example if you + have + </p><pre class="programlisting">call IMAP('foo', 'something', 'tex') +call IMAP('foobar', 'something else', 'tex')</pre><p> + Then you will never be able to trigger <code class="literal">"foobar"</code> + because typing <code class="literal">"foo"</code> will immediately insert + <code class="literal">"something"</code>. This is the "cost" which you incur + over the normal <code class="literal">:imap</code> command for the + convenience of no 'timeout' problems, the ability to correct + <code class="literal">lhs</code> etc. + </p> + </td></tr><tr><td>rhs</td><td> + <p> + The "right-hand-side" of the mapping. This is the expansion you + will get when you type <code class="literal">lhs</code>. + </p> + <p> + This string can also contain special characters such as + <code class="literal">&lt;enter&gt;</code> etc. To do this, you will need + to specify the second argument in double-quotes as follows: + </p><pre class="programlisting">:call IMAP('EFE', "\\begin{figure}\&lt;CR&gt;&lt;++&gt;\\end{figure}&lt;++&gt;", 'tex')</pre><p> + With this, typing <code class="literal">EFE</code> is equivalent to typing + in the right-hand side with all the special characters in + insert-mode. This has the advantage that if you have filetype + indentation set up, then the right hand side will also be + indented just as if you had typed it in normally. + </p> + <a id="IMAP_PutTextWithMovement"></a> + <p> + You can also set up a Latex-Suite style mapping which calls a custom function + as follows: + </p><pre class="programlisting">:call IMAP('FOO', "\&lt;C-r&gt;=MyFoonction()\&lt;CR&gt;", 'tex')</pre><p> + where <code class="literal">MyFoonction</code> is a custom function you have + written. If <code class="literal">MyFoonction</code> also has to return a string + containing <code class="literal">&lt;++&gt;</code> characters, then you will need to + use the function <code class="literal">IMAP_PutTextWithMovement()</code>. An + example best explains the usage: + </p> + <pre class="programlisting">call IMAP('FOO', "\&lt;C-r&gt;=AskVimFunc()\&lt;CR&gt;", 'vim') +" Askvimfunc: Asks For Function Name And Sets Up Template +" Description: +function! AskVimFunc() + let name = input('Name of the function : ') + if name == '' + let name = "&lt;+Function Name+&gt;" + end + let islocal = input('Is this function scriptlocal ? [y]/n : ', 'y') + if islocal == 'y' + let sidstr = '&lt;SID&gt;' + else + let sidstr = '' + endif + return IMAP_PutTextWithMovement( + \ "\" ".name.": &lt;+short description+&gt; \&lt;cr&gt;" . + \ "Description: &lt;+long description+&gt;\&lt;cr&gt;" . + \ "\&lt;C-u&gt;function! ".name."(&lt;+arguments+&gt;)&lt;++&gt;\&lt;cr&gt;" . + \ "&lt;+function body+&gt;\&lt;cr&gt;" . + \ "endfunction \" " + \ ) +endfunction</pre> + <p> + </p> + </td></tr><tr><td>ft</td><td> + <p> + The file type for which this mapping is active. When this string + is left empty, the mapping applies for all file-types. A filetype + specific mapping will always take precedence. + </p> + </td></tr><tr><td>phs, phe</td><td> + <p> + If you prefer to write the <code class="literal">rhs</code> with characters + other than <code class="literal">&lt;+</code> and <code class="literal">+&gt;</code> + to denote place-holders, you can use the last 2 arguments to + specify which characters in the <code class="literal">rhs</code> specify + place-holders. By default, these are <code class="literal">&lt;+</code> and + <code class="literal">+&gt;</code> respectively. + </p> + <p> + Note that the <code class="literal">phs</code> and <code class="literal">phe</code> + arguments do not control what characters will be displayed for + the placeholders when the mapping is actually triggered. What + characters are used to display place-holders when you trigger an + <code class="literal">IMAP</code> are controlled by the <a class="link" href="#Imap_PlaceHolderStart" title="11.2.2 g:Imap_PlaceHolderStart &amp; g:Imap_PlaceHolderEnd"><code class="literal">Imap_PlaceHolderStart</code></a> + and <a class="link" href="#Imap_PlaceHolderEnd"><code class="literal">Imap_PlaceHolderEnd</code></a> + settings. + </p> + </td></tr></tbody></table></div><p> + </p></div></div></div><div class="section" title="4 Package Handling"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="latex-packages"></a>4 Package Handling</h2></div></div></div><p> + Latex-Suite has a lot of functionality written to ease working with packages. + Packages here refers to files which you include into the LaTeX + document using the <code class="literal">\usepackage</code> command. + </p><div class="section" title="4.1 Inserting package commands"><div class="titlepage"><div><div><h3 class="title"><a id="inserting-packages"></a>4.1 Inserting package commands</h3></div></div></div><p> + When you first invoke Latex-Suite, it scans the + <code class="literal">$VIM/ftplugin/latex-suite/packages</code> directory for + package script files and creates a menu from all the files found there. + This menu is created under <code class="literal">TeX-Suite &gt; Packages &gt; + Supported</code>. This menu contains a list of packages "supported" + by Latex-Suite. When you choose one of the packages from this menu (for example + the <code class="literal">amsmath</code> package), then a line of + the form + </p><pre class="programlisting">\usepackage[&lt;++&gt;]{amsmath}&lt;++&gt;</pre><p> + will be inserted into the current file. + </p><p> + The <code class="literal">\usepackage</code> line can also be inserted in an easy + manner in the current file by pressing <code class="literal">&lt;F5&gt;</code> + while in the preamble of the current document. This will set up a prompt + from the supported packages and ask you to choose from one of them. If + you do not find the package you want to insert in the list, you can type + in a package-name and it will use that. Pressing + <code class="literal">&lt;F5&gt;</code> in the preamble on a line containing a + single word will construct a <code class="literal">\usepackage</code> line from + that word. + </p><p> + You can also use the <a class="link" href="#TPackage" title="10.2.5 :TPackage [{package, ...}]"><code class="literal">TPackage</code></a> to insert the + <code class="literal">\usepackage</code> line. + </p><p> + Once you have inserted a <code class="literal">\usepackage</code> line, for + supported packages, you can use the Options and Commands menus + described in the <a class="link" href="#package-actions" title="4.2 Actions taken for supported packages">next section</a>. + </p></div><div class="section" title="4.2 Actions taken for supported packages"><div class="titlepage"><div><div><h3 class="title"><a id="package-actions"></a>4.2 Actions taken for supported packages</h3></div></div></div><p> + Latex-Suite takes the following actions for packages detected when a file is + loaded, or a new <code class="literal">\usepackage</code> line is inserted using + one of the methods described in the <a class="link" href="#inserting-packages" title="4.1 Inserting package commands">previous section</a>. + </p><p> + If you are using the GUI and you have <a class="link" href="#Tex_Menus" title="11.8.1 g:Tex_Menus">g:Tex_Menus</a> set to 1, Latex-Suite will create the + following sub-menus + </p><table border="0" summary="Simple list" class="simplelist"><tr><td><code class="literal">TeX-Suite &gt; Packages &gt; &lt;package&gt; Options</code></td></tr><tr><td><code class="literal">TeX-Suite &gt; Packages &gt; &lt;package&gt; Commands</code></td></tr></table><p> + </p><p> + where <code class="literal">&lt;package&gt;</code> is the package you just + inserted (or was detected). You can use these menus to insert commands, + environments and options which Latex-Suite recognizes as belonging to this + package. + </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> + While inserting an option, you need to position yourself in the + appropriate place in the document, most commonly inside the square + braces in the <code class="literal">\usepackage[]{packname}</code> command. Latex-Suite + will not navigate to that location. + </p></div><p> + In addition to creating these sub-menus, Latex-Suite will also scan the + <code class="literal">$VIM/ftplugin/latex-suite/dictionaries</code> directory and + if a dictionary file corresponding to the package file is found, then + it will add the file to the <code class="literal">'dict'</code> setting in Vim + so you can use the <code class="literal">&lt;C-X&gt;&lt;C-K&gt;</code> command to + complete words from that file. + </p><p> + For example, the <code class="literal">SIUnits</code> package has a custom + dictionary. + </p><a id="latex-package-scanning"></a><p> + If a package detected at startup is found by Latex-Suite in the current + directory or in a location specified by the <a class="link" href="#Tex_TEXINPUTS" title="11.10.1 g:Tex_TEXINPUTS">g:Tex_TEXINPUTS</a> variable, Latex-Suite will + scan the package for <code class="literal">\newenvironment</code> and + <code class="literal">newcommand</code> lines and also append any commands and + environments found to the list of commands and environments which you + are prompted with when you press <a class="link" href="#inserting-env-f5" title="3.1.1.1 Method 1: Pressing &lt;F5&gt;"><code class="literal">&lt;F5&gt;</code></a> or <a class="link" href="#ls-imap-f7"><code class="literal">&lt;F7&gt;</code></a> in insert + mode. + </p></div><p> + In addition, the <code class="literal">TeX-Suite &gt; Packages</code> menu also + contains the following submenus + </p><p title="Update"><b>Update. </b> + This command is to be invoked with the cursor placed on the package + name. If the corresponding package is found, then a sub-menu with the + supported commands and options is created. + </p><p title="Update All"><b>Update All. </b> + This function reads the preamble of the document for + <code class="literal">\usepackage</code> lines and if Latex-Suite supports the detected + packages, then sub-menus containing the package options and commands + are created. + </p><div class="section" title="4.3 Automatic Package detection"><div class="titlepage"><div><div><h3 class="title"><a id="automatic-package-detection"></a>4.3 Automatic Package detection</h3></div></div></div><p> + Whenever Latex-Suite begins editing a new LaTeX file, it scans it for + <code class="literal">\usepackage{name}</code> lines, and if a supported package + is found, then it will create sub-menus and add to the + <code class="literal">'dict'</code> setting as described above. + </p><p> + If a <a class="link" href="#latex-master-file" title="9.2 Specifying which file to compile">master-file</a> has been specified, + then it will scan that file instead of the current file. See the section + <a class="link" href="#custom-packages" title="4.3.1 Custom Packages">Custom Packages</a> + to see which files Latex-Suite will scan in more detail. + </p><p> + For all the packages detected in this manner, Latex-Suite will take certain + actions as described in the section <a class="link" href="#package-actions" title="4.2 Actions taken for supported packages">package support.</a>. + </p><div class="section" title="4.3.1 Custom Packages"><div class="titlepage"><div><div><h4 class="title"><a id="custom-packages"></a>4.3.1 Custom Packages</h4></div></div></div><p> + Often times, the preamble can become too long, and some people prefer + to put most of their personalization in a custom package and include + that using a <code class="literal">\usepackage</code> line. Latex-Suite tries to search + such customs package for other <code class="literal">\usepackage</code> lines, so + that supported packages included in this indirect manner can also be + used to create sub-menus, extend the <code class="literal">'dict'</code> setting + etc. The most obvious place to place such custom packages is in the + same directory as the edited file. In addition, LaTeX also supports + placing custom packages in places pointed to by the + <code class="literal">$TEXINPUTS</code> environment variable. + </p><p> + If you use the <code class="literal">$TEXINPUTS</code> variable in LaTeX, and + you wish Latex-Suite to search these custom packages for + <code class="literal">\usepackage</code> lines, then you need to initialize the + <a class="link" href="#Tex_TEXINPUTS" title="11.10.1 g:Tex_TEXINPUTS"><code class="literal">g:Tex_TEXINPUTS</code></a> + variable. + </p><p> + The <code class="literal">g:Tex_TEXINPUTS</code> variable needs to be set in the + same format which Vim uses for the <code class="literal">'path'</code> setting. + This format is explained in detail if you do + </p><pre class="programlisting">:help file-searching</pre><p> + from within Vim. + </p><p> + Therefore the value of <code class="literal">g:Tex_TEXINPUTS</code> will most + probably be different from <code class="literal">$TEXINPUTS</code> which your + native LaTeX distribution uses. + </p><p> + Example: + </p><pre class="programlisting">let g:Tex_TEXINPUTS = '~/texmf/mypackages/**,./**'</pre><p> + The <code class="literal">**</code> indicates that all directories below the + directory <code class="literal">~/texmf/mypackages</code> and + <code class="literal">./</code> are to be scanned for custom packages. + </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> + The present directory <code class="literal">'.'</code> is always searched. You + need not include that in <code class="literal">g:Tex_TEXINPUTS</code>. + </p></div></div></div><div class="section" title="4.4 Writing supporting for a package"><div class="titlepage"><div><div><h3 class="title"><a id="supporting-packages"></a>4.4 Writing supporting for a package</h3></div></div></div><p> + Supporting a package is easy and consists of writing a vim script with + the same name as the package and placing it in the + <code class="literal">$VIM/ftplugin/latex-suite/packages</code> directory. A + package script should define two variables as described in the next two + sections. In addition to these two variables, you can also define any + functions, environment definitions etc. in this file. + </p><div class="section" title="4.4.1 g:Tex_package_option_&lt;package&gt;"><div class="titlepage"><div><div><h4 class="title"><a id="id474080"></a>4.4.1 <code class="literal">g:Tex_package_option_&lt;package&gt;</code></h4></div></div></div><p> + This setting is a string containing a comma separated list of options + supported by this package. + </p><p> + Example: + </p><pre class="programlisting">g:Tex_package_option_mypack = 'opt1,opt2=,sbr:group1,opt3,opt4'</pre><p> + The <code class="literal">=</code> suffix means that the option takes a value. + Use <code class="literal">sbr:group name</code> to separate options into + sub-menus. All successive options will be clubbed into the + <code class="literal">group1</code> sub-menu till the next + <code class="literal">sbr:</code> option is encountered. + </p></div><div class="section" title="4.4.2 g:Tex_package_&lt;package&gt;"><div class="titlepage"><div><div><h4 class="title"><a id="id474125"></a>4.4.2 <code class="literal">g:Tex_package_&lt;package&gt;</code></h4></div></div></div><pre class="programlisting"> + g:TeX_package_&lt;package&gt; = "pre:Command,pre:Command1" +More detailed example is in latex-suite/packages/exmpl file (slightly +outdated). +Here is short summary of prefixes which can be used in package files: +(x - place with cursor, &lt;++&gt; - |placeholder|) + +{env:command} Environment: creates simple environment template + \begin{command} + x + \end{command}&lt;++&gt; +{eno:command} Environment with option: + \begin[x]{command} + &lt;++&gt; + \end{command}&lt;++&gt; +{ens:command[&lt;&lt;option&gt;&gt;]...} Environment special: + \begin[&lt;&lt;option&gt;&gt;]...{command} + &lt;++&gt; + \end{command}&lt;++&gt; +{bra:command} Brackets: + \command{x}&lt;++&gt; +{brd:command} Brackets double: + \command{x}{&lt;++&gt;}&lt;++&gt; +{brs:command[&lt;&lt;option&gt;&gt;]...} Brackets special (as environment special: + \command[&lt;+x+&gt;]{&lt;++&gt;}{&lt;++&gt;}&lt;++&gt; +{nor:command} Normal: + \command&lt;Space +{noo:command} Normal with option: + \command[x]&lt;++&gt; +{nob:command} Normal with option and brackets: + \command[x]{&lt;++&gt;}&lt;++&gt; +{pla:command} Plain: + command&lt;Space +{spe:command} Special: + command &lt;-literal insertion of command +{sep:command} creates separator. Good for aesthetics and usability :) +{sbr:command} Breaks menu into submenus. &lt;command&gt; will be title of submenu. + Can be used also in package variable. + +Command can be also given without prefix:. The result is + \command + </pre></div></div></div><div class="section" title="5 Latex Completion"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="latex-completion"></a>5 Latex Completion</h2></div></div></div><p> + Latex-Suite provides an easy way to insert references to labels and + bibliographic entries and also provide filename arguments to commands + such as <code class="literal">\includegraphics</code>. Although the completion + capabilities are very diverse, Latex-Suite only uses a single key + (<code class="literal">&lt;F9&gt;</code> by default) to do all of it. Pressing the + <code class="literal">&lt;F9&gt;</code> key does different things based on where + you are located. Latex-Suite tries to guess what you might be trying to + complete at the location where you pressed + <code class="literal">&lt;F9&gt;</code>. For example, pressing + <code class="literal">&lt;F9&gt;</code> when you are within a + <code class="literal">\ref</code> command will try to list the + <code class="literal">\label</code>'s in the present directory. Pressing it when + you are in a <code class="literal">\cite</code> command will list bibliography + keys. Latex-Suite also recognizes commands which need a file name argument and + will put up an explorer window for you to choose a filename. + </p><div class="note" title="Before you start with Latex-Suite's completion function..." style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title"><a id="ls-set-grepprg"></a>Before you start with Latex-Suite's completion function...</h3><p> + All of Latex-Suite's completion capabilities depend on a external program + being available on your system which can search through a number of + files for a reg-exp pattern. On *nix systems, the pre-installed + <code class="literal">grep</code> utility is more than adequate. Most windows + systems come with a utility <code class="literal">findstr</code>, but that has + proven to be very inadequate (for one, it does not have an option to + force the file name to be displayed when searching through a single + file). Your best bet is to install <a class="ulink" href="http://www.cygwin.com" target="_top">cygwin</a>, but if you think that's + overkill, you can <a class="ulink" href="http://www.google.com/search?q=windows%20gnu%20grep" target="_top">search + for</a> a windows implementation of GNU grep. (Latex-Suite testing on + windows has been done with cygwin's port of GNU grep). + </p><p> + Once you have a <code class="literal">grep</code> program installed, you need to + set the <code class="literal">'grepprg'</code> option for vim. Make sure you use a + setting which forces the program to display file names even when you are + searching through a single file. For GNU grep, the syntax is + </p><pre class="programlisting">set grepprg=grep\ -nH\ $*</pre><p> + </p></div><div class="section" title="5.1 Latex-Suite completion example"><div class="titlepage"><div><div><h3 class="title"><a id="ls-completion-usage"></a>5.1 Latex-Suite completion example</h3></div></div></div><p> + Consider the situation where you are editing a file with two equations + labelled <code class="literal">eqn:euler</code> and <code class="literal">eqn:einstein</code>. + Now you want to insert a reference to one of these equations. To do this, + you type the <code class="literal">\ref{eqn:}</code> command and with the cursor + placed after <code class="literal">eqn:</code>, press <code class="literal">&lt;F9&gt;</code>. + This will bring up two new windows beneath the main window you were working + in as shown in the figure below. + </p><pre class="programlisting"> + 8 These are a couple of equations: + 9 +-- 4 lines: eqnarray (eqn:euler) : e^{j\pi} + 1 &amp;=&amp; 0--------------- + 13 +-- 4 lines: equation (eqn:einstein) : E = m c^2--------------------- + 17 + 18 These are a couple of figures: + 19 +-- 7 lines: figure (fig:monkeys) : Monkeys can Type------------------- + 26 +-- 7 lines: figure (fig:shakespeare) : Shakespeare could not type----- + 33 + 34 This is a reference to \ref{eqn:}&lt;++&gt; + 35 + 36 + 37 \end{document} + 38 +~ +~ +~ +newfile.tex 34,32 Bot +newfile.tex|11| \label{eqn:euler} +newfile.tex|15| \label{eqn:einstein} +~ +[Error List] 1,1 All + 7 + 8 These are a couple of equations: + 9 \begin{eqnarray} + 10 e^{j\pi} + 1 &amp;=&amp; 0 + 11 \label{eqn:euler} + 12 \end{eqnarray} + 13 \begin{equation} + 14 E = m c^2 + 15 \label{eqn:einstein} + 16 \end{equation} +newfile.tex [Preview] 11,3 21% + </pre><p> + </p><p> + The first window (shown as <code class="literal">[Error List]</code> above) is a + <code class="literal">|cwindow|</code> containing a list of possible matches for the + reference. The cursor will be located in the first line of this window. The + bottom window is a <code class="literal">preview-window</code> showing the context of + the <code class="literal">\label</code>. Moving around in the + <code class="literal">[Error List]</code> window automatically scrolls the + preview window so as to always keep showing the context of the + <code class="literal">\label</code> being viewed in the + <code class="literal">[Error List]</code> window. You can also press + <code class="literal">J</code> and <code class="literal">K</code> in the + <code class="literal">[ErrorList]</code> window to scroll the preview window up and + down. + </p><p> + To insert one of the labels, simply position the cursor in the correct line + in the <code class="literal">[Error List]</code> window and press + <code class="literal">&lt;enter&gt;</code>. This will immediately close the two newly + opened windows, get back to the correct location in the original file being + edited and insert the label into the <code class="literal">\ref</code> command. + </p><p> + If you notice carefully in the example above, the + <code class="literal">[Error List]</code> window only showed the matches for the + equations and did not list any of the figure labels. This is because we + pressed <code class="literal">&lt;F9&gt;</code> after <code class="literal">\ref{eqn:</code> + instead of simply after <code class="literal">\ref{</code>. This caused Latex-Suite to + search only for those labels which started with the string + <code class="literal">eqn:</code>. If you had pressed + <code class="literal">&lt;F9&gt;</code> after a <code class="literal">\ref{</code>, you would + have been shown matches from <span class="emphasis"><em>all</em></span> labels, not just + those starting with <code class="literal">eqn:</code>. + </p><p> + Thus prefixing all your labels with <code class="literal">eqn:</code>, + <code class="literal">fig:</code>, <code class="literal">tab:</code> etc. depending on what you + are labelling will lead to an easier time completing references. + </p></div><div class="section" title="5.2 Latex-Suite \ref completion"><div class="titlepage"><div><div><h3 class="title"><a id="ls-completion-ref"></a>5.2 Latex-Suite \ref completion</h3></div></div></div><p> + Pressing <code class="literal">&lt;F9&gt;</code> when you are within a partially + completed <code class="literal">\ref</code> command will split open a window + (named <code class="literal">__OUTLINE__</code>) which contains a nicely + formatted list of all the <code class="literal">\label</code>s found in the + present project. The <code class="literal">\label</code>s are heirarchically + arranged according to which <code class="literal">\section</code>, + <code class="literal">\subsection</code> etc of the overall document structure + they are present in. For example, when you first press + <code class="literal">&lt;F9&gt;</code> after typing <code class="literal">\ref{</code>, + you should see something like: + </p><pre class="programlisting"> ++-- 54 lines: 2. Kinematics-------------------------------- ++-- 98 lines: 3. Aerodynamics of the MFI thorax------------ ++-- 40 lines: 4. Jump Resonance in Fourbar Mechanisms------ ++-- 28 lines: 5. Design and Fabrication Issues------------- + </pre><p> + Each chapter is |fold|ed away so that you can quickly jump to the + correct section/subsection in which the relevant equation is defined. + This makes inserting references significantly faster for large projects + with hundreds of equations. You can then open some of the folds to see + for example: + </p><pre class="programlisting"> ++-- 54 lines: 2. Kinematics-------------------------------- +3. Aerodynamics of the MFI thorax + 3.1. Aerodynamic modeling of the MFI wing forces + 3.1.1. Geometric Specification + eqn:wingnormal-pos + \nhat = T_z(\theta_2) T_y(\theta_y)T_x(\theta_x)\nhat_0, + eqn:T-1 + T_1(\theta_2) &amp;=&amp; T_z(\theta_2) + </pre><p> + The <code class="literal">&lt;Tab&gt;</code> key is mapped in this window to + toggle folds so that you can quickly open/close folds in order to + navigate the heirarchy faster. Once you are positioned on a + label, press <code class="literal">&lt;Enter&gt;</code>. This closes the + <code class="literal">__OUTLINE__</code> window, returns to the window in which + you pressed <code class="literal">&lt;F9&gt;</code> and inserts the reference + at the current cursor position. + </p><div class="note" title="Filtering labels by prefix" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Filtering labels by prefix</h3><p> + You can press <code class="literal">&lt;F9&gt;</code> after typing part of the + <code class="literal">\label</code>. In this case, Latex-Suite only presents + <code class="literal">\label</code>s which begin with the already filled + characters. You can use this to choose between equations, figures, + tables etc. if you consistently label equations to begin with + <code class="literal">eqn:</code>, figures to begin with <code class="literal">fig:</code> + etc. For example, with this scheme, pressing + <code class="literal">&lt;F9&gt;</code> after typing + <code class="literal">\ref{eqn:</code> will only list equations. + </p></div><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> + Latex-Suite works the same way if you press <code class="literal">&lt;F9&gt;</code> + after any command which contains the letters <code class="literal">ref</code>. + Thus you can complete <code class="literal">\eqref</code> in exactly the same + manner. + </p></div><div class="note" title="Requirements" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Requirements</h3><p> + This method of preseting the <code class="literal">\label</code>s depends on Vim + being compiled with python support. To check if you have this, see the + output of the <code class="literal">:ver</code> command. If you see something + like <code class="literal">+python</code>, you are all set. Failing this, you + will need to have <code class="literal">python</code> somewhere in your + <code class="literal">$PATH</code>. + </p></div></div><div class="section" title="5.3 Latex-Suite \cite completion"><div class="titlepage"><div><div><h3 class="title"><a id="latex-completion-cite"></a>5.3 Latex-Suite <code class="literal">\cite</code> completion</h3></div></div></div><p> + Latex-Suite provides an easy way to insert references to bibliographic + entries. Pressing <code class="literal">&lt;F9&gt;</code> when the cursor is + placed inside a partially completed <code class="literal">\cite</code> command + will split open a new window (named <code class="literal">__OUTLINE__</code>) + which contains a formatted and syntax highlighted list of all bibtex + entries found. For example, pressing <code class="literal">&lt;F9&gt;</code> + after typing <code class="literal">\ref{</code> should present you with a window + which looks something like this: + </p><pre class="programlisting"> +Article [dickinson:science:99] + "Wing rotation and aerodynamic basis of insect flight" + M. H. Dickinson and F-O. Lehman and S. P. Sane + In Science, 1999 + +Article [ellington:84:part1] + "The Aerodynamics of Hovering Insect Flight. I. The Quasi-Steady Analysis" + Ellington, C P + In Philosophical Transactions of the Royal Society of London. Series B, Biological Sciences, 1984 + +Article [ellington:84:part2] + "The Aerodynamics of Hovering Insect Flight. II. Morphological Parameters" + Ellington, C P + In Philosophical Transactions of the Royal Society of London. Series B, Biological Sciences, 1984 + </pre><p> + </p><p> + You can easily jump from one entry to another using the + <code class="literal">'n'</code> and <code class="literal">'p'</code> keys (to go to the + next / previous entry respectively). + </p><p> + You can also filter out a subset of the bibtex entries by pressing + <code class="literal">'f'</code> while in this window. Doing this presents the + following prompt: + </p><pre class="programlisting"> +Field acronyms: (`:let g:Tex_EchoBibFields = 0` to avoid this message) + [t] title [a] author [b] booktitle + [j] journal [y] year [p] bibtype + (you can also enter the complete field name) +Enter filter criterion [field&lt;space&gt;value]: + </pre><p> + At the prompt, type + </p><pre class="programlisting">a ellington</pre><p> + Notice that the letter a is an acronym for <code class="literal">author</code> + according to the prompt above. Therefore this filter only shows those + bibtex entries whose author field contains the text + <code class="literal">ellington</code>. You can keep narrowing your selection by + repeatedly filtering the results. If you would like to remove all the + filters and see all entries again, press 'a', which removes + all the filters. + </p><p> + You can also sort the bibtex entries based on a field. To do this, + press 's'. This will present you with a prompt like in the case of the + filter and you are asked to choose a field. In this case, you would + type in a single character. This sorts the entries according to that + field. + </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> + <code class="literal">&lt;F9&gt;</code> will also work in a similar way after any + command which contains the word <code class="literal">cite</code> in it. For + example, pressing <code class="literal">&lt;F9&gt;</code> will also work with + <code class="literal">\citenum</code> etc. + </p></div><p> + The following logic is applied to find out which bibliographic entries + are included in the completion. + </p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p> + Firstly, if the present file has a <a class="link" href="#latex-master-file" title="9.2 Specifying which file to compile">master-file</a> defined for it, then Latex-Suite + will perform the following steps on that file instead of on the + current file. + </p></li><li class="listitem"><p> + First, the file is scanned for a <code class="literal">\bibliography</code> + command. To explain better, assume that a command + </p><pre class="programlisting">\bibliography{file1,file2}</pre><p> is found + in the present file. For each bibliography file, say + <code class="literal">file1</code>, Latex-Suite first tries to see if a + <code class="literal">.bib</code> file, <code class="literal">file1.bib</code> can be + found. If so, it will scan it for bib-keys of the form + <code class="literal">@BOOK{</code> etc., and add these searches to the + completion list. If a <code class="literal">.bib</code> file cannot be found, + then it will try to see if <code class="literal">file1.bbl</code> can be found. + If so, Latex-Suite will search it for bib-keys of the form + <code class="literal">\bibitem</code> and add these to the completion list. + </p><p> + You can set the location where Latex-Suite will search for + <code class="literal">.bib</code> and <code class="literal">.bbl</code> files using the + <a class="link" href="#Tex_BIBINPUTS" title="11.5.2 g:Tex_BIBINPUTS"><code class="literal">|Tex_BIBINPUTS|</code></a> + variable. + </p></li><li class="listitem"><p> + If a <code class="literal">\bibliography</code> command is not found, then Latex-Suite + tries to scan the present file for a + <code class="literal">\begin{thebibliography}</code> environment. If found, + Latex-Suite searches the present file for bib-keys of the form + <code class="literal">\bibitem</code>. + </p></li><li class="listitem"><p> + Finally, it will try to see if this file includes other files + via the <code class="literal">\input</code> command. For each such file found, + Latex-Suite will repeat the previous two steps stopping at the first file + which has either a <code class="literal">\bibliography</code> command or a + <code class="literal">thebibliography</code> environment. + </p></li></ol></div><div class="section" title="5.3.1 Caching the \cite completion results"><div class="titlepage"><div><div><h4 class="title"><a id="cite-search-caching"></a>5.3.1 Caching the <code class="literal">\cite</code> completion results</h4></div></div></div><a id="TClearCiteHist"></a><p> + Often times, the editing cycle proceeds by first laying out a + comprehensive bibliography and then completing all the + <code class="literal">\cite</code> commands in one session. In such situations, + it is inefficient to scan the whole list of bibliography files for + bib-keys each time. Latex-Suite provides a way to cache the results of the + cite completion search using the <a class="link" href="#Tex_RememberCiteSearch" title="11.5.5 g:Tex_RememberCiteSearch"><code class="literal">Tex_RememberCiteSearch</code></a> + variable. If set, Latex-Suite will perform the search only the first time + <code class="literal">&lt;F9&gt;</code> is used. Next time on, it will reuse the + search results. If you wish to redo the search results, issue the + command + </p><pre class="programlisting">TClearCiteHist</pre><p> + This will redo the completion list next time you use + <code class="literal">&lt;F9&gt;</code>. + </p></div></div><div class="section" title="5.4 Latex-Suite filename completion"><div class="titlepage"><div><div><h3 class="title"><a id="ls-filename-completion"></a>5.4 Latex-Suite filename completion</h3></div></div></div><p> + When you press <code class="literal">&lt;F9&gt;</code> at a location where Latex-Suite + guesses a filename needs to be typed, then a new explorer window will + open up with the list of files. You can use this window to change + directories etc. Pressing <code class="literal">&lt;enter&gt;</code> on a filename + in the explorer window will automatically close the explorer window, + return to the location where you pressed <code class="literal">&lt;F9&gt;</code> + from and insert the filename into that position. + </p><p> + Latex-Suite also tries to guess what kinds of files you might not want to + insert and hides those accordingly. For example, if you press + <code class="literal">&lt;F9&gt;</code> when you are located at + <code class="literal">\includegraphics{</code>, then Latex-Suite knows that you will not + want to insert <code class="literal">.tex</code> files. Therefore, the explorer + window will automatically hide these files. + </p><p> + As of now, Latex-Suite recognizes the following commands for filename + completion. Along with the commands, this table also lists the + files which Latex-Suite will not show for completing each command. + </p><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><thead><tr><th>command</th><th>hide pattern</th></tr></thead><tbody><tr><td><code class="literal">\bibliography</code></td><td><code class="literal">'^\.,\.[^b]..$'</code></td></tr><tr><td><code class="literal">\include</code> <code class="literal">\includeonly</code></td><td><code class="literal">'^\.,\.[^t]..$'</code></td></tr><tr><td><code class="literal">\includegraphics</code> <code class="literal">\psfig</code></td><td><code class="literal">'^\.,\.tex$,\.bib$,\.bbl$,\.zip$,\.gz$'</code></td></tr><tr><td><code class="literal">\input</code></td><td><code class="literal">''</code></td></tr></tbody></table></div></div><div class="section" title="5.5 Custom command completion"><div class="titlepage"><div><div><h3 class="title"><a id="ls-completion-custom"></a>5.5 Custom command completion</h3></div></div></div><p> + Latex-Suite also recognizes certain commonly used LaTeX commands for the + <code class="literal">&lt;F9&gt;</code> key. At the moment, the + <code class="literal">\bibliographystyle</code>, <code class="literal">\addtocontents</code> + and the <code class="literal">\addcontentsline</code> commands are recognized, + although more will be added in the future. When you press the + <code class="literal">&lt;F9&gt;</code> after such a command, Latex-Suite will prompt + you with a list of arguments which make sense for the command. + </p><p> + This functionality is available for commands for which a global + variable of the form + <code class="literal">g:Tex_completion_{&lt;command&gt;}</code> is defined where + <code class="literal">&lt;command&gt;</code> is the command name. This variable + is a comma separated list of values which this command takes. For + example, the argument to the <code class="literal">\bibliographystyle</code> + command is commonly one of <code class="literal">abbr,alpha,plain,unsrt</code>. + Therefore, Latex-Suite defines + </p><pre class="programlisting">let g:Tex_completion_bibliographystyle = 'abbr,alpha,plain,unsrt'</pre><p> + You can define your own completion variables in a similar manner for + commands which you might use. + </p></div></div><div class="section" title="6 LaTeX Compiling"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="latex-compiling"></a>6 LaTeX Compiling</h2></div></div></div><p> + This functionality, available via the TeX-Suite menu, provides various tools + to compile and debug LaTeX files from within Vim. + </p><p> + If you are using commonly used LaTeX tools, then you should be all set + as soon as you download and install Latex-Suite. In order to compile a + LaTeX file, simply press <code class="literal">\ll</code> while editing the file. + This runs latex on the current file and displays the errors in a + |quickfix-window| below the file being edited. You can then scroll + through the errors and press <code class="literal">&lt;enter&gt;</code> to be + taken to the location of the corresponding error. Along with the errors + being listed in the quickfix window, the corresponding log file is also + opened in |preview| mode beneath the quickfix window. It is scrolled + automatically to keep in sync with the error being viewed in the + quickfix window. You will be automatically taken to the location of the + first error/warning unless you set the <a class="link" href="#Tex_GotoError" title="11.6.8 g:Tex_GotoError">g:Tex_GotoError</a> variable to 0. + </p><p> + Latex-Suite also supports compiling LaTeX into formats other than DVI. By + default, Latex-Suite supports PDF and PS formats. In order to choose a format + other than DVI, use the <code class="literal">TTarget</code> command or the + <code class="literal">TeX-Suite &gt; Target Format</code> menu item. This will ask you + to type in the name of the target format you want to compile to. If a rule + has been defined for the format (as described in the next + <a class="link" href="#compiler-rules" title="6.1 Setting Compilation rules">section</a>), then Latex-Suite will switch to + that format. + </p><p>Trying to choose a format for which no rule has been defined will + result in Latex-Suite displaying a warning message without taking any action. + </p><p> + If you are using a multiple file project and need to compile a master + file while editing other files, then Latex-Suite provides a way to specify the + file to be compiled as described in <a class="link" href="#latex-master-file" title="9.2 Specifying which file to compile">latex-master-file</a>. + </p><div class="section" title="6.1 Setting Compilation rules"><div class="titlepage"><div><div><h3 class="title"><a id="compiler-rules"></a>6.1 Setting Compilation rules</h3></div></div></div><p> + In order to compile LaTeX files into various formats, Latex-Suite needs to know + which external programs to call and in which way they need to be called. + This information is provided to Latex-Suite via a number of "rules". For each + format you want to compile to, you need to specify a rule. A rule is + specified by defining a variable of the form: + </p><pre class="programlisting">g:Tex_CompileRule_&lt;format&gt;</pre><p> + where <code class="literal">&lt;format&gt;</code> is a string like + <code class="literal">"pdf"</code>, <code class="literal">"dvi"</code> etc. + </p><p> + Example: By default, Latex-Suite uses the following rule for compiling LaTeX + documents into DVI. + </p><pre class="programlisting">g:Tex_CompileRule_dvi = 'latex --interaction=nonstopmode $*'</pre><p> + </p><p> + Default values are also provided for ps and pdf formats. You might want to + change these rules in texrc according to your local tex environment. + </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> + For win32 users user MikTeX, sometimes the latex compiler's output has a + bug where a single number is split across different lines. In this case, + put the included <code class="literal">vim-latex</code> file distributed with Latex-Suite. + </p></div></div><div class="section" title="6.2 Handling dependencies in compilation"><div class="titlepage"><div><div><h3 class="title"><a id="compiler-dependency"></a>6.2 Handling dependencies in compilation</h3></div></div></div><p> + Latex-Suite also handles compiling dependencies automatically via certain + rules which specify the "dependency chain" for each target format. + For example, if in your case, you use + </p><pre class="programlisting">.tex -&gt; .dvi -&gt; .ps -&gt; .pdf</pre><p> + to generate <code class="literal">pdf</code> files from <code class="literal">dvi</code> + files, then you will need to specify the following setting in your + Latex-Suite configuration (see <a class="link" href="#customizing-latex-suite" title="11 Customizing Latex-Suite">customizing Latex-Suite</a> for where + these settings should go): + </p><pre class="programlisting"> +let g:Tex_FormatDependency_pdf = 'dvi,ps,pdf' +</pre><p> + This is a comma separated string of formats specifying the order in + which the formats to be compiled into should be chosen. With this + setting, if you set the target format to <code class="literal">pdf</code>, then + the next time you compile via the <code class="literal">\ll</code> shortcut, Latex-Suite + will first generate a <code class="literal">dvi</code> file, then use that to + generate the <code class="literal">ps</code> file and finally create the + <code class="literal">pdf</code> file from that. + </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> + If any of the intermediate formats is listed in the + <code class="literal">g:Tex_MultipleCompileFormats</code> setting as described + in the section <a class="link" href="#compiling-multiple" title="6.3 Compiling multiple times">Compiling multiple + times</a>, then Latex-Suite might make multiple calls to the compiler to + generate the output file of that format. + </p></div><p> + Along with the <code class="literal">g:Tex_FormatDependency_{format}</code> + setting, you should ofcourse specify the rule for compiling to each of + the formats as described in the <a class="link" href="#compiler-rules" title="6.1 Setting Compilation rules">previous + section</a>. For example, with the setting above, you could use: + </p><pre class="programlisting"> +let g:Tex_CompileRule_dvi = 'latex --interaction=nonstopmode $*' +let g:Tex_CompileRule_ps = 'dvips -Ppdf -o $*.ps $*.dvi' +let g:Tex_CompileRule_pdf = 'ps2pdf $*.ps'</pre><p> + </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> + By default, Latex-Suite does not specify any compiler dependencies. Each + target format for which a rule has been derived will be compiled + independently. + </p></div></div><div class="section" title="6.3 Compiling multiple times"><div class="titlepage"><div><div><h3 class="title"><a id="compiling-multiple"></a>6.3 Compiling multiple times</h3></div></div></div><p> + Most LaTeX compilers need to be re-run several times in several + commonly occurring situations in order to get a final camera ready copy. + For example, when <code class="literal">\label</code>'s change, when new + <code class="literal">\cite</code> commands are added etc. If the target format + you are compiling to requires multiple compilations, then you will + need to include the format in the + <code class="literal">g:Tex_MultipleCompileFormats</code> setting. This is a + comma separated string of formats which need multiple compilations to + be generated correctly. + </p><p> + By default, this setting contains just the <code class="literal">dvi</code> + format. If you use the <code class="literal">pdflatex</code> compiler to generate + <code class="literal">pdf</code> files, then you might want to also include + <code class="literal">pdf</code> into the above setting. + </p><p> + For every format included in the + <code class="literal">g:Tex_MultipleCompileFormats</code> setting described + above, Latex-Suite will use the following logic to generate the file. Note + that although the following description uses <code class="literal">latex</code> + to refer to the compiler, it could be some other compiler such as + <code class="literal">pdflatex</code> for generating <code class="literal">pdf</code> + output. + </p><p> + </p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">If there was a <code class="literal">.idx</code> file, then remember + its contents.</li><li class="listitem">Run <code class="literal">latex</code>.</li><li class="listitem">If the <code class="literal">.idx</code> file changed due to the latex + compiler, then run <code class="literal">makeindex</code> to redo the + <code class="literal">.ind</code> file and then remember to rerun latex. + </li><li class="listitem"><p> + If the <code class="literal">.aux</code> file generated by the latex + compiler contains a <code class="literal">\bibdata</code> line, then it + means that we are using a <code class="literal">.bib</code> file. Therefore, + run <code class="literal">bibtex</code>. + </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> + This means that we will always run <code class="literal">bibtex</code> + whenever we use the <code class="literal">\bibliography</code> command + whether or not we actually need to. At this time, Latex-Suite does not + parse the <code class="literal">.aux</code> file before and after the latex + compiler to see if we are required to rerun + <code class="literal">bibtex</code>. + </p></div></li><li class="listitem"> + If the <code class="literal">.bbl</code> file changes because of this, then + remember to rerun latex again. + </li><li class="listitem">Also, we check to see if the LaTeX compiler gives certain + standard warnings which notify that we need to compile once again. In + this case also, remember to rerun LaTeX.</li><li class="listitem">If we found we had to rerun latex, then we repeat + the steps above but not running <code class="literal">makeindex</code> or + <code class="literal">bibtex</code> again.</li></ol></div><p> + </p><p> + The LaTeX file is compiled atmost 5 times using this logic. These + steps will ensure that on most platforms/environments, you will get a + clean output with all the cross-references, citations etc correctly + labelled and ordered. + </p></div><div class="section" title="6.4 Customizing the compiler output"><div class="titlepage"><div><div><h3 class="title"><a id="compiler-output-customization"></a>6.4 Customizing the compiler output</h3></div></div></div><p> + Most LaTeX compilers produce a very large amount of output during + compilation, most of which is not relevant to debugging type-setting + errors. The compiler plugin provided with Latex-Suite (which is an enhanced + version of the standard compiler plugin maintained by Artem Chuprina), + provides a way to filter the compiler output so that the actual + errors/warnings can be presented much more concisely. + </p><p> + The compiler plugin is set up by default to function in a "non-verbose", + "ignore-common-warnings" mode, which means that irrelevant lines from the + compiler output will be ignored and some very common warnings are also + ignored. + Latex-Suite does this via the global variable <a class="link" href="#Tex_IgnoredWarnings" title="11.6.5 g:Tex_IgnoredWarnings"><code class="literal">g:Tex_IgnoredWarnings</code></a>. + This is a list of patterns, which can be used to filter out (or ignore) + some or the warnings and errors reported by the compiler. See the link + above for its default value. + </p><p> + Latex-Suite uses the <a class="link" href="#Tex_IgnoreLevel" title="11.6.6 g:Tex_IgnoreLevel"><code class="literal">g:Tex_IgnoreLevel</code></a> + setting to set a default ignore level. For example, for the default + value of 4, Latex-Suite ignores warnings and errors matching the first 4 + patterns in <code class="literal">g:Tex_IgnoredWarnings</code>. + </p><p> + In addition to setting a default value of the ignore level, Latex-Suite + provides the ability to set the level dynamically, using the + <code class="literal">TCLevel</code> command. For example, if you issue the + command: + </p><pre class="programlisting">TCLevel 3</pre><p> + from within Vim, then the next time you compile the document, Latex-Suite will + ignore warnings and errors which match the first three patterns in + <code class="literal">g:Tex_IgnoredWarnings</code>. + </p><p> + When TCLevel is called with the unquoted string strict as follows: + </p><pre class="programlisting">TClevel strict</pre><p> + then Latex-Suite switches to a "verbose", "no-lines-ignored" mode which is useful + when you want to make final checks of your document and want to be careful + not to let things slip by. + </p><p> + See the explanation of the settings <a class="link" href="#Tex_IgnoredWarnings" title="11.6.5 g:Tex_IgnoredWarnings">g:Tex_IgnoredWarnings</a> and <a class="link" href="#Tex_IgnoreLevel" title="11.6.6 g:Tex_IgnoreLevel">g:Tex_IgnoreLevel</a> to find out how to + customize the filtering done by Latex-Suite + </p></div><div class="section" title="6.5 Compiling parts of a file"><div class="titlepage"><div><div><h3 class="title"><a id="part-compiling"></a>6.5 Compiling parts of a file</h3></div></div></div><p> + Latex-Suite also provides a way to compile a fragment of a document. This can be + very useful while debugging a complex equation or one chapter in a book, + etc. + </p><p> + To do this, visually select a portion of the text and press + <code class="literal">\ll</code> while in visual mode. The visually selected portion + will be saved to a temporary file with the preamble from the current + document prepended. Latex-Suite will then switch focus to this temporary file and + compile it. Continue to debug this file as required and then replace the + portion of the original file with this one. + </p><p> + Pressing <code class="literal">\lv</code> while viewing the temporary file will + view the output file generated from the temporary file, not the original + file + </p><p> + Two commands |TPartComp| and |TPartView| are provided to be able to get + this functionality via the command line. + </p><p> + From release 1.6 onwards of Latex-Suite, the temporary file created + for part compilation will reside in the same directory as the file from + which the fragment is being created. This ensures that any relative + path-names defined in the fragment will still work. Latex-Suite will + attempt to clean the temporary file(s) created when Vim exits. + </p></div></div><div class="section" title="7 Latex Viewing and Searching"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="latex-viewing"></a>7 Latex Viewing and Searching</h2></div></div></div><div class="section" title="7.1 Setting Viewing rules"><div class="titlepage"><div><div><h3 class="title"><a id="latex-viewing-rules"></a>7.1 Setting Viewing rules</h3></div></div></div><p> + In order to view the output files created by compiling the source + files, you need to specify which external program Latex-Suite should call. You + can specify the external program using one of two settings + <a class="link" href="#Tex_ViewRule_format" title="11.7.1 g:Tex_ViewRule_&lt;format&gt;">Tex_ViewRule_format</a> or <a class="link" href="#Tex_ViewRuleComplete_format" title="11.7.2 Tex_ViewRuleComplete_&lt;format&gt;">Tex_ViewRuleComplete_format</a>. + By default, Latex-Suite has default settings for viewing various common output + formats via the <code class="literal">Tex_ViewRule_format</code> settings, so + that if you are using commonly used programs, you should be all set to + view compiled files from within Vim by simply pressing + <code class="literal">\lv</code>. + </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> + The viewing function also takes the <a class="link" href="#latex-master-file" title="9.2 Specifying which file to compile"><code class="literal">*.latexmain</code></a> file + into account to decide which file to show. + </p></div><p> + If pressing <code class="literal">\lv</code> does not work, then it most probably + has to do with incorrect settings of the <a class="link" href="#Tex_ViewRule_format" title="11.7.1 g:Tex_ViewRule_&lt;format&gt;"><code class="literal">g:Tex_ViewRule_&lt;format&gt;</code></a> + where <code class="literal">&lt;format&gt;</code> is the format you are + attempting to view. See the link above for how to set this according to + your system. + </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> + On Windows and OS/X, you can leave the view rule empty to open the document + with the default viewer on your system. On Linux/UNIX systems, you can use + the <code class="literal">xdg-open</code> command to open the document with the default + viewer. + </p></div><p> + In addition to viewing the files, Latex-Suite also supports forward and inverse + searching for certain common tools for viewing documents. + See the next few sections for details on forward and inverse searching, + including an overview of viewers. + </p></div><div class="section" title="7.2 Forward Searching documents"><div class="titlepage"><div><div><h3 class="title"><a id="forward-searching"></a>7.2 Forward Searching documents</h3></div></div></div><p> + Forward searching refers to making a viewer display a given document at + a given location from within Vim. At present, these viewers are known to support + forward searching, but viewers that are not listed here may work, too: + </p><div class="informaltable"><table border="1"><colgroup><col></col><col></col><col></col></colgroup><thead><tr><th>Viewer</th><th>OS</th><th>Supported documents</th><th>Comment</th></tr></thead><tbody><tr><td><a class="ulink" href="http://skim-app.sourceforge.net/" target="_top">Skim</a></td><td>Apple / OS X Tiger</td><td>PDF</td><td>Supports also inverse searching</td></tr><tr><td><a class="ulink" href="http://pdfview.sourceforge.net/" target="_top">PDFView</a></td><td>Apple / OS X</td><td>PDF</td><td>No longer in development, supports also inverse searching</td></tr><tr><td><a class="ulink" href="http://www2.ing.unipi.it/~d9615/homepage/texniscope.html" target="_top">TeXniscope</a></td><td>Apple</td><td>PDF, DVI</td><td> </td></tr><tr><td><a class="ulink" href="http://www.miktex.org/" target="_top">YAP</a></td><td>Windows</td><td>DVI, PS</td><td>ships with MikTex</td></tr><tr><td><a class="ulink" href="http://blog.kowalczyk.info/software/sumatrapdf/" target="_top">Sumatra PDF</a></td><td>Windows</td><td>PDF</td><td> </td></tr><tr><td><a class="ulink" href="http://developer.kde.org/~kdvi/" target="_top">kdvi</a></td><td>Linux/UNIX</td><td>DVI</td><td> </td></tr><tr><td><a class="ulink" href="http://okular.kde.org/" target="_top">okular</a></td><td>Linux/UNIX</td><td>DVI, PDF, PS and many more</td><td>Included in KDE 4</td></tr><tr><td><a class="ulink" href="http://math.berkeley.edu/~vojta/xdvi.html" target="_top">xdvi</a></td><td>Linux/UNIX</td><td>DVI</td><td> </td></tr><tr><td><a class="ulink" href="http://xdvi.sourceforge.net/" target="_top">xdvik</a></td><td>Linux/UNIX</td><td>DVI</td><td> </td></tr></tbody></table></div><p> + + Pressing <code class="literal">\ls</code> from within Vim + should make the viewer display the portion of the document where your + cursor is placed. + </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> + OS/X users need to set the <code class="literal">g:TreatMacViewerAsUNIX</code> flag + to <code class="literal">1</code> and provide a UNIX-like viewrule, that expects as + arguments the document, the linenumber and the sourcefile in this order. + </p></div><p> + </p><a id="enabling-searching"></a><div class="note" title="Enabling Forward and Inverse Searching" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Enabling Forward and Inverse Searching</h3><p> + Most DVI viewers need "source-special" information in order to do + forward (and inverse) searching. This information is embedded in the + <code class="literal">dvi</code> file if the LaTeX source is compiled with the + <code class="literal">--src-specials</code> option. By default, Latex-Suite does not + supply this argument to the compiler. See the section on + <code class="literal"><a class="link" href="#Tex_CompileRule_format" title="11.6.2 g:Tex_CompileRule_&lt;format&gt;">g:Tex_CompileRule_dvi</a></code> + to find out how this option can be set. + + For pdf viewers you need to use the <a class="ulink" href="http://itexmac.sourceforge.net/pdfsync.html" target="_top">pdfsync</a> + package in your LaTeX document. + </p></div></div><div class="section" title="7.3 Inverse Searching"><div class="titlepage"><div><div><h3 class="title"><a id="inverse-searching"></a>7.3 Inverse Searching</h3></div></div></div><p> + Inverse searching refers to the viewer telling Vim to display the + LaTeX source file at a given location when you double-click in the + viewer window. + </p><p> + You will need to <a class="link" href="#enabling-searching">enable + searching</a> in order to use this functionality. + </p><p> + You will also need to specify certain settings to the DVI viewer + conveying the syntax which it needs to use to tell Vim how to display + the source file. In <code class="literal">YAP</code>, you can set this option in + <code class="literal">View &gt; Options &gt; Inverse Search</code>. The + <code class="literal">Command Line</code> field needs to be set as follows: + </p><pre class="programlisting">"C:\Program Files\vim\vim61\gvim" -c ":RemoteOpen +%l %f"</pre><p> + The command <code class="literal">:RemoteOpen</code> is supplied when you install + Latex-Suite. + </p><p> + On *nix machines, Latex-Suite attempts to call the DVI viewer in such a way + that it already knows how to communicate with Vim. If this does not + seem to be working, you can use the <code class="literal">RemoteOpen</code> + command described above. + </p></div></div><div class="section" title="8 Latex Folding"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="latex-folding"></a>8 Latex Folding</h2></div></div></div><p> + Latex-Suite ships with the plugin SyntaxFolds.vim which is a plugin for + creating "fake" syntax folds on the fly. The fold method is actually manual + but the folding is based on LaTeX syntax. This offers a speed increase over + regular syntax folding. Ofcourse it has the disadvantage that the folds are + not dynamic, i.e newly created syntax items are not automatically folded up. + (This is a compromise between speed and convenience). + </p><p> + When you open up a LaTeX file, all the portions will be automatically folded + up. However, no new folds will be created until you press + <code class="literal">&lt;F6&gt;</code> or <code class="literal">\rf</code>. (rf + stands for "refresh folds"). + </p><p> + The fold-text is set to the first line of the folded text unless the fold is a + table, figure etc. (an environment). In this case, if a \caption and/or a + label is found in the folded region, then those are used to make a more + meaningful fold-text, otherwise the second line of the environment is displayed + along with the name of the environment. In other words, the following + </p><pre class="programlisting">\begin{figure}[h] + \centerline{\psfig{figure=slidercrank.eps,height=6cm}} + \caption{The Slider Crank Mechanism.} + \label{fig:slidercrank} +\end{figure} +% a LaTeX comment. +\begin{eqnarray} + \sin(\pi) = 0 +\end{eqnarray}</pre><p> + </p><p> + will be shown as: + </p><pre class="programlisting">+--- 5 lines: figure (fig:slidercrank) : The Slider Crank Mechanism. ----- +% a LaTeX comment. ++--- 3 lines: eqnarray () : \sin(\pi) = 0 --------------------------------</pre><p> + </p><div class="section" title="8.1 Default Folding Scheme in Latex-Suite"><div class="titlepage"><div><div><h3 class="title"><a id="default-folding"></a>8.1 Default Folding Scheme in Latex-Suite</h3></div></div></div><p> + By default Latex-Suite creates folds in the following manner: + </p><pre class="programlisting">\chapter +\section +%%fakesection + \subsection + \subsubsection + \item + \equation + \eqnarray + \figure + \table + \footnote</pre><p> + The indentation shows the "nestedness" of the folding scheme. + See the <a class="link" href="#customizing-what-to-fold" title="8.2 Customizing what to fold">next section</a> to + see how you can change this scheme. + </p></div><div class="section" title="8.2 Customizing what to fold"><div class="titlepage"><div><div><h3 class="title"><a id="customizing-what-to-fold"></a>8.2 Customizing what to fold</h3></div></div></div><p> + From version 1.6 onwards, the folding in Latex-Suite can be controlled + to a large extent via a number of global variables. + </p><div class="section" title="8.2.1 Tex_FoldedSections"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_FoldedSections"></a>8.2.1 Tex_FoldedSections</h4></div></div></div><p> + This entry defines which sections will be folded. This + setting is a comma separated list of section names. + The default value is: + </p><pre class="programlisting">part,chapter,section,%%fakesection, +subsection,subsubsection,paragraph</pre><p> + Each of the entries in the list will fold up a section of the + corresponding name. The <code class="literal">%%fakesection</code> section is + provided as a means for the user to group lines into "fake" sections. + A <code class="literal">%%fakesection</code> is assumed to start on a line which + begins with the string <code class="literal">%%fakesection</code> and continue + till the start of the next <code class="literal">\section</code>, + <code class="literal">\subsection</code> or any other section. + </p><p> + See also <a class="link" href="#fold-setting-advanced" title="8.2.5 Advanced Fold setting details">advanced fold + settings</a>. + </p></div><div class="section" title="8.2.2 Tex_FoldedEnvironments"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_FoldedEnvironments"></a>8.2.2 Tex_FoldedEnvironments</h4></div></div></div><p> + This entry defines which environments will be folded. It is a + comma separated string of words each of which defines a single + environment. The default setting is + </p><pre class="programlisting">verbatim,comment,eq,gather, +align,figure,table,thebibliography, +keywords,abstract,titlepage</pre><p> + The words need not be standard Latex environments. You can + add any word you like. Also, each word will fold up all + environments whose name begins with that word. For example, in + the setting above, the word <code class="literal">"eq"</code> folds up the + <code class="literal">\begin{equation}</code>, + <code class="literal">\begin{eqnarray}</code>, + <code class="literal">\begin{eqnarray*}</code> environments. To avoid + this, you can replace the word <code class="literal">"eq"</code> with + <code class="literal">"eq}"</code>. + </p><p> + See also <a class="link" href="#fold-setting-advanced" title="8.2.5 Advanced Fold setting details">advanced fold + settings</a>. + </p></div><div class="section" title="8.2.3 Tex_FoldedCommands"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_FoldedCommands"></a>8.2.3 Tex_FoldedCommands</h4></div></div></div><p> + This entry defines which commands will be folded. It is a comma + separated string of words each of which defines a single command. + The default setting is empty, i.e no commands are folded. + The words need not be standard Latex commands. You can use whatever + words you like. Each word will fold all commands whose name begins + with that word as in the case of the <a class="link" href="#Tex_FoldedEnvironments" title="8.2.2 Tex_FoldedEnvironments">Tex_FoldedEnvironments</a> + variable. + </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> + It is very difficult to fold commands reliably because it is very + difficult to create a regexp which will match a line containing + unmatched parentheses (or curly brackets), but will not match a line + containing matched parentheses. + </p><p> + Just to make things safer, only lines which start a command but do + not contain additional curly braces after the command has started are + folded. In other words, if you wanted to fold the the command + <code class="literal">"mycommand"</code>, then the lines + </p><pre class="programlisting">\mycommand{This is a line +and some more text on the next line +}</pre><p> + will be folded, but the lines + </p><pre class="programlisting">\mycommand{This is a \textbf{line} +and some more text +}</pre><p> + will not be folded. This is a bug which is very difficult to fix. + </p></div><p> + See also <a class="link" href="#fold-setting-advanced" title="8.2.5 Advanced Fold setting details">advanced fold + settings</a>. + </p></div><div class="section" title="8.2.4 Tex_FoldedMisc"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_FoldedMisc"></a>8.2.4 Tex_FoldedMisc</h4></div></div></div><p> + This entry defines fold syntax for certain items which do not + naturally fit into the section, environment of command lists. It is a + comma separated list of words. The default value is: + </p><pre class="programlisting">item,preamble,&lt;&lt;&lt;</pre><p> + </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> + Unlike the other Tex_FoldedXXXX variables, the words in this setting + are limited to take values from the following list: + </p><p> + </p><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><thead><tr><th>Value</th><th>Meaning</th></tr></thead><tbody><tr><td>comments</td><td>Folds up contiguous blocks of comments</td></tr><tr><td>item</td><td>Folds up the <code class="literal">\item</code>s within list + environments</td></tr><tr><td>preamble</td><td>Folds up the preamble of a document. (The part between + the <code class="literal">\documentclass</code> command and the + <code class="literal">\begin{document}</code> environment)</td></tr><tr><td><code class="literal">&lt;&lt;&lt;</code></td><td>Folds defined manually by the user using the + <code class="literal">&lt;&lt;&lt;</code> and + <code class="literal">&gt;&gt;&gt;</code> strings as fold-markers.</td></tr></tbody></table></div><p> + Any other words in the <code class="literal">Tex_FoldedMisc</code> setting + are silently ignored. + </p></div><p> + </p><p> + See also <a class="link" href="#fold-setting-advanced" title="8.2.5 Advanced Fold setting details">advanced fold + settings</a>. + </p></div><div class="section" title="8.2.5 Advanced Fold setting details"><div class="titlepage"><div><div><h4 class="title"><a id="fold-setting-advanced"></a>8.2.5 Advanced Fold setting details</h4></div></div></div><p> + The order of the words in the <code class="literal">Tex_FoldedXXXX</code> + variables is <span class="emphasis"><em>important</em></span>. The order defines the + order in which the folds are nested. For example, the value + <code class="literal">"subsection,section"</code> for the + <code class="literal">Tex_FoldedSections</code> variable will not fold any + subsections at all. This is because the folds are created in the + <span class="emphasis"><em>reverse</em></span> order in which they occur in the + <code class="literal">Tex_FoldedSections</code> setting and also, once a fold is + created, the interior of the fold is not examined for creating + additional folds. In the above case, this means that a + <code class="literal">\section</code> is folded first and then its interior is + not examined further. The correct value should have been + <code class="literal">"section,subsection"</code> + </p><a id="fold-setting-adding"></a><p> + Each of the fold setting variables + <code class="literal">Tex_FoldedSections</code>, + <code class="literal">Tex_FoldedEnvironments</code> etc., as explained previously + is a comma separated string of variables. However, to make it easier + to <span class="emphasis"><em>add</em></span> to the default settings without having to + repeat the whole default setting again, Latex-Suite uses the following logic + in forming the complete setting string from the + <code class="literal">Tex_FoldedXXXX</code> variables. If the variable starts with + a comma, then <code class="literal">Tex_FoldedXXXX</code> is added to the end of + the default string rather than replacing it. Similarly, if it ends + with a comma, then it will be prepended to the beginning of the + default setting rather than replacing it. + </p><p> + For example, if <code class="literal">Tex_FoldedEnvironments</code> is set to the + string <code class="literal">"myenv"</code>, then only an environment of the + form <code class="literal">\begin{myenv}</code> will be folded. However, if the + <code class="literal">Tex_FoldedEnvironments</code> setting is + <code class="literal">",myenv"</code>, then the <code class="literal">\begin{myenv}</code> + environment will be folded after all other environments in the default + setting have been folded. On the other hand if + <code class="literal">Tex_FoldedEnvironments</code> is of the form + <code class="literal">"myenv,"</code>, the <code class="literal">\begin{myenv}</code> + environment will be folded before the rest of the environments in the + default setting. + </p></div></div><div class="section" title="8.3 Editing the folding.vim file directly"><div class="titlepage"><div><div><h3 class="title"><a id="editing-folding"></a>8.3 Editing the folding.vim file directly</h3></div></div></div><p> + If you are using version 1.5 of Latex-Suite or older, you will need to + directly edit the + <code class="literal">$VIM/ftplugin/latex-suite/folding.vim</code> file if you + wish to modify the folding scheme. You will need to modify the + function <code class="literal">MakeTexFolds()</code> defined in that file to + modify the fold syntax. <code class="literal">MakeTexFolds</code> makes a number + of calls to <code class="literal">AddSyntaxFoldItem</code>. Each such call + defines a new "fold item". The order in which these calls are made + defines how the folds are nested. For example, if you desire an + <code class="literal">figure</code> environment to be nested within a + <code class="literal">section</code>, then you should define the fold for the + <code class="literal">figure</code> first. The syntax of + <code class="literal">AddSyntaxFoldItem</code> is as follows: + </p><pre class="programlisting">AddSyntaxFoldItem(startpat, endpat, startoff, endoff [, startskip, endskip])</pre><p> + If the last two arguments are omitted, then they are assumed to default + to the empty strings <code class="literal">''</code>. + The explanation for each argument is as follows: + </p><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><thead><tr><th>Argument</th><th>Explanation</th></tr></thead><tbody><tr><td><code class="literal">startpat</code></td><td>a line matching this pattern defines + the beginning of a fold. + </td></tr><tr><td> + <code class="literal">endpat</code> + </td><td> + a line matching this pattern defines the end of a fold. + </td></tr><tr><td><code class="literal">startoff</code></td><td> + this is the offset from the starting line at which folding will + actually start + </td></tr><tr><td><code class="literal">endoff</code></td><td> + like <code class="literal">startoff</code>, but gives the offset of the + actual fold end from the line satisfying <code class="literal">endpat</code>. + <code class="literal">startoff</code> and <code class="literal">endoff</code> are + necessary when the folding region does not have a specific end + pattern corresponding to a start pattern. for example in LaTeX, + <code class="literal">\section{Section Name}</code> defines the beginning of + a section, but there is no command which specifically ends a + section. Thus a <code class="literal">\section</code> is assumed to end 1 + line <span class="emphasis"><em>before</em></span> another section starts. + </td></tr><tr><td> + <code class="literal">startskip</code> + </td><td> + A Pattern Which Defines The Beginning Of A "Skipped" Region. + + For example, suppose we define a \itemize fold as follows: + <pre class="programlisting"><code class="literal">startpat</code> = '^\s*\\item', +<code class="literal">endpat</code> = '^\s*\\item\|^\s*\\end{\(enumerate\|itemize\|description\)}', +<code class="literal">startoff</code> = 0, +<code class="literal">endoff</code> = -1</pre> + + This defines a fold which starts with a line beginning with an + <code class="literal">\item</code> and ending one line before a line beginning with an + <code class="literal">\item</code> or <code class="literal">\end{enumerate}</code> etc. + + Then, as long as <code class="literal">\item</code>'s are not nested things are fine. + However, once items begin to nest, the fold started by one + <code class="literal">\item</code> can end because of an + <code class="literal">\item</code> in an <code class="literal">\itemize</code> + environment within this <code class="literal">\item</code>. i.e, the following can happen: + + <pre class="programlisting">\begin{itemize} +\item Some text &lt;------- fold will start here +This item will contain a nested item +\begin{itemize} &lt;----- fold will end here because next line contains \item... +\item Hello +\end{itemize} &lt;----- ... instead of here. +\item Next item of the parent itemize +\end{itemize}</pre> + + Therefore, in order to completely define a folding item which + allows nesting, we need to also define a "skip" pattern. + <code class="literal">startskip</code> and end skip do that. + Leave '' when there is no nesting. + </td></tr><tr><td> + <code class="literal">endskip</code> + </td><td> + the pattern which defines the end of the "skip" pattern for + nested folds. + </td></tr></tbody></table></div><div class="note" title="Example 1" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Example 1</h3><p> + A syntax fold region for the latex section is defined with the + following arguments to <code class="literal">AddSyntaxFoldItem</code>: + </p><pre class="programlisting">startpat = "\\section{" +endpat = "\\section{" +startoff = 0 +endoff = -1 +startskip = '' +endskip = ''</pre><p> + Note that the start and end patterns are thus the same and + <code class="literal">endoff</code> has a negative value to capture the effect + of a section ending one line before the next starts. + </p></div><div class="note" title="Example 2" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Example 2</h3><p> + A syntax fold region for the \itemize environment is: + </p><pre class="programlisting">startpat = '^\s*\\item', +endpat = '^\s*\\item\|^\s*\\end{\(enumerate\|itemize\|description\)}', +startoff = 0, +endoff = -1, +startskip = '^\s*\\begin{\(enumerate\|itemize\|description\)}', +endskip = '^\s*\\end{\(enumerate\|itemize\|description\)}'</pre><p> + Note the use of <code class="literal">startskip</code> and + <code class="literal">endskip</code> to allow nesting. + </p></div></div></div><div class="section" title="9 Multiple file LaTeX projects"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="latex-project"></a>9 Multiple file LaTeX projects</h2></div></div></div><a id="latex-project-example"></a><p> + Many LaTeX projects contain multiple source files which are + <code class="literal">\include</code>d from a master file. A typical example of + this situation is a directory layout such as the following + </p><p> + </p><pre class="programlisting">thesis/ + main.tex + abstract.tex + intro/ + intro.tex + figures/ + fig1.eps + fig2.eps + chapter1/ + chap1.tex + figures/ + fig1.eps + conclusion/ + conclusion.tex + figures/</pre><p> + </p><p> + In the above case, <code class="literal">main.tex</code> will typically look like + </p><p> + </p><pre class="programlisting">% file: main.tex +\documentclass{report} +\begin{document} + +\input{abstract.tex} +\input{intro/intro.tex} +\input{chapter1/chap1.tex} +\input{conclusion/conclusion.tex} + +\end{document}</pre><p> + </p><p> + <a id="latex-master-file-specification"></a> In such situations, you will + need to convey to Latex-Suite that <code class="literal">main.tex</code> is the main file + which <code class="literal">\input</code>s the other files. This is done by creating + an empty file called <code class="literal">main.tex.latexmain</code> in the same + directory in which <code class="literal">main.tex</code> resides. This file is called + the <span class="emphasis"><em>master file</em></span> in this manual. See <a class="link" href="#Tex_MainFileExpression">Tex_MainFileExpression</a> for an + alternative way of specifying the master file. + </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> + Here <code class="literal">main.tex.latexmain</code> is (obviously) a different + file from <code class="literal">main.tex</code> itself. + <code class="literal">main.tex</code> need not be renamed. This ofcourse + restricts each directory to have a single master file. + </p></div><p> + Each time Latex-Suite opens a new LaTeX file, it will try to see if it is + part of a multiple file project by searching upwards (to the root of + the file-system) from the current file's directory to see if it finds a + file of the form <code class="literal">*.latexmain</code>. If such a file is + found, then it is considered that the current file is part of a larger + project. The name of the LaTeX master file is inferred directly from + the first part of the <code class="literal">*.latexmain</code> file as described + in the example above. + </p><div class="section" title="9.1 Latex-Suite project settings"><div class="titlepage"><div><div><h3 class="title"><a id="latex-project-settings"></a>9.1 Latex-Suite project settings</h3></div></div></div><p> + If a <a class="link" href="#latex-master-file" title="9.2 Specifying which file to compile">master file</a> is found, + then Latex-Suite <code class="literal">:source</code>s the file. Thus this file needs to + contain valid Vim commands. This file is typically used to store + project specific settings. + </p><p> + Some typical per-project settings which are best put in the master file + are + </p><table border="0" summary="Simple list" class="simplelist"><tr><td><a class="link" href="#Tex_ProjectSourceFiles" title="11.5.4 g:Tex_ProjectSourceFiles">Tex_ProjectSourceFiles</a></td></tr></table><p> + </p></div><div class="section" title="9.2 Specifying which file to compile"><div class="titlepage"><div><div><h3 class="title"><a id="latex-master-file"></a>9.2 Specifying which file to compile</h3></div></div></div><p> + In the example described <a class="link" href="#latex-project-example">previously</a>, if you are editing + <code class="literal">intro/intro.tex</code> and press <code class="literal">\ll</code>, + then you still want Latex-Suite to compile <code class="literal">main.tex</code>, + because <code class="literal">intro/intro.tex</code> is merely a fragment which + is <code class="literal">\input</code>'ed into <code class="literal">main.tex</code>. If + the master file is already specified using the + <code class="literal">*.latexmain</code> convention described <a class="link" href="#latex-project-example">previously</a>, then Latex-Suite will automatically + compile the master file when you are editing any of its + <code class="literal">\input</code>'ed fragments. Thus pressing + <code class="literal">\ll</code> while editing <code class="literal">intro/intro.tex</code> + will compile <code class="literal">main.tex</code>. + </p><a id="Tex_MainFileExpression"></a><p> + If you wish to use some different logic to specify the main file name, + you can specify a custom expression via the + <code class="literal">Tex_MainFileExpression</code> variable. This is a string + containing a valid vim expression. In addition, you can use a variable + <code class="literal">modifier</code> which is in the format used for + <code class="literal">|filename-modifiers|</code>, for example, + <code class="literal">':p:h'</code>. You should utilize this variable to modify + the filename of the main file. + </p><pre class="programlisting">let g:Tex_MainFileExpression = 'MainFile(modifier)' +function! MainFile(fmod) + if glob('*.latexmain') != '' + return fnamemodify(glob('*.latexmain'), a:fmod) + else + return '' + endif +endif</pre><p> + </p></div></div><div class="section" title="10 Latex-Suite Commands and Maps"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="latex-suite-commands-maps"></a>10 Latex-Suite Commands and Maps</h2></div></div></div><p> + This section describes the maps and commands used in Latex-Suite. It also + describes a way to change the map sequences according to your + preference. + </p><div class="section" title="10.1 Latex-Suite Maps"><div class="titlepage"><div><div><h3 class="title"><a id="latex-suite-maps"></a>10.1 Latex-Suite Maps</h3></div></div></div><a id="remapping-latex-suite-keys"></a><p> + Most of the mappings used in Latex-Suite can be mapped to a different key + combination to suit your particular needs. An example best explains the + procedure for doing this. Suppose you want to remap the + <code class="literal">&lt;C-j&gt;</code> key which Latex-Suite (actually imaps.vim) uses + to jump to the next placeholder. To do this, you first need to find out + which <code class="literal">&lt;Plug&gt;</code> mapping + <code class="literal">&lt;C-j&gt;</code> is derived from. You will need to look + at the relevant section of this manual to do this. For example, the + section <a class="link" href="#customize-imap-maps" title="10.1.1 IMAP mappings">IMAP mappings</a> has + the information that the <code class="literal">&lt;C-j&gt;</code> key is derived + from <code class="literal">&lt;Plug&gt;IMAP_JumpForward</code>. Therefore to + remap the <code class="literal">&lt;C-j&gt;</code> key to say + <code class="literal">&lt;C-space&gt;</code>, you will need to put a + statement like the following in your <code class="literal">~/.vimrc</code>. + </p><pre class="programlisting">imap &lt;C-space&gt; &lt;Plug&gt;IMAP_JumpForward</pre><p> + </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> + To change the <code class="literal">IMAP</code> mappings which affect jumping + between placeholders, the <code class="literal">map</code> statement above has + to be placed in your <code class="literal">~/.vimrc</code>. For other mappings + you can place the <code class="literal">map</code> statement in your + <code class="literal">$VIM/ftplugin/tex.vim</code> file. The reason for this is + that the <code class="literal">&lt;C-j&gt;</code> maps are created in + <code class="literal">plugin/imaps.vim</code>, which is sourced as soon as Vim + starts before sourcing any ftplugin files. + </p></div><div class="section" title="10.1.1 IMAP mappings"><div class="titlepage"><div><div><h4 class="title"><a id="customize-imap-maps"></a>10.1.1 IMAP mappings</h4></div></div></div><p> + These mappings are utilized for jumping between placeholders as + described <a class="link" href="#place-holders" title="Place Holders">here</a>. See the <a class="link" href="#latex-suite-maps" title="10.1 Latex-Suite Maps">parent section</a> to find out how to + use this information to change the default maps. + </p><a id="Plug_IMAP_JumpForward"></a><a id="Plug_IMAP_JumpBack"></a><a id="Plug_IMAP_DeleteAndJumpForward"></a><a id="Plug_IMAP_DeleteAndJumBack"></a><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><thead><tr><th>Plug map</th><th>Default Key</th></tr></thead><tbody><tr><td><code class="literal">&lt;Plug&gt;IMAP_JumpForward</code></td><td><code class="literal">&lt;C-j&gt;</code></td></tr><tr><td><code class="literal">&lt;Plug&gt;IMAP_JumpBack</code></td><td>(none)</td></tr><tr><td><code class="literal">&lt;Plug&gt;IMAP_DeleteAndJumpForward</code></td><td>(none)</td></tr><tr><td><code class="literal">&lt;Plug&gt;IMAP_DeleteAndJumpBack</code></td><td>(none)</td></tr></tbody></table></div><p> + <code class="literal">&lt;Plug&gt;IMAP_JumpForward</code> takes you to the + location of the next <a class="link" href="#place-holders" title="Place Holders">place-holder</a>. + </p><p> + <code class="literal">&lt;Plug&gt;IMAP_JumpBack</code> takes you to the previous + <a class="link" href="#place-holders" title="Place Holders">place-holder</a>. + </p><p> + <code class="literal">&lt;Plug&gt;IMAP_DeleteAndJumpForward</code> deletes the + presently selected place-holder and jumps to the next place-holder + irrespective of whether the present placeholder is empty or not and + ignoring the value of place-holder settings like <a class="link" href="#Imap_DeleteEmptyPlaceHolders" title="11.2.3 g:Imap_DeleteEmptyPlaceHolders"><code class="literal">g:Imap_DeleteEmptyPlaceHolders</code></a> + and <a class="link" href="#Imap_StickyPlaceHolders" title="11.2.4 g:Imap_StickyPlaceHolders"><code class="literal">g:Imap_StickyPlaceHolders</code></a> + </p><p> + <code class="literal">&lt;Plug&gt;IMAP_DeleteAndJumpBack</code> deletes the + presently selected place-holder and jumps to the previous place-holder + irrespective of whether the present placeholder is empty or not and + ignoring the value of place-holder settings like <a class="link" href="#Imap_DeleteEmptyPlaceHolders" title="11.2.3 g:Imap_DeleteEmptyPlaceHolders"><code class="literal">g:Imap_DeleteEmptyPlaceHolders</code></a> + and <a class="link" href="#Imap_StickyPlaceHolders" title="11.2.4 g:Imap_StickyPlaceHolders"><code class="literal">g:Imap_StickyPlaceHolders</code></a> + </p></div><div class="section" title="10.1.2 Alt-Key mappings"><div class="titlepage"><div><div><h4 class="title"><a id="customize-alt-key-maps"></a>10.1.2 Alt-Key mappings</h4></div></div></div><p> + These mappings are are described in the section <a class="link" href="#altkey-mappings" title="3.10 Alt Key Macros">Alt key macros</a>. See <a class="link" href="#remapping-latex-suite-keys">the parent section</a> to see + how to use the following information to remap keys. + </p><a id="Plug_Tex_MathBF"></a><a id="Plug_Tex_MathCal"></a><a id="Plug_Tex_LeftRight"></a><a id="Plug_Tex_InsertItemOnThisLine"></a><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><thead><tr><th>Plug Mapping</th><th>Default Key</th></tr></thead><tbody><tr><td><code class="literal">&lt;Plug&gt;Tex_MathBF</code></td><td><code class="literal">&lt;Alt-B&gt;</code></td></tr><tr><td><code class="literal">&lt;Plug&gt;Tex_MathCal</code></td><td><code class="literal">&lt;Alt-C&gt;</code></td></tr><tr><td><code class="literal">&lt;Plug&gt;Tex_LeftRight</code></td><td><code class="literal">&lt;Alt-L&gt;</code></td></tr><tr><td><code class="literal">&lt;Plug&gt;Tex_InsertItemOnThisLine</code></td><td><code class="literal">&lt;Alt-I&gt;</code></td></tr></tbody></table></div></div></div><div class="section" title="10.2 Latex Suite Commands"><div class="titlepage"><div><div><h3 class="title"><a id="latex-suite-commands"></a>10.2 Latex Suite Commands</h3></div></div></div><div class="section" title="10.2.1 :TMacro [{macro}]"><div class="titlepage"><div><div><h4 class="title"><a id="TMacro"></a>10.2.1 :TMacro [{macro}]</h4></div></div></div><p> + When used without any arguments lists all available macros defined + in runtime ftplugin/latex-suite/macros/ directories and prompts you + to choose one of them. With one argument |:read| this macro under + cursor position. With more than one argument it will not work :) In + Vim &gt;= 6.2 works completion of names of macros (see 'wildmenu', + 'wildmode' for more about command-line completion). + </p></div><div class="section" title="10.2.2 :TMacroEdit [{macro}]"><div class="titlepage"><div><div><h4 class="title"><a id="TMacroEdit"></a>10.2.2 :TMacroEdit [{macro}]</h4></div></div></div><p> + Splits window for editing {macro}. When used without any arguments + lists all available macros defined in runtime + ftplugin/latex-suite/macros/ directories and prompt you to choose + one of them. When you try to edit {macro} not from local directory + Latex-Suite will copy it to your local directory with suffix + "-local". If local copy already exists Latex-Suite prompt for + overwriting it. In Vim &gt;= 6.2 works completion of names of macros + (see 'wildmenu', 'wildmode' for more about command-line completion). + </p></div><div class="section" title="10.2.3 :TMacroNew"><div class="titlepage"><div><div><h4 class="title"><a id="TMacroNew"></a>10.2.3 :TMacroNew</h4></div></div></div><p> + Splits window to write new macro. Directory in new buffer is + locally changed to Latex-Suite/macros/. + </p></div><div class="section" title="10.2.4 :TMacroDelete [{macro}]"><div class="titlepage"><div><div><h4 class="title"><a id="TMacroDelete"></a>10.2.4 :TMacroDelete [{macro}]</h4></div></div></div><p> + Delets {macro} from your local ftplugin/latex-suite/macros/ + directory. When used without any arguments lists all available + macros defined in Latex-Suite/macros/ directory and prompt you to + choose one of them. When you choose to delete {macro} which is not + in your local directory Latex-Suite will refuse to delete it. In + Vim &gt;= 6.2 works completion of names of macros (see 'wildmenu', + 'wildmode' for more about command-line completion) + </p></div><div class="section" title="10.2.5 :TPackage [{package, ...}]"><div class="titlepage"><div><div><h4 class="title"><a id="TPackage"></a>10.2.5 :TPackage [{package, ...}]</h4></div></div></div><p> + When used without any arguments lists name of the packages for + which support is available. If you are using Vim GUI and have + <code class="literal">Tex_Menus</code> set to 1, then it will list all files + found in the <code class="literal">$VIM/ftplugin/latex-suite/packages</code> + directory. Otherwise, Latex-Suite will list files found in the + <code class="literal">$VIM/ftplugin/latex-suite/dictionaries</code> directory. + Choosing a file from the list will insert a + </p><pre class="programlisting">\usepackage[&lt;++&gt;]{&lt;packname&gt;}</pre><p> line into the + buffer at the current cursor location. For Vim 6.2 and above, you + can use command-line completion to choose a package file. You can also + call <code class="literal">TPackage</code> with one or more package names + separated with spaces in which case, Latex-Suite will insert + <code class="literal">\usepackage</code> lines for each of them in turn. + </p><p> + After inserting the <code class="literal">\usepackage</code> line(s), Latex-Suite will + support it (them) in various ways as described in the section <a class="link" href="#package-actions" title="4.2 Actions taken for supported packages">Actions taken for supported + packages</a>. + </p></div><div class="section" title="10.2.6 :TPackageUpdate"><div class="titlepage"><div><div><h4 class="title"><a id="TPackageUpdate"></a>10.2.6 :TPackageUpdate</h4></div></div></div><p> + This command `reads' name of package under cursor and turns on + possible support. + </p></div><div class="section" title="10.2.7 :TPackageUpdateAll"><div class="titlepage"><div><div><h4 class="title"><a id="TPackageUpdateAll"></a>10.2.7 :TPackageUpdateAll</h4></div></div></div><p> + After issuing this command latexSuite scans the file in + looking for not declared packages, removing not needed entries + from Packages menu and turning off not necessary packages' + dictionaries. + </p></div><div class="section" title="10.2.8 :TTemplate [{template}]"><div class="titlepage"><div><div><h4 class="title"><a id="TTemplate"></a>10.2.8 :TTemplate [{template}]</h4></div></div></div><p> + When used without any arguments lists all available templates + from latex-suite/templates/ directory and prompts to choose + one of them. + With one argument :0|read| {template} file. + With more than one argument it will not work :) + In Vim &gt;= 6.2 works completion of names of macros (see 'wildmenu', + 'wildmode' for more about command-line completion) + </p></div><div class="section" title="10.2.9 :TSection [{argument}]"><div class="titlepage"><div><div><h4 class="title"><a id="TSection"></a>10.2.9 :TSection [{argument}]</h4></div></div></div><p> + Used without any arguments inserts last section type + (|latex-sectioning|). + Accepts arguments: + n&gt; inserts section name in &lt;n&gt; logical level. + Levels are: + </p><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>0</td><td>part</td></tr><tr><td>1</td><td>chapter</td></tr><tr><td>2</td><td>section</td></tr><tr><td>3</td><td>subsection</td></tr><tr><td>4</td><td>subsubsection</td></tr><tr><td>5</td><td>paragraph</td></tr><tr><td>6</td><td>subparagraph</td></tr></tbody></table></div><p> + + </p><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td> + +&lt;n&gt; + </td><td> + inserts section name &lt;n&gt; logical levels above the last + used comand + </td></tr><tr><td> + -&lt;n&gt; + </td><td> + inserts section name &lt;n&gt; logical levels below the last + used comand + </td></tr><tr><td> + + + </td><td> + inserts section name one logical level below the last + used command (equal to +1). + </td></tr><tr><td> + ++ + </td><td> + inserts section name two logical levels below the last + used command (equal to +2). + </td></tr><tr><td> + - + </td><td> + inserts section name one logical level over the last + used command (equal to -1). + </td></tr><tr><td> + -- + </td><td> + inserts section name two logical levels over the last + used command (equal to -2). + </td></tr></tbody></table></div><p> + + Command accepts also latexSuite mappings (|latex-macros|) + without preceding S and in lowercase: + </p><pre class="programlisting">:TSection pa</pre><p> + will result in <code class="literal">\part{}</code>. It is possible to use full names of + sections: <code class="literal">:TSection part</code> + </p></div><div class="section" title="10.2.10 :TSectionAdvanced"><div class="titlepage"><div><div><h4 class="title"><a id="TSectionAdvanced"></a>10.2.10 :TSectionAdvanced</h4></div></div></div><p> + Accepts the same arguments as |TSection| but leads to a couple + of questions (whether you want to include the section in the + table of contents, whether there is a shorter name for the + table of contents) and then creates a more intelligent + template. + </p></div><div class="section" title="10.2.11 :TLook"><div class="titlepage"><div><div><h4 class="title"><a id="TLook"></a>10.2.11 :TLook</h4></div></div></div><p> + Accepts one argument. Will look through .tex files in + directory of edited file for argument. It can be regexp. You + don't have to enclose argument in "". &lt;cr&gt; takes you to + location. Other keys work as described in |latex-viewer|. + Note: TLook uses :grep command and is using 'grepprg'. Its + regular expressions can be different from those of Vim. + </p></div><div class="section" title="10.2.12 :TLookBib"><div class="titlepage"><div><div><h4 class="title"><a id="TLookBib"></a>10.2.12 :TLookBib</h4></div></div></div><p> + Accepts one argument. Will look through .bib files in + directory of edited file for argument. It can be regexp. You + don't have to enclose argument in "". &lt;cr&gt; takes you to + location. Other keys work as described in |latex-viewer|. + </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> + TLookBib uses :grep command and is using 'grepprg'. Its + regular expressions can be different from those of Vim. + </p></div></div><div class="section" title="10.2.13 :TLookAll"><div class="titlepage"><div><div><h4 class="title"><a id="TLookAll"></a>10.2.13 :TLookAll</h4></div></div></div><p> + Accepts one argument. Will look through all files in directory + of edited file for argument. It can be regexp. You don't have + to enclose argument in "". &lt;cr&gt; takes you to location. Other + keys work as described in |latex-viewer|. + Note: TLook uses :grep command and is using 'grepprg'. Its + regular expressions can be different from those of Vim. + </p></div><div class="section" title="10.2.14 :TPartComp"><div class="titlepage"><div><div><h4 class="title"><a id="TPartComp"></a>10.2.14 :TPartComp</h4></div></div></div><p> + No argument allowed but accepts range in all formats. Define + fragment of interest with :'a,'b, :/a/,/b/, :'&lt;,'&gt; or :20,30. + All other rules of compilation apply. + </p></div><div class="section" title="10.2.15 :TPartView"><div class="titlepage"><div><div><h4 class="title"><a id="TPartView"></a>10.2.15 :TPartView</h4></div></div></div><p> + Show last compiled fragment. All rules of viewing apply but + |latex-searching|. + </p></div><div class="section" title="10.2.16 :Tshortcuts [{arg}]"><div class="titlepage"><div><div><h4 class="title"><a id="Tshortcuts"></a>10.2.16 :Tshortcuts [{arg}]</h4></div></div></div><p> + Show shortcuts in terminal (not using menu). Without {arg} + you will see simple menu prompting for one of them. Possible + arguments: + </p><div class="informaltable"><table border="0"><colgroup><col></col><col></col></colgroup><tbody><tr><td>g</td><td>General shortcuts</td></tr><tr><td>e</td><td>Environment shortcuts</td></tr><tr><td>f</td><td>Font shortcuts</td></tr><tr><td>s</td><td>Section shortcuts</td></tr><tr><td>m</td><td>Math shortcuts</td></tr><tr><td>a</td><td>All shortcuts</td></tr></tbody></table></div><p> + </p></div></div></div><div class="section" title="11 Customizing Latex-Suite"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="customizing-latex-suite"></a>11 Customizing Latex-Suite</h2></div></div></div><p> + Customizing Latex-Suite is done by defining certain global variables in + <code class="literal">$VIM/ftplugin/tex.vim</code>, where + <code class="literal">$VIM</code> corresponds to <code class="literal">~/.vim</code> for *nix + machines and <code class="literal">~/vimfiles</code> for windows machines. This file + is not part of the Latex-Suite distribution. You will need to create this file + yourself (or modify it if it exists) if + you need to change any default settings. Since this file is not + included as part of the Latex-Suite distribution, it will not be over-written in + subsequent updates. + </p><p> + The default settings in Latex-Suite are defined in + <code class="literal">$VIM/ftplugin/latex-suite/texrc</code>. Please take a look at + this file if you find this documentation incomplete or confusing. That file + is also well documented. + </p><p> + This chapter describes the various settings which effect Latex-Suite and their + default values. The settings are broken up into sections according to the + behavior which they influence. + </p><div class="section" title="11.1 General Settings"><div class="titlepage"><div><div><h3 class="title"><a id="ls-general-purpose-settings"></a>11.1 General Settings</h3></div></div></div><div class="section" title="11.1.1 Tex_Debug"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_Debug"></a>11.1.1 Tex_Debug</h4></div></div></div><p> + </p><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>boolean</td></tr><tr><td>Default Value</td><td><code class="literal">0</code></td></tr></tbody></table></div><p> + </p><p> + If set to 1, then Latex-Suite will create certain global debug + statements which can be printed by doing + </p><pre class="programlisting">:call Tex_PrintDebug()</pre><p> + </p><p> + </p></div><div class="section" title="11.1.2 Tex_UsePython"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_UsePython"></a>11.1.2 Tex_UsePython</h4></div></div></div><p> + </p><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>boolean</td></tr><tr><td>Default Value</td><td><code class="literal">1</code></td></tr></tbody></table></div><p> + </p><p> + If Latex-Suite detects that your vim is python enabled (using + <code class="literal">has('python')</code>), then it tries to use python in + certain places to speed things up. If this misbehaves, you can set + this to zero, in which case, Latex-Suite will use vimscript to accomplish + the same. + </p><p> + </p></div></div><div class="section" title="11.2 Place-Holder Customization"><div class="titlepage"><div><div><h3 class="title"><a id="customizing-place-holders"></a>11.2 Place-Holder Customization</h3></div></div></div><p> + Latex-Suite uses <a class="link" href="#place-holders" title="Place Holders">place-holders</a> to minimize + using the movement keys while typing. The following settings affect how + place-holders are used. + </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> + These setting need to be set in your <code class="literal">~/.vimrc</code>, not + <code class="literal">$VIM/ftplugin/tex.vim</code> because these settings affect + the behavior of <code class="literal">imaps.vim</code>, which is a global plugin, + not a file-type plugin. + </p></div><div class="section" title="11.2.1 g:Imap_UsePlaceHolders"><div class="titlepage"><div><div><h4 class="title"><a id="Imap_UsePlaceHolders"></a>11.2.1 g:Imap_UsePlaceHolders</h4></div></div></div><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>Boolean</td></tr><tr><td>Default Value</td><td><code class="literal">1</code></td></tr></tbody></table></div><p> + Setting this to zero completely disables using place-holders. + </p></div><div class="section" title="11.2.2 g:Imap_PlaceHolderStart &amp; g:Imap_PlaceHolderEnd"><div class="titlepage"><div><div><h4 class="title"><a id="Imap_PlaceHolderStart"></a>11.2.2 g:Imap_PlaceHolderStart &amp; g:Imap_PlaceHolderEnd</h4></div></div></div><a id="Imap_PlaceHolderEnd"></a><div class="informaltable"><table border="1"><colgroup><col></col><col></col><col></col></colgroup><thead><tr><th>Setting</th><th>Type</th><th>Value</th></tr></thead><tbody><tr><td><code class="literal">Imap_PlaceHolderStart</code></td><td>String</td><td><code class="literal">'&lt;+'</code></td></tr><tr><td><code class="literal">Imap_PlaceHolderEnd</code></td><td>String</td><td><code class="literal">'+&gt;'</code></td></tr></tbody></table></div><p> + These settings affect the strings displayed at the beginning and end of + the place-holder string. Set these strings to a value different than a + commonly occurring sequence of characters. + </p><div class="note" title="TIP" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">TIP</h3><p> + If you use the <code class="literal">latin1</code> encoding and do not type in + french, then you can set these strings to the <code class="literal">\xab</code> + and <code class="literal">\xbb</code> characters (the french quotation marks). + </p></div></div><div class="section" title="11.2.3 g:Imap_DeleteEmptyPlaceHolders"><div class="titlepage"><div><div><h4 class="title"><a id="Imap_DeleteEmptyPlaceHolders"></a>11.2.3 g:Imap_DeleteEmptyPlaceHolders</h4></div></div></div><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>Boolean</td></tr><tr><td>Default Value</td><td><code class="literal">1</code></td></tr></tbody></table></div><p> + When set to one, non-descriptive or empty place-holders are deleted on + pressing <code class="literal">&lt;Ctrl-J&gt;</code>. + </p></div><div class="section" title="11.2.4 g:Imap_StickyPlaceHolders"><div class="titlepage"><div><div><h4 class="title"><a id="Imap_StickyPlaceHolders"></a>11.2.4 g:Imap_StickyPlaceHolders</h4></div></div></div><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>Boolean</td></tr><tr><td>Default Value</td><td><code class="literal">1</code></td></tr></tbody></table></div><p> + When set to 1, in visual mode, <code class="literal">&lt;Ctrl-J&gt;</code> takes + you to the next placeholder without deleting the current placeholder. + </p></div></div><div class="section" title="11.3 Macro Customization"><div class="titlepage"><div><div><h3 class="title"><a id="customizing-macros"></a>11.3 Macro Customization</h3></div></div></div><div class="section" title="11.3.1 Tex_Env_name"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_Env_name"></a>11.3.1 Tex_Env_name</h4></div></div></div><p> + If you wish to wish to expand certain environments differently from + the way Latex-Suite does it, you can define custom expansions using global + variables of the form <code class="literal">Tex_Env_{name}</code> where + <code class="literal">name</code> corresponds to the environment. + </p><p> + For example, if you press <code class="literal">&lt;F5&gt;</code> after typing + <code class="literal">theorem</code>, Latex-Suite will by default expand it to + </p><pre class="programlisting">\begin{theorem} + \label{&lt;++&gt;}&lt;++&gt; +\end{theorem}&lt;++&gt;</pre><p> + However, if you wish change this to + </p><pre class="programlisting">\begin{theorem} + &lt;++&gt; +\end{theorem}&lt;++&gt;</pre><p> + then define the following variable + </p><pre class="programlisting">let g:Tex_Env_theorem = "\\begin{theorem}\&lt;CR&gt;&lt;++&gt;\&lt;CR&gt;\\end{theorem}"</pre><p> + </p><p> + If the expansion uses special keys such as carriage return etc, then + use double-quotes and use the <code class="literal">"\&lt;key&gt;"</code> + notation for special keys. Backslashes have to be doubled. + </p><p> + You could even use strings returned by functions as the expansion by + using the <a class="link" href="#IMAP_PutTextWithMovement">IMAP_PutTextWithMovement()</a> + function. + </p><p> + If the name of the environment contains special characters (for + example, the <code class="literal">eqnarray*</code> environment), then use the + following form: + </p><pre class="programlisting">let g:Tex_Env_{'eqnarray*'} = + \ "\\begin{eqnarray*}\&lt;CR&gt;&lt;++&gt; &amp;=&amp; &lt;++&gt;\&lt;CR&gt;\\end{eqnarray*}&lt;++&gt;"</pre><p> + This will make pressing <code class="literal">&lt;F5&gt;</code> after + <code class="literal">eqnarray*</code> expand to + </p><pre class="programlisting">\begin{eqnarray*} + &lt;++&gt; &amp;=&amp; &lt;++&gt; +\end{eqnarray*}&lt;++&gt;</pre><p> + </p></div><div class="section" title="11.3.2 Tex_Com_name"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_Com_name"></a>11.3.2 Tex_Com_name</h4></div></div></div><p> + If you wish to define new expansions for fast command insertion as + described <a class="link" href="#latex-command-maps" title="3.2 Command Mappings">here</a>, or redefine + expansions from the default values in Latex-Suite, you will need to define + variables of the form <code class="literal">g:Tex_Com_{name}</code> where + <code class="literal">name</code> is a command name. For example, with the + setting + </p><pre class="programlisting">let g:Tex_Com_frac = "\\frac{&lt;++&gt;}{&lt;++&gt;}&lt;++&gt;"</pre><p> + pressing <code class="literal">&lt;F7&gt;</code> after typing + <code class="literal">frac</code> will change it to <code class="literal">\frac{&lt;++&gt;}{&lt;++&gt;}&lt;++&gt;</code> + </p><p> + See <a class="link" href="#Tex_Env_name" title="11.3.1 Tex_Env_name">Tex_Env_name</a> for additional + details on how to create this setting in various special + circumstances. + </p></div><div class="section" title="11.3.3 Enabling / disabling macros"><div class="titlepage"><div><div><h4 class="title"><a id="macro-enabling"></a>11.3.3 Enabling / disabling macros</h4></div></div></div><p> + The following variables disable various parts of the macro functionality + of Latex-Suite. See the links to the relevant sections to see what functionality + setting each of the variables to zero will take away. + </p><a id="Tex_EnvironmentMaps"></a><a id="Tex_EnvironmentMenus"></a><a id="Tex_FontMaps"></a><a id="Tex_FontMenus"></a><a id="Tex_SectionMaps"></a><a id="Tex_SectionMenus"></a><div class="informaltable"><table border="1"><colgroup><col></col><col></col><col></col></colgroup><thead><tr><th>Setting</th><th>Link to relevant section</th><th>Default Value</th></tr></thead><tbody><tr><td><code class="literal">g:Tex_EnvironmentMaps + </code></td><td><a class="link" href="#environment-mappings" title="3.1 Environment Mappings">Environment Mappings</a></td><td>1</td></tr><tr><td><code class="literal">g:Tex_EnvironmentMenus</code></td><td> </td><td>1</td></tr><tr><td><code class="literal">g:Tex_FontMaps </code></td><td><a class="link" href="#font-maps" title="3.3 Font Mappings">Font Mappings</a></td><td>1</td></tr><tr><td><code class="literal">g:Tex_FontMenus </code></td><td> </td><td>1</td></tr><tr><td><code class="literal">g:Tex_SectionMaps </code></td><td><a class="link" href="#section-mappings" title="3.4 Section Mappings">Section Mappings</a></td><td>1</td></tr><tr><td><code class="literal">g:Tex_SectionMenus </code></td><td> </td><td>1</td></tr></tbody></table></div></div><div class="section" title="11.3.4 g:Tex_UseMenuWizard"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_UseMenuWizard"></a>11.3.4 g:Tex_UseMenuWizard</h4></div></div></div><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>Boolean</td></tr><tr><td>Default Value</td><td><code class="literal">0</code></td></tr></tbody></table></div><p> + If this variable is set to 1, then when an environment is chosen from the + menu then for selected environments, Latex-Suite asks a series of + questions on the command line and inserts a template with the + corresponding fields already filled in. Setting this to zero will insert + a template with <a class="link" href="#place-holders" title="Place Holders">place-holders</a> + marking off the places where fields need to be filled. + </p></div><div class="section" title="11.3.5 g:Imap_FreezeImap"><div class="titlepage"><div><div><h4 class="title"><a id="Imap_FreezeImap"></a>11.3.5 g:Imap_FreezeImap</h4></div></div></div><p> + </p><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>boolean</td></tr><tr><td>Default Value</td><td><code class="literal">0</code></td></tr></tbody></table></div><p> + </p><p> + This option when set to 1, temporarily freezes Latex-Suite's macro + expansion. It might be useful when you are using some other keymap + which is causing excessive macro expansion. Use a buffer-local + variable of the same name if you wish to affect just the present + buffer. + </p><p> + </p></div><div class="section" title="11.3.6 g:Tex_CatchVisMapErrors"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_CatchVisMapErrors"></a>11.3.6 g:Tex_CatchVisMapErrors</h4></div></div></div><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>Boolean</td></tr><tr><td>Default Value</td><td><code class="literal">1</code></td></tr></tbody></table></div><p> + With so many visual maps, its helpful to have a way of catching typing + errors made in visual mode. What this does is to prompt you to correct + your visual mode mapping if you start out with <code class="literal"><a class="link" href="#Tex_Leader" title="11.3.8 g:Tex_Leader">g:Tex_Leader</a></code> and then type some + illegal keys. It basically maps just the <code class="literal">g:Tex_Leader</code> + character to a function. + </p></div><div class="section" title="11.3.7 g:Tex_Diacritics"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_Diacritics"></a>11.3.7 g:Tex_Diacritics</h4></div></div></div><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>Boolean</td></tr><tr><td>Default Value</td><td><code class="literal">0</code></td></tr></tbody></table></div><p> + Whether or not you want to use <a class="link" href="#diacritic-mappings" title="3.7 Diacritics">diacritics</a>. + </p></div><div class="section" title="11.3.8 g:Tex_Leader"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_Leader"></a>11.3.8 g:Tex_Leader</h4></div></div></div><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>String</td></tr><tr><td>Default Value</td><td><code class="literal">'`'</code></td></tr></tbody></table></div><p> + The mappings in Latex-Suite are by default prefixed with the back-tick + character. For example, <code class="literal">`/</code> inserts + <code class="literal">\frac{&lt;++&gt;}{&lt;++&gt;}&lt;++&gt;</code> etc. You can change the + prefix with the following setting. + <code class="literal">','</code>, <code class="literal">'/'</code>, + <code class="literal">'`'</code> are preferred values. <code class="literal">''</code> or + <code class="literal">'\'</code> will lead to a <span class="emphasis"><em>lot</em></span> of + trouble. + </p><p> + g:Tex_Leader is also used for visual mode mappings for fonts. + </p></div><div class="section" title="11.3.9 g:Tex_Leader2"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_Leader2"></a>11.3.9 g:Tex_Leader2</h4></div></div></div><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>String</td></tr><tr><td>Default Value</td><td><code class="literal">','</code></td></tr></tbody></table></div><p> + In order to avoid clashes between the large number of visual mode macros + provided, the <a class="link" href="#enclosing-env-threeletter" title="3.1.2.2 Method 2: Using three letter mappings">visual mode + macros for environments</a> and sections start with a character + different from <code class="literal">g:Tex_Leader</code>. + </p></div><div class="section" title="11.3.10 g:Tex_PromptedEnvironments"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_PromptedEnvironments"></a>11.3.10 g:Tex_PromptedEnvironments</h4></div></div></div><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>String</td></tr><tr><td>Default Value</td><td><code class="literal">'eqnarray*,eqnarray,equation,equation*,\[,$$,align,align*'</code></td></tr></tbody></table></div><p> + This string represents a comma separated list of fields corresponding to + environments. Pressing <code class="literal">&lt;F5&gt;</code> in insert-mode in + the body of the document asks you to choose from one of these + environments to insert. + </p><p> + Leaving this string empty will leave the <code class="literal">&lt;F5&gt;</code> + key unmapped + </p></div><div class="section" title="11.3.11 g:Tex_HotKeyMappings"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_HotKeyMappings"></a>11.3.11 g:Tex_HotKeyMappings</h4></div></div></div><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>String</td></tr><tr><td>Default Value</td><td><code class="literal">'eqnarray*,eqnarray,bmatrix'</code></td></tr></tbody></table></div><p> + This string represents a comma separated list of environments which are + mapped to <code class="literal">&lt;Shift-F-1&gt;</code> through + <code class="literal">&lt;Shift-F-4&gt;</code>. For example, pressing + <code class="literal">&lt;Shift-F-2&gt;</code> with this setting inserts the + <code class="literal">eqnarray</code> environment. + </p><p> + Leaving this string empty will leave <code class="literal">&lt;Shift-F-1&gt;</code> through + <code class="literal">&lt;Shift-F-4&gt;</code> unmapped. + </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> + Only the first four fields of this list are used. The rest are silently + ignored. + </p></div></div><div class="section" title="11.3.12 g:Tex_PromptedCommands"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_PromptedCommands"></a>11.3.12 g:Tex_PromptedCommands</h4></div></div></div><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>String</td></tr><tr><td>Default Value</td><td> + <code class="literal">'footnote,cite,pageref,label'</code> + </td></tr></tbody></table></div><p> + This string represents a comma separated list of LaTeX commands + which Latex-Suite uses for the <code class="literal">&lt;F7&gt;</code> and + <code class="literal">&lt;S-F7&gt;</code> maps as described <a class="link" href="#latex-command-maps" title="3.2 Command Mappings">here</a>. + </p><p> + Leaving this string empty will leave the <code class="literal">&lt;F7&gt;</code> + key unmapped. + </p></div><div class="section" title="11.3.13 Tex_ItemStyle_environment"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_ItemStyle_environment"></a>11.3.13 Tex_ItemStyle_environment</h4></div></div></div><p> + This setting affects the style which Latex-Suite uses to insert an + <code class="literal">\item</code> when <code class="literal">&lt;Alt-I&gt;</code> is + pressed as described <a class="link" href="#Alt-I" title="3.10.4 &lt;Alt-I&gt;">here</a>. By default + Latex-Suite defines styles for the following environments: + </p><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><thead><tr><th>Environment</th><th>Style</th></tr></thead><tbody><tr><td>itemize</td><td>\item </td></tr><tr><td>enumerate</td><td>\item </td></tr><tr><td>theindex</td><td>\item </td></tr><tr><td>thebibliography</td><td>\item[&lt;+biblabel+&gt;]{&lt;+bibkey+&gt;} &lt;++&gt;</td></tr><tr><td>description</td><td>\item[&lt;+label+&gt;] &lt;++&gt;</td></tr></tbody></table></div><p> + Each style is defined by a variable of the form + <code class="literal">g:Tex_ItemStyle_{envname}</code> where + <code class="literal">envname</code> is the name of the environment for which + the style is defined. For example, by default + </p><pre class="programlisting">g:Tex_ItemStyle_description = '\item[&lt;+label+&gt;] &lt;++&gt;'</pre><p> + Redefining the style for a particular environment or defining a style + for an entirely new environment is simply a matter of setting the + value of a variable of the corresponding name. + </p></div></div><div class="section" title="11.4 Smart Key Customization"><div class="titlepage"><div><div><h3 class="title"><a id="customizing-smart-keys"></a>11.4 Smart Key Customization</h3></div></div></div><p> + These settings affect the smart key functionality as described <a class="link" href="#smart-keys" title="3.9 Smart Key Mappings">here</a>. + </p><div class="section" title="11.4.1 g:Tex_SmartKeyBS"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_SmartKeyBS"></a>11.4.1 g:Tex_SmartKeyBS</h4></div></div></div><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>Boolean</td></tr><tr><td>Default Value</td><td><code class="literal">1</code></td></tr></tbody></table></div><p> + Whether or not <code class="literal">&lt;Backspace&gt;</code> deletes diacritics. + </p></div><div class="section" title="11.4.2 g:Tex_SmartKeyQuote"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_SmartKeyQuote"></a>11.4.2 g:Tex_SmartKeyQuote</h4></div></div></div><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>Boolean</td></tr><tr><td>Default Value</td><td><code class="literal">1</code></td></tr></tbody></table></div><p> + Whether or not the <a class="link" href="#smart-keys" title="3.9 Smart Key Mappings">smart quotes</a> + functionality is available. + </p><p> + If enabled, the quote characters can be customized by setting the + following variables: + </p><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><thead><tr><th>Setting</th><th>Value</th></tr></thead><tbody><tr><td><code class="literal">g:Tex_SmartQuoteOpen</code></td><td><code class="literal">"``"</code></td></tr><tr><td><code class="literal">g:Tex_SmartQuoteClose</code></td><td><code class="literal">"''"</code></td></tr></tbody></table></div><p> + Non-English users will want to change these settings to their locale. + These global variables will be ignored if there are buffer-local + variables (with the same name), which may be set in the language specific + package files, such as + <code class="literal">$VIM/ftplugin/latex-suite/packages/german</code>. + </p></div></div><div class="section" title="11.5 Latex Completion Customization"><div class="titlepage"><div><div><h3 class="title"><a id="customizing-latex-completion"></a>11.5 Latex Completion Customization</h3></div></div></div><p> + The following settings affect the <a class="link" href="#latex-completion" title="5 Latex Completion"> + completion</a> functionality in Latex-Suite. + </p><div class="section" title="11.5.1 Window size settings"><div class="titlepage"><div><div><h4 class="title"><a id="completion-window-preferences"></a>11.5.1 Window size settings</h4></div></div></div><p> + These three settings affect the aesthetics of the completion + functionality. + </p><a id="Tex_ViewerCwindowHeight"></a><a id="Tex_ViewerPreviewHeight"></a><a id="Tex_ExplorerHeight"></a><a id="Tex_ImageDir"></a><div class="informaltable"><table border="1"><colgroup><col></col><col></col><col></col></colgroup><thead><tr><th>Setting</th><th>Explanation</th><th>Default Value</th></tr></thead><tbody><tr><td><code class="literal">g:Tex_ViewerCwindowHeight</code></td><td>The height of the <code class="literal">cwindow</code> which displays the + list of <code class="literal">\label</code>s etc.</td><td>5</td></tr><tr><td><code class="literal">g:Tex_ViewerPreviewHeight</code></td><td>The height of the preview window which shows the context of a + <code class="literal">\label</code> etc.</td><td>10 </td></tr><tr><td><code class="literal">g:Tex_ExplorerHeight</code></td><td>The height of the explorer window which lists the files from + which to choose an image file.</td><td>10</td></tr><tr><td><code class="literal">g:Tex_ImageDir</code></td><td>The directory to scan for images</td><td>''</td></tr></tbody></table></div></div><div class="section" title="11.5.2 g:Tex_BIBINPUTS"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_BIBINPUTS"></a>11.5.2 g:Tex_BIBINPUTS</h4></div></div></div><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>string</td></tr><tr><td>Default Value</td><td><code class="literal">''</code></td></tr></tbody></table></div><p> + This string describes the directories which are scanned while trying + to search for <code class="literal">.bib</code> and <code class="literal">.bbl</code> + files. See the <a class="link" href="#latex-completion-cite" title="5.3 Latex-Suite \cite completion">cite completion + section</a> for more details. + </p><p> + This string should be set in the syntax accepted by Vim's native + <code class="literal">'path'</code> setting. Do not include the present + directory <code class="literal">'.'</code>. While searching for + <code class="literal">bibliography</code> files, the present directory will be + prepended to this variable. + </p></div><div class="section" title="11.5.3 Tex_UseSimpleLabelSearch"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_UseSimpleLabelSearch"></a>11.5.3 Tex_UseSimpleLabelSearch</h4></div></div></div><p> + When set to 1, Latex-Suite searches for <code class="literal">\label</code>s in all + <code class="literal">.tex</code> files in the directory containing the file + being edited when &lt;F9&gt; is pressed. See <a class="link" href="#ls-completion-ref" title="5.2 Latex-Suite \ref completion">\ref completion</a> for details. + </p></div><div class="section" title="11.5.4 g:Tex_ProjectSourceFiles"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_ProjectSourceFiles"></a>11.5.4 g:Tex_ProjectSourceFiles</h4></div></div></div><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>String</td></tr><tr><td>Default Value</td><td><code class="literal">''</code></td></tr></tbody></table></div><p> + This setting is meant to be initialized on a per-project basis using + the <a class="link" href="#latex-master-file" title="9.2 Specifying which file to compile">Latex-Suite master file</a> as + described in <a class="link" href="#latex-project" title="9 Multiple file LaTeX projects">Latex-Suite Project</a> + section. It is a list of source files which are used in the project. + If defined, then instead of using the logic described in + <a class="link" href="#Tex_UseSimpleLabelSearch" title="11.5.3 Tex_UseSimpleLabelSearch">Tex_UseSimpleLabelSearch</a> to + search for files in which to search for <code class="literal">\label</code>s, we + simply search for <code class="literal">\label</code>s in this list. This + significantly reduces the time it takes to generate the list of + possible completions for large projects. + </p><p> + The list is specified as a whitespace separated list of filenames + relative to the location of the main file. + </p></div><div class="section" title="11.5.5 g:Tex_RememberCiteSearch"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_RememberCiteSearch"></a>11.5.5 g:Tex_RememberCiteSearch</h4></div></div></div><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>Boolean</td></tr><tr><td>Default Value</td><td><code class="literal">0</code></td></tr></tbody></table></div><p> + When this variable is non-zero, then Latex-Suite will try to remember results + from the <code class="literal">\cite</code> completion as described in <a class="link" href="#cite-search-caching" title="5.3.1 Caching the \cite completion results">this section</a>. + </p></div></div><div class="section" title="11.6 Compiler Customization"><div class="titlepage"><div><div><h3 class="title"><a id="customizing-compiling"></a>11.6 Compiler Customization</h3></div></div></div><p> + The following settings affect Latex-Suite's compilation functionality + </p><div class="section" title="11.6.1 g:Tex_DefaultTargetFormat"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_DefaultTargetFormat"></a>11.6.1 g:Tex_DefaultTargetFormat</h4></div></div></div><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>String</td></tr><tr><td>Default Value</td><td><code class="literal">dvi</code> for windows/*nix and + <code class="literal">pdf</code> for mac</td></tr></tbody></table></div><p> + Use this setting to choose the default target format. For example, + setting this to <code class="literal">pdf</code> makes Latex-Suite compile a pdf file + when you press <code class="literal">\ll</code> and fire up the + <code class="literal">pdf</code> viewer on pressing <code class="literal">\lv</code>. Make + sure that a rules for compiling and viewing have been defined for this + target format as described <a class="link" href="#Tex_CompileRule_format" title="11.6.2 g:Tex_CompileRule_&lt;format&gt;">here</a> and <a class="link" href="#Tex_ViewRule_format" title="11.7.1 g:Tex_ViewRule_&lt;format&gt;">here</a>. + </p></div><div class="section" title="11.6.2 g:Tex_CompileRule_&lt;format&gt;"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_CompileRule_format"></a>11.6.2 g:Tex_CompileRule_&lt;format&gt;</h4></div></div></div><p> + Here <code class="literal">&lt;format&gt;</code> refers to the target format for + which this rule is defined. Latex-Suite supports compiling into + <code class="literal">dvi</code>, <code class="literal">ps</code> and <code class="literal">pdf</code> + by default. All these rules are strings defined by default as follows: + </p><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td><code class="literal">g:Tex_CompileRule_dvi</code></td><td><code class="literal">'latex -interaction=nonstopmode $*'</code></td></tr><tr><td><code class="literal">g:Tex_CompileRule_ps</code></td><td><code class="literal">'ps2pdf $*'</code></td></tr><tr><td><code class="literal">g:Tex_CompileRule_pdf</code></td><td><code class="literal">'pdflatex -interaction=nonstopmode $*'</code></td></tr></tbody></table></div><p> + If you desire forward and inverse searching via Latex-Suite, you will need to + change <code class="literal">g:Tex_CompileRule_dvi</code> to include + <code class="literal">-src-specials</code>. However, this has been known to cause + problems with the output file. Therefore, use this with care. + </p></div><div class="section" title="11.6.3 g:Tex_FormatDependency_&lt;format&gt;"><div class="titlepage"><div><div><h4 class="title"><a id="id480810"></a>11.6.3 g:Tex_FormatDependency_&lt;format&gt;</h4></div></div></div><p> + </p><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>string</td></tr><tr><td>Default Value</td><td><code class="literal">''</code></td></tr></tbody></table></div><p> + By default, there are no format dependencies defined. Each definition + is of the form above where <code class="literal">&lt;format&gt;</code> is a + string such as <code class="literal">'dvi'</code> etc. + </p><p> + The value of each string is a comma separated string such as 'dvi,ps'. + See the <a class="link" href="#compiler-dependency" title="6.2 Handling dependencies in compilation">Compiler dependency</a> + section to see how to use/specify this setting + </p></div><div class="section" title="11.6.4 g:Tex_MultipleCompileFormats"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_MultipleCompileFormats"></a>11.6.4 g:Tex_MultipleCompileFormats</h4></div></div></div><p> + </p><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>string</td></tr><tr><td>Default Value</td><td><code class="literal">'dvi'</code></td></tr></tbody></table></div><p> + </p><p> + This is a comma separated string of formats for which the compiler + needs to be called multiple times in order to get cross-references, + citations etc right. See the <a class="link" href="#compiling-multiple" title="6.3 Compiling multiple times">Compiling multiple times</a> section + for details. + </p></div><div class="section" title="11.6.5 g:Tex_IgnoredWarnings"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_IgnoredWarnings"></a>11.6.5 g:Tex_IgnoredWarnings</h4></div></div></div><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>String</td></tr><tr><td>Default Value</td><td><code class="literal">a new-line separated list of patterns as described + below</code></td></tr></tbody></table></div><p> + The default value of this setting is + </p><pre class="programlisting">\"Underfull\n". +\"Overfull\n". +\"specifier changed to\n". +\"You have requested\n". +\"Missing number, treated as zero.\n". +\"There were undefined references\n" +\"Citation %.%# undefined"</pre><p> + This setting defines a set of patterns which will be filtered out when + displaying the output from the latex compiler. This is to aid in + filtering out very common warnings/errors. + </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> + Remember to check the value of <a class="link" href="#Tex_IgnoreLevel" title="11.6.6 g:Tex_IgnoreLevel"><code class="literal">g:Tex_IgnoreLevel</code></a> + when you change this setting. For example, if you append a new pattern + which you would like to ignore by default, increase the value of + <code class="literal">g:Tex_IgnoreLevel</code>. + </p></div></div><div class="section" title="11.6.6 g:Tex_IgnoreLevel"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_IgnoreLevel"></a>11.6.6 g:Tex_IgnoreLevel</h4></div></div></div><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>Integer</td></tr><tr><td>Default Value</td><td><code class="literal">7</code></td></tr></tbody></table></div><p> + This setting defines a "filter level" or an "ignore level". A value of 7 + for instance means that any warning/error matching with any of the first + 7 fields of <a class="link" href="#Tex_IgnoredWarnings" title="11.6.5 g:Tex_IgnoredWarnings"><code class="literal">g:Tex_IgnoredWarnings</code></a> + will be ignored. Setting this value to zero will mean that no + error/warning is ignored. However, even with a value of zero, Latex-Suite will + filter out most of the text which a LaTeX compiler typically produces. + Use + </p><pre class="programlisting">TCLevel strict</pre><p> + from within Vim in order to see all the lines from the compiler's + output. + </p></div><div class="section" title="11.6.7 Tex_UseMakefile"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_UseMakefile"></a>11.6.7 Tex_UseMakefile</h4></div></div></div><p> + </p><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>boolean</td></tr><tr><td>Default Value</td><td><code class="literal">1</code></td></tr></tbody></table></div><p> + </p><p> + When set to 1, then if a <code class="literal">makefile</code> or + <code class="literal">Makefile</code> is present in the current directory, then + Latex-Suite sets the <code class="literal">makeprg</code> option to just + <code class="literal">"make &lt;target&gt;"</code>, where + <code class="literal">&lt;target&gt;</code> is the target format chosen using + the <code class="literal">TCTarget</code> or <code class="literal">TTarget</code> + commands. + </p><p> + </p><p> + When set to 0, then Latex-Suite will set the <code class="literal">makeprg</code> + setting to whatever is defined by the <a class="link" href="#Tex_CompileRule_format" title="11.6.2 g:Tex_CompileRule_&lt;format&gt;">g:Tex_CompileRule_target</a> + setting. + </p><p> + </p></div><div class="section" title="11.6.8 g:Tex_GotoError"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_GotoError"></a>11.6.8 g:Tex_GotoError</h4></div></div></div><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>boolean</td></tr><tr><td>Default Value</td><td><code class="literal">1</code></td></tr></tbody></table></div><p> + If set to 1, then pressing <code class="literal">\ll</code> will take you to + the location of the first warning/error, otherwise you will remain in + the original location but the errors/warnings will be listed in the + preview window. + </p></div></div><div class="section" title="11.7 Viewer Customization"><div class="titlepage"><div><div><h3 class="title"><a id="customizing-viewing"></a>11.7 Viewer Customization</h3></div></div></div><p> + The following settings affect how Latex-Suite will display compiled files. + </p><div class="section" title="11.7.1 g:Tex_ViewRule_&lt;format&gt;"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_ViewRule_format"></a>11.7.1 g:Tex_ViewRule_&lt;format&gt;</h4></div></div></div><p> + Here <code class="literal">&lt;format&gt;</code> refers to a format such as + <code class="literal">dvi</code>, <code class="literal">ps</code>, etc. This variable defines + the program which will be called to display a file of that format. + </p><p> + By default, Latex-Suite defines viewer programs for viewing DVI, PS and PDF + formats as follows: + </p><div class="informaltable"><table border="1"><colgroup><col></col><col></col><col></col></colgroup><thead><tr><th> </th><th>Windows</th><th>Unix</th></tr></thead><tbody><tr><td><code class="literal">g:Tex_ViewRule_dvi</code></td><td><code class="literal">'yap -1'</code></td><td><code class="literal">'xdvi'</code></td></tr><tr><td><code class="literal">g:Tex_ViewRule_ps</code></td><td><code class="literal">'gsview32'</code></td><td><code class="literal">'ghostview'</code></td></tr><tr><td><code class="literal">g:Tex_ViewRule_pdf</code></td><td><code class="literal">'AcroRd32'</code></td><td><code class="literal">'xpdf'</code></td></tr></tbody></table></div><p> + For Macintosh systems, these strings are left empty by default. This lets + the system pick the program for each format. If you define these variables + for Mac, the system choice will be over-ridden. + </p><p> + Latex-Suite appends <code class="literal">file.format</code> to the above settings + while calling the external programs. For example, with + </p><pre class="programlisting">let g:Tex_ViewRule_dvi = 'yap -1'</pre><p> + <code class="literal">yap</code> is called as + </p><pre class="programlisting">!start yap -1 file.dvi</pre><p> from within + Vim. (The initial <code class="literal">start</code> is used on + <code class="literal">Windows</code> platforms is to make <code class="literal">yap</code> + start as a separate process.) If you find the way Latex-Suite constructs the + command line too restrictive, you can use the <a class="link" href="#Tex_ViewRuleComplete_format" title="11.7.2 Tex_ViewRuleComplete_&lt;format&gt;"><code class="literal">Tex_ViewRuleComplete_format</code></a> + setting for more complete control on how the command line is + constructed while calling the external program for viewing. + </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> + For windows, you will need to set the <code class="literal">$PATH</code> variable + to include the paths to <code class="literal">yap</code>, + <code class="literal">AcroRd32</code>, <code class="literal">gsview32</code> and any other + programs. See your system documentation for how to do this. + </p></div><div class="note" title="Default Viewing Format" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Default Viewing Format</h3><p> + To change the default format for viewing files, set the <a class="link" href="#Tex_DefaultTargetFormat" title="11.6.1 g:Tex_DefaultTargetFormat">g:Tex_DefaultTargetFormat</a> + variable. + </p></div></div><div class="section" title="11.7.2 Tex_ViewRuleComplete_&lt;format&gt;"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_ViewRuleComplete_format"></a>11.7.2 Tex_ViewRuleComplete_&lt;format&gt;</h4></div></div></div><p> + Here <code class="literal">&lt;format&gt;</code> refers to the extension of a + output format such as <code class="literal">dvi</code>, <code class="literal">html</code> + etc. + </p><p> + <code class="literal">Tex_ViewRuleComplete_format</code> takes precedence over + <code class="literal">Tex_ViewRule_format</code> if both are specified. By + default, Latex-Suite does not define values for + <code class="literal">Tex_ViewRuleComplete_format</code> for any + <code class="literal">format</code>. Unlike in the case of + <code class="literal">Tex_ViewRule_format</code>, Latex-Suite does not modify + <code class="literal">Tex_ViewRuleComplete_format</code> at all in constructing + the command line. The only modification is to substitute + <code class="literal">'$*'</code> everywhere in the string with the name of the + file being viewed (without the extension). + </p><div class="note" title="IMPORTANT" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">IMPORTANT</h3><p> + Make sure you make the process go into the background otherwise vim + will wait for the viewer to terminate before letting you edit the file + again. + </p><p> + To make a process go into the background on a <code class="literal">*nix</code> + platform, use a trailing <code class="literal">&amp;</code> in the setting. On + <code class="literal">Windows</code>, use <code class="literal">start</code> at the + beginning of the setting. Example: Suppose you have a latex-&gt;html + converter which converts a file say foo.tex to a file foo/index.html. + Then you would use: + </p><pre class="programlisting">" On *nix platform +let g:Tex_ViewRuleComplete_html = 'MozillaFirebird $*/index.html &amp;' +" On windows platform +let g:Tex_ViewRuleComplete_html = 'start MozillaFirebird $*/index.html'</pre><p> + </p></div></div></div><div class="section" title="11.8 Menu Customization"><div class="titlepage"><div><div><h3 class="title"><a id="customizing-menus"></a>11.8 Menu Customization</h3></div></div></div><p> + In addition to using the variables defined in this section to affect + the menu-layout permanently (i.e, the layout Latex-Suite will start with), you + can also use the <code class="literal">TeX-Suite &gt; Configure Menu</code> menu to + dynamically configure the menu layout after Latex-Suite has started. + </p><div class="section" title="11.8.1 g:Tex_Menus"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_Menus"></a>11.8.1 g:Tex_Menus</h4></div></div></div><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>Boolean</td></tr><tr><td>Default Value</td><td><code class="literal">1</code></td></tr></tbody></table></div><p> + If set to 0, Latex-Suite will suppress showing all menus. Useful if you mostly + work in terminals. + </p></div><div class="section" title="11.8.2 g:Tex_MainMenuLocation"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_MainMenuLocation"></a>11.8.2 <code class="literal">g:Tex_MainMenuLocation</code></h4></div></div></div><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>number</td></tr><tr><td>Default Value</td><td><code class="literal">80</code></td></tr></tbody></table></div><p> + This setting decides the location of the first top-level Latex-Suite + menu. You can for example shift all the menus created by Latex-Suite + to the very end by setting this value to a large number like 990. + </p></div><div class="section" title="11.8.3 g:Tex_MathMenus"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_MathMenus"></a>11.8.3 g:Tex_MathMenus</h4></div></div></div><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>Boolean</td></tr><tr><td>Default Value</td><td><code class="literal">1</code></td></tr></tbody></table></div><p> + The <code class="literal">Tex-Math</code> menu consists of hundreds of mathematical + symbols used in LaTeX. This menu comprises about 75% of the menus. + </p></div><div class="section" title="11.8.4 g:Tex_NestElementMenus"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_NestElementMenus"></a>11.8.4 g:Tex_NestElementMenus</h4></div></div></div><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>Boolean</td></tr><tr><td>Default Value</td><td><code class="literal">1</code></td></tr></tbody></table></div><p> + This setting controls the "compactness" of the menus. If set to 1, then the + Font, Counter and Dimensioning menus are collected together in a single + menu called <code class="literal">Tex-Elements</code>, otherwise, they will each get + a separate menu. + </p></div><div class="section" title="11.8.5 g:Tex_PackagesMenu"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_PackagesMenu"></a>11.8.5 g:Tex_PackagesMenu</h4></div></div></div><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>Boolean</td></tr><tr><td>Default Value</td><td><code class="literal">1</code></td></tr></tbody></table></div><p> + Setting this to zero will stop Latex-Suite from automatically creating the + <code class="literal">TeX-Suite &gt; Packages &gt; Supported</code> menu at startup. You + can still create the menu after startup by going to + <code class="literal">TeX-Suite &gt; Configure Menu</code>. + </p></div><div class="section" title="11.8.6 g:Tex_NestPackagesMenu"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_NestPackagesMenu"></a>11.8.6 g:Tex_NestPackagesMenu</h4></div></div></div><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>String</td></tr><tr><td>Default Value</td><td><code class="literal">'TeX-'</code></td></tr></tbody></table></div><p> + This string is the prefix added to all the menus created by Latex-Suite. If you + define this variable with a dot (<code class="literal">'.'</code>) as the last + character, then all the menus created by Latex-Suite will be nested under a + single master menu. For example, set this to + <code class="literal">'&amp;LaTeX-Suite.'</code> to nest all menus under a menu + called <code class="literal">&amp;LaTeX-Suite</code>. + </p></div><div class="section" title="11.8.7 g:Tex_UseUtfMenus"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_UseUtfMenus"></a>11.8.7 g:Tex_UseUtfMenus</h4></div></div></div><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>Boolean</td></tr><tr><td>Default Value</td><td><code class="literal">0</code></td></tr></tbody></table></div><p> + This setting controls whether Latex-Suite uses utf-8 symbols to display some of + the mathematical symbols in the <code class="literal">TeX-Math</code> menu. It is + necessary for your system/GUI to support utf-8. Setting this to 1 has the + side-effect of setting the <code class="literal">'encoding'</code> option of Vim + to 'utf-8'. + </p></div></div><div class="section" title="11.9 Folding Customization"><div class="titlepage"><div><div><h3 class="title"><a id="customizing-folding"></a>11.9 Folding Customization</h3></div></div></div><p> + The following settings control the <a class="link" href="#latex-folding" title="8 Latex Folding">folding</a> functionality of Latex-Suite. + </p><div class="section" title="11.9.1 g:Tex_Folding"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_Folding"></a>11.9.1 g:Tex_Folding</h4></div></div></div><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>Boolean</td></tr><tr><td>Default Value</td><td><code class="literal">1</code></td></tr></tbody></table></div><p> + Setting this to zero completely disables Latex-Suite's folding functionality. + However, the <code class="literal">TexFoldTextFunction()</code> is still available + in case you want to use another folding scheme but still want to continue + using the fold text function. + </p></div><div class="section" title="11.9.2 g:Tex_AutoFolding"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_AutoFolding"></a>11.9.2 g:Tex_AutoFolding</h4></div></div></div><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>Boolean</td></tr><tr><td>Default Value</td><td><code class="literal">1</code></td></tr></tbody></table></div><p> + This setting controls whether Latex-Suite automatically creates manual folds for + a file when it is opened. You can still use the <code class="literal">\rf</code> + mapping to refresh/create folds even when this variable is set to zero. + </p></div></div><div class="section" title="11.10 Package Handling Customization"><div class="titlepage"><div><div><h3 class="title"><a id="customizing-packages"></a>11.10 Package Handling Customization</h3></div></div></div><p> + These settings affect the <a class="link" href="#custom-packages" title="4.3.1 Custom Packages">custom + packages</a> functionality in Latex-Suite + </p><div class="section" title="11.10.1 g:Tex_TEXINPUTS"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_TEXINPUTS"></a>11.10.1 g:Tex_TEXINPUTS</h4></div></div></div><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>string</td></tr><tr><td>Default Value</td><td><code class="literal">''</code></td></tr></tbody></table></div><p> + This setting describes the directories scanned by Latex-Suite while searching + for custom user packages as described in the <a class="link" href="#custom-packages" title="4.3.1 Custom Packages">custom packages</a> section. Do not + include the present directory in this setting. The present directory + is always scanned for custom packages. + </p><p> + This string should be set in the syntax accepted by Vim's native + <code class="literal">'path'</code> setting. + </p></div></div></div><div class="section" title="12 Credits"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="latex-suite-credits"></a>12 Credits</h2></div></div></div><p> + And finally, the credits: + </p><div class="informaltable"><table border="0"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Artur R. Czechowski</td><td>maintains the BSD package of Latex-Suite. Lots of valuable + feedback.</td></tr><tr><td> + Lubomir Host + </td><td> + provided the diacritics and also helped in development. + + </td></tr><tr><td> + Alexander Wagner + </td><td> + valuable suggestions during development. + + </td></tr><tr><td> + Luc Hermitte + </td><td> + his variation of Stephen Riehm's bracketing system is used + in Latex-Suite. + + </td></tr><tr><td> + Gergely Kontra + </td><td> + the clever little JumpFunc() in imaps.vim is due to him. + The implementation of the templates also borrows from + mu-template.vim by him. + + </td></tr><tr><td> + Dimitri Antoniou + </td><td> + author of ltags and also provided the nice tip about + forward / reverse search on DVI documents. + + </td></tr><tr><td> + Stephen Riehm + </td><td> + the extremely helpful bracketing system is from him. + + </td></tr><tr><td> + Alan Schmitt + </td><td> + provided macros/folding elements. Continued feedback, + bug-reports/fixes. + + </td></tr><tr><td> + Hari Krishna Dara + </td><td> + for ExecMap(), the clever little function which makes + typing visual mode mappings so much easier and error-free. + + </td></tr><tr><td> + Alan G Isac + </td><td> + for the comprehensive BibT() function for entering bibtex + entries. + + </td></tr><tr><td> + Gontran Baerts + </td><td> + for libList.vim + + </td></tr><tr><td> + Peter Heslin + </td><td> + useful discussion and also a lot of bug fixes. + the %%fakesection in folding.vim. + + </td></tr><tr><td> + Zhang Lin-bo + </td><td> + lots of very useful additions to folding. The code for customizing + the folding scheme is due to him. + </td></tr></tbody></table></div><p> + A large number of functions in Latex-Suite come from various other people. + Some of those people might have been missed here. Each function should however + have the author's name/e-mail above it. Thats the more authoritative place to + check out who has done what. + </p><a id="latex-suite-maintainer"></a><p> + The current maintainer(s) of Latex-Suite is(are) + </p><table border="0" summary="Simple list" class="simplelist"><tr><td>Srinath Avadhanula &lt;srinath@fastmail.fm&gt;</td></tr><tr><td>Mikolaj Machowski &lt;mikmach@wp.pl&gt;</td></tr><tr><td>Benji Fisher &lt;benji@member.AMS.org&gt;</td></tr></table></div></div></body></html> diff --git a/.vim/doc/latex-suite.txt b/.vim/doc/latex-suite.txt @@ -0,0 +1,3460 @@ + Latex-Suite Reference + *latex-suite.txt* + Srinath Avadhanula <srinath AT fastmail DOT fm> + Mikolaj Machowski <mikmach AT wp DOT pl> + + + + Abstract + ======== +Latex-Suite attempts to provide a comprehensive set of tools to view, edit and +compile LaTeX documents in Vim. Together, they provide tools starting from +macros to speed up editing LaTeX documents to functions for forward searching +.dvi documents. Latex-Suite has been possible because of the contributions of +many people. Please see latex-suite-credits [|ls_a_dU|] for a list of people who +have helped. + +Latex-Suite is released under the Vim charityware license. For license and +conditions of use look at |copyright|. Replace all occurrences of ``Vim'' with +``Latex-Suite''. The current copyright holders of Latex-Suite are Srinath +Avadhanula and Mikolaj Machowski. + +Homepage: http://vim-latex.sourceforge.net |ls_u_1| + + + + *latex-suite.txt-toc* +|ls_1| Installation and recommended Settings +|ls_2| Inserting Templates +|ls_3| Latex-Suite Macros + |ls_3_1| Environment Mappings + |ls_3_2| Command Mappings + |ls_3_3| Font Mappings + |ls_3_4| Section Mappings + |ls_3_5| Greek Letter Mappings + |ls_3_6| Auc-Tex Key Bindings + |ls_3_7| Diacritics + |ls_3_8| BibTeX Shortcuts + |ls_3_9| Smart Key Mappings + |ls_3_10| Alt Key Macros + |ls_3_11| Custom Macros + |ls_3_12| Making your own Macros via IMAP() +|ls_4| Package Handling + |ls_4_1| Inserting package commands + |ls_4_2| Actions taken for supported packages + |ls_4_3| Automatic Package detection + |ls_4_4| Writing supporting for a package +|ls_5| Latex Completion + |ls_5_1| Latex-Suite completion example + |ls_5_2| Latex-Suite \ref completion + |ls_5_3| Latex-Suite \cite completion + |ls_5_4| Latex-Suite filename completion + |ls_5_5| Custom command completion +|ls_6| LaTeX Compiling + |ls_6_1| Setting Compilation rules + |ls_6_2| Handling dependencies in compilation + |ls_6_3| Compiling multiple times + |ls_6_4| Customizing the compiler output + |ls_6_5| Compiling parts of a file +|ls_7| Latex Viewing and Searching + |ls_7_1| Setting Viewing rules + |ls_7_2| Forward Searching documents + |ls_7_3| Inverse Searching +|ls_8| Latex Folding + |ls_8_1| Default Folding Scheme in Latex-Suite + |ls_8_2| Customizing what to fold + |ls_8_3| Editing the folding.vim file directly +|ls_9| Multiple file LaTeX projects + |ls_9_1| Latex-Suite project settings + |ls_9_2| Specifying which file to compile +|ls_10| Latex-Suite Commands and Maps + |ls_10_1| Latex-Suite Maps + |ls_10_2| Latex Suite Commands +|ls_11| Customizing Latex-Suite + |ls_11_1| General Settings + |ls_11_2| Place-Holder Customization + |ls_11_3| Macro Customization + |ls_11_4| Smart Key Customization + |ls_11_5| Latex Completion Customization + |ls_11_6| Compiler Customization + |ls_11_7| Viewer Customization + |ls_11_8| Menu Customization + |ls_11_9| Folding Customization + |ls_11_10| Package Handling Customization +|ls_12| Credits + +================================================================================ +Viewing this file + +This file can be viewed with all the sections and subsections folded to ease +navigation. By default, vim does not fold help documents. To create the folds, +press za now. The folds are created via a foldexpr which can be seen in the +last section of this file. + +See |usr_28.txt| for an introduction to folding and |fold-commands| for key +sequences and commands to work with folds. + +================================================================================ +Installation and recommended Settings *ls_1* *ls_a_bc* + *recommended-settings* + + + +If you are reading this, it most probably means that you have already installed +Latex-Suite and the help files. If this is not the case, follow the detailed +instructions on Latex-Suite's download page |ls_u_2|. + +Make sure that you create a few necessary settings in your ~/.vimrc. > + + " REQUIRED. This makes vim invoke Latex-Suite when you open a tex file. + filetype plugin on + + " IMPORTANT: win32 users will need to have 'shellslash' set so that latex + " can be called correctly. + set shellslash + + " IMPORTANT: grep will sometimes skip displaying the file name if you + " search in a singe file. This will confuse Latex-Suite. Set your grep + " program to always generate a file-name. + set grepprg=grep\ -nH\ $* + + " OPTIONAL: This enables automatic indentation as you type. + filetype indent on + + " OPTIONAL: Starting with Vim 7, the filetype of empty .tex files defaults to + " 'plaintex' instead of 'tex', which results in vim-latex not being loaded. + " The following changes the default filetype back to 'tex': + let g:tex_flavor='latex' + + + +In addition, the following settings could go in your ~/.vim/ftplugin/tex.vim +file: > + " this is mostly a matter of taste. but LaTeX looks good with just a bit + " of indentation. + set sw=2 + " TIP: if you write your \label's as \label{fig:something}, then if you + " type in \ref{fig: and press <C-n> you will automatically cycle through + " all the figure labels. Very useful! + set iskeyword+=: + + + +================================================================================ +Inserting Templates *ls_2* *ls_a_bd* + *latex-suite-templates* + + + +This functionality is available via the TeX-Suite > Templates menu. This module +provides a way to insert custom templates at the beginning of the current file. + +When Latex-Suite first starts up, it scans the +$VIM/ftplugin/latex-suite/templates/ directory and creates menu items based on +the files found there. When you select a template from this menu, the file will +be read in above the first line of the current file. + +A template file can utilize placeholders for initializing the cursor position +when the template is read in and subsequent movement. In addition, template +files can contain dynamic elements such as the time of creation of a file etc, +by using vim expressions. + +You can place your own templates in the $VIM/ftplugin/latex-suite/templates/ +directory in order for them to be available via the menu. Unless Latex-Suite +releases a template with the same name, these files should not get over-written +when you install a new release over an existing one. + +NOTE: Templates are also accessible for non-gui users with the command + |:TTemplate|. The argument should be name of the corresponding template + file. If the command is called without arguments (preferred usage), then a + list of available templates is displayed and the user is asked to choose + one of them. + + + +================================================================================ +Latex-Suite Macros *ls_3* *ls_a_be* + *latex-macros* + +|ls_3_1| Environment Mappings +|ls_3_2| Command Mappings +|ls_3_3| Font Mappings +|ls_3_4| Section Mappings +|ls_3_5| Greek Letter Mappings +|ls_3_6| Auc-Tex Key Bindings +|ls_3_7| Diacritics +|ls_3_8| BibTeX Shortcuts +|ls_3_9| Smart Key Mappings +|ls_3_10| Alt Key Macros +|ls_3_11| Custom Macros +|ls_3_12| Making your own Macros via IMAP() + + +Latex-Suite ships with a very comprehensive set of insert mode and |visual-mode| +mappings and menu items to typeset most of the LaTeX elements. + +NOTE: These mappings are are not standard mappings in the sense that only the + last character is mapped. See plugin/imaps.vim for further documentation. + For example, in the case of the mapping EFI provided by Latex-Suite you + can press the characters 'E', 'F' and 'I' as slowly as you wish (unlike + the normal imap command where timeout issues are involved). The characters + are visible as you type them (unlike normal imaps) and you can use the + movement or backspace key to correct yourself unlike normal mappings. + + + *place-holder* *ls_a_dV* + *place-holders* *ls_a_eD* +NOTE: Place Holders + ------------- + Almost all macros provided in Latex-Suite implement Stephen Riem's + bracketing system and Gergely Kontra's JumpFunc() for handling + place-holders. This consists of using "place-holders" to mark off + locations where the next relevant editing has to be done. As an example, + when you type EFI in |insert-mode|, you will get the following: > + \begin{figure}[h] + \centerline{\psfig{figure=<+eps file+>}} + \caption{<+caption text+>} + \label{fig:<+label+>} + \end{figure}<++> +< The text <+eps file+> will be selected and you will be left in + |select-mode| so that you can continue typing straight away. After having + typed in the file name, you can press <Ctrl-J> (while still in + insert-mode). This will take you directly to the next "place-holder". i.e, + <+caption text+> will be visually selected with Vim in select mode again + for typing in the caption. This saves on a lot of key presses. + + + *overriding-macros* *ls_a_eE* +NOTE: Over-riding Latex-Suite Macros + ------------------------------ + If you wish to change these macros from their default values, for example, + if you wish to change `w to expand to \omega instead of its default + expansion to \wedge, you should use the IMAP function as described in the + Using IMAP() [|ls_a_bG|] section. + + An important thing to note is that if you wish to over-ride macros created + by Latex-Suite rather than merely create new macros, you should place the + IMAP() calls in a script which gets sourced after the files in + Latex-Suite. A good place typically is as a file-type plugin file in the + ~/.vim/after/ftplugin/ directory. (Use ~/vimfiles if you are using + WINDOWS). For example to over-ride `w to \omega instead of \wedge, place + the following line in (say) ~/.vim/after/ftplugin/tex_macros.vim: > + call IMAP('`w', '\omega', 'tex') +< + + NOTE: It is important to use a file-name which will get sourced on a + FileType event. Therefore you must use a file-name which conforms to + the standards as described in |ftplugin-name|. + + + + *pausing-imaps* *ls_a_eF* +NOTE: Pausing Macro expansion + ----------------------- + If you wish to temporarily suspend the imaps functionality, then you can + set the Imap_FreezeImap to 1. If you set g:Imap_FreezeImap to 1, then it + will be a system-wide setting. Setting b:Imap_FreezeImap will affect only + the current buffer. + + +The following sections describe the various editing macros provided by +Latex-Suite. + + +-------------------------------------------------------------------------------- +Environment Mappings *ls_3_1* *ls_a_bf* + *environment-mappings* + +Latex-Suite provides a rich set of mappings to insert, enclose and modify LaTeX +environments, i.e, \begin{...} ... \end{...} pairs. + +Inserting Environments *ls_3_1_1* *ls_a_bg* + *inserting-environments* + +Latex-Suite provides the following ways to insert environments + + + +Method 1: Pressing <F5> *ls_3_1_1_1* *ls_a_bh* + *inserting-env-f5* + +If you press <F5> in the insert or normal mode while on an empty line, +Latex-Suite prompts you with a list of environments you might want to insert. +You can either choose one from the list or type in a new environment name. If +you press <F5> on a line which already has a word, then that word is used +instead of prompting. + +See Tex_Env_name [|ls_a_cZ|] for a description of how Latex-Suite uses the word +to form the expansion and how to modify Latex-Suite's behavior. + +The list of environments which Latex-Suite prompts you with (when <F5> is +pressed on an empty line) is formed from the Tex_PromptedEnvironments +[|ls_a_di|] setting. + +In addition to this setting, Latex-Suite also lists environments found in custom +packages as described in the section Package actions. [|ls_a_bL|] + + +Method 2: Using <S-F1>-<S-F4> *ls_3_1_1_2* *ls_a_bi* + *inserting-env-shift-f1* + +The shifted function keys, <S-F1> to <S-F4> can be mapped to insert very +commonly used environments. The environments mapped to each key can be +customized via the g:Tex_HotKeyMappings [|ls_a_dj|] setting. + + +Method 3: Using three letter sequences *ls_3_1_1_3* *ls_a_bj* + *inserting-env-threeletter* + +Environments can also be inserted by pressing a 3 capital letter sequence +starting with an E. The sequence of 3 letters generally tries to follow the +following rules: + + +1. All environment mappings begin with E + +2. If the environment can be broken up into 2 distinct words, such as flushright + (flush + right), then the next 2 letters are the first letters of the 2 + words. Example: > + flushleft (_f_lush + _l_eft) ---> EFL + flushright (_f_lush + _r_ight) ---> EFR + eqnarray (_e_qn + _a_rray) ---> EEA +< If on the other hand, the environment name cannot be broken up into 2 + distinct words, then the next 2 letters are the first 2 letters of the name + of the environment. Example: > + equation (_eq_uation) ---> EEQ +< +Unfortunately there are some environments that cannot be split in two words and +first two letters in name are identical. In this case shortcut is created from +E, first and last letter. Example: > + quote (_q_uot_e_) ---> EQE + quotation (_q_uotatio_n_) ---> EQN +Of course, not every last one of the environments can follow this rule because +of ambiguities. In case of doubt, pull down the Tex-Environments menu. The menu +item should give the hint for the map. + + +Enclosing in Environments *ls_3_1_2* *ls_a_bk* + *enclosing-environments* + +Latex-Suite provides visual-mode mappings which enclose visually selected +portions of text in environments. There are two ways provided to do this. + + + +Method 1: Pressing <F5> *ls_3_1_2_1* *ls_a_bl* + *enclosing-env-f5* + +You can also select a portion of text visually and press <F5> while still in +visual mode. This will prompt you with a list of environments. (This list can be +customized via the g:Tex_PromptedEnvironments [|ls_a_di|] setting). You can +either choose from this list or type in a new environment name. Once the +selection is done, Latex-Suite encloses the visually selected portion in the +chosen environment. + + +Method 2: Using three letter mappings *ls_3_1_2_2* *ls_a_bm* + *enclosing-env-threeletter* + +You can also select text visually and press a sequence of three characters +beginning with , (the single comma character) and the selected text will be +enclosed in the chosen environment. The three letter sequence follows directly +from the three letter sequence used to insert environments as described here +[|ls_a_bj|]. The following example describes the rule used: + +If ECE inserts a \begin{center}...\end{center} environment, then to enclose a +block of selected text in \begin{center}...\end{center}, simply select the text +and press ,ce. The rule simply says that the leading E is converted to , and the +next 2 letters are small case. +Some of the visual mode mappings are sensitive to whether you choose line-wise +or character-wise. For example, if you choose a word and press ,ce, then you get +\centerline{word}, whereas if you press ,ce on a line-wise selection, you get: > + \begin{center} + line + \end{center} + + + +Changing Environments *ls_3_1_3* *ls_a_bn* + *changing-environments* + +Pressing <S-F5> in normal mode detects which environment the cursor is presently +located in and prompts you to replace it with a new one. The innermost +environment is detected. For example, in the following source: > + \begin{eqnarray} + \begin{array}{ccc} + 2 & 3 & 4 + \end{array} + \end{eqnarray} +if you are located in the middle "2 & 3 & 4" line, then pressing <S-F5> will +prompt you to change the array environment, not the eqnarray environment. In +addition, Latex-Suite will also try to change lines within the environment to be +consistent with the new environment. For example, if the original environment +was an eqnarray environment with a \label command, then changing it to an +eqnarray* environment will delete the \label. + +Pressing <F5> in normal mode has the same effect as pressing <F5> in +insert-mode, namely you will be prompted to choose an environment to insert. + +-------------------------------------------------------------------------------- +Command Mappings *ls_3_2* *ls_a_bo* + *latex-command-maps* + +Latex-Suite provides a rich set of mappings to insert, enclose and modify LaTeX +commands. + +Inserting LaTeX commands *ls_3_2_1* *ls_a_bp* + *inserting-commands* + + *ls-imap-f7* *ls_a_dW* + *ls-imap-s-f7* *ls_a_dX* +Pressing <F7> in insert or normal mode while the cursor is touching a word will +insert a command formed from the word touching the cursor. + +For certain common commands, Latex-Suite will expand them to include additional +arguments as needed. For example, frac becomes \frac{<++>}{<++>}<++>. Otherwise, +it will simply change the word under the cursor as follows > + word --> \word{<++>}<++> +You can define custom expansions of commands using the Tex_Com_{name} setting as +described in here [|ls_a_da|]. + +If <F7> is pressed when the cursor is on white-space, then Latex-Suite will +prompt you to choose a command and insert that instead.The list of commands is +constructed from the g:Tex_PromptedCommands [|ls_a_dk|] setting and also from +commands which Latex-Suite finds while scanning custom packages which +Latex-Suite finds. See the Package actions [|ls_a_bL|] section for details on +which files are scanned etc. + + +Enclosing in a command *ls_3_2_2* *ls_a_bq* + *enclosing-commands* + +You can select a portion of text visually and press <F7> while still in visual +mode. This will prompt you with a list of commands. (This list can be customized +via the g:Tex_PromptedCommands [|ls_a_dk|] setting). You can either choose from +this list or type in a new command name. Once the selection is done, Latex-Suite +encloses the visually selected portion in the chosen command. + + +Changing commands *ls_3_2_3* *ls_a_br* + *changing-commands* + + *ls-vmap-f7* *ls_a_dY* +In both insert and normal mode <S-F7> will find out if you are presently within +an environment and then prompt you with a list of commands to change it to. + +-------------------------------------------------------------------------------- +Font Mappings *ls_3_3* *ls_a_bs* *font-maps* + +These mappings insert font descriptions such as: \textsf{<++>}<++> with the +cursor left in place of the first placeholder [|ls_a_eD|] (the <++> characters). + +Mnemonic: +1. first letter is always F (F for font) + +2. next 2 letters are the 2 letters describing the font. + +Example: Typing FEM in insert-mode expands to \emph{<++>}<++>. + +Just like environment mappings, you can visually select an area and press `sf to +have it enclosed in: \textsf{word} or > + {\sffamily + line + } +depending on character-wise or line-wise selection. + +-------------------------------------------------------------------------------- +Section Mappings *ls_3_4* *ls_a_bt* + *section-mappings* + +These maps insert LaTeX sections such as: > + \section{<++>}<++> +etc. Just as in the case of environments and fonts, can be enclosed with a +visual selection. The enclosing is not sensitive to character or line-wise +selection. + +Mnemonic: (make your own!) > + SPA for part + SCH for chapter + SSE for section + SSS for subsection + SS2 for subsubsection + SPG for paragraph + SSP for subparagraph + + +Example: SSE in insert mode inserts > + \section{<++>}<++> +If you select a word or line and press ,se, then you get > + \section{section name} +The menu item in Tex-Environments.Sections have a sub-menu called 'Advanced'. +Choosing an item from this sub-menu asks a couple of questions (whether you want +to include the section in the table of contents, whether there is a shorter name +for the table of contents) and then creates a more intelligent template. + +-------------------------------------------------------------------------------- +Greek Letter Mappings *ls_3_5* *ls_a_bu* + *greek-letter-mappings* + +Lower case + +`a through `z expand to \alpha through \zeta.Upper case: + + > + `D = \Delta + `F = \Phi + `G = \Gamma + `Q = \Theta + `L = \Lambda + `X = \Xi + `Y = \Psi + `S = \Sigma + `U = \Upsilon + `W = \Omega +NOTE: LaTeX does not support upper case for all greek alphabets. + + +Just like other Latex-Suite mappings, these mappings are not created using the +standard imap command. Thus you can type slowly, correct using <BS> etc. + +-------------------------------------------------------------------------------- +Auc-Tex Key Bindings *ls_3_6* *ls_a_bv* + *auc-tex-mappings* + +These are simple 2 key expansions for some very commonly used LaTeX elements: + + > + `^ Expands To \Hat{<++>}<++> + `_ expands to \bar{<++>}<++> + `6 expands to \partial + `8 expands to \infty + `/ expands to \frac{<++>}{<++>}<++> + `% expands to \frac{<++>}{<++>}<++> + `@ expands to \circ + `0 expands to ^\circ + `= expands to \equiv + `\ expands to \setminus + `. expands to \cdot + `* expands to \times + `& expands to \wedge + `- expands to \bigcap + `+ expands to \bigcup + `( expands to \subset + `) expands to \supset + `< expands to \le + `> expands to \ge + `, expands to \nonumber + `~ expands to \tilde{<++>}<++> + `; expands to \dot{<++>}<++> + `: expands to \ddot{<++>}<++> + `2 expands to \sqrt{<++>}<++> + `| expands to \Big| + `I expands to \int_{<++>}^{<++>}<++> +(again, notice the convenient place-holders) + +In addition the visual mode macros are provided: + + > + `( encloses selection in \left( and \right) + `[ encloses selection in \left[ and \right] + `{ encloses selection in \left\{ and \right\} + `$ encloses selection in $$ or \[ \] depending on characterwise or + linewise selection + + +-------------------------------------------------------------------------------- +Diacritics *ls_3_7* *ls_a_bw* + *diacritic-mappings* + +These mappings speed up typing European languages which contain diacritic +characters such as a-umlaut etc. > + +<l> expands to \v{<l>} + =<l> expands to \'{<l>} +where <l> is an alphabet. + + > + +} expands to \"{a} + +: expands to \^{o} +Latex-Suite also ships with smart backspacing [|ls_a_dZ|] functionality which +provides another convenience while editing languages with diacritics. + +NOTE: Diacritics are disabled by default in Latex-Suite because they can + sometimes be a little too intrusive. Moreover, most European users can + nowadays use font encodings which display diacritic characters directly + instead of having to rely on Latex-Suite's method of displaying + diacritics. + + Set the g:Tex_Diacritics [|ls_a_df|] variable to enable diacritics. + + + +-------------------------------------------------------------------------------- +BibTeX Shortcuts *ls_3_8* *ls_a_bx* + *bibtex-bindings* + +Latex-Suite provides an easy way of entering bibliographic entries. Four +insert-mode mappings: BBB, BBL, BBH and BBX are provided, all of which +essentially act in the same manner. When you type any of these in insert-mode, +you will get a prompt asking you to choose a entry type for the bibliographic +entry. + +When you choose an entry type, a bibliographic entry template will be inserted. +For example, if you choose the option 'book' via the map BBB, then the following +template will be inserted: > + @BOOK{<+key+>, + author = {<++>}, + editor = {<++>}, + title = {<++>}, + publisher = {<++>}, + year = {<++>}, + otherinfo = {<++>} + }<++> + + +<+key+> will be highlighted in select-mode and you can type in the bib-key. +After that you can use <Ctrl-J> to navigate to successive locations in the +template and enter new values. + +BBB inserts a template with only the fields mandatorily required for a given +entry type. BBL inserts a template with commonly used extra options. BBH inserts +a template with more options which are not as commonly used. BBX inserts a +template with all the fields which the entry type supports. + +NOTE: Mnemonic + -------- + B for Bibliographic entry, L for Large entry, H for Huge entry, and X + stands for all eXtras. + + + + +Customizing Bib-TeX fields *ls_3_8_1* *ls_a_by* + *adding-bib-options* + +If you wish the BBB command to insert a few additional fields in addition to the +fields it creates, then you will need to define global variables of the form > + g:Bib_{type}_options +in you $VIM/ftplugin/bib.vim file, where {type} is a string like 'article', +'book' etc. This variable should contain one of the letters defined in the +following table + +Character Field Type~ +w address +a author +b booktitle +c chapter +d edition +e editor +h howpublished +i institution +k isbn +j journal +m month +z note +n number +o organization +p pages +q publisher +r school +s series +t title +u type +v volume +y year + +For example, by default, choosing 'article' via BBB inserts the following +template by default > + @ARTICLE{<+key+>, + author = {<++>}, + title = {<++>}, + journal = {<++>}, + year = {<++>}, + otherinfo = {<++>} + }<++> +However, if g:Bib_article_options is defined as 'mnp', then 'article' will +insert the following template > + @ARTICLE{<+key+>, + author = {<++>}, + title = {<++>}, + journal = {<++>}, + year = {<++>}, + month = {<++>}, + number = {<++>}, + pages = {<++>}, + otherinfo = {<++>} + }<++> + + +If you have some other fields you wish to associate with an article which are +not listed above, then you will have to use the Bib_{type}_extrafields option. +This is a newline separated string of complete field names which will be +included in the template. For example, if you define > + let g:Bib_article_extrafields = "crossref\nabstract" +then the article template will include the lines > + crossref = {<++>}, + abstract = {<++>}, + + +NOTE: You will need to define Bib_* settings in your + $VIMRUNTIME/ftplugin/bib.vim file. + + + +-------------------------------------------------------------------------------- +Smart Key Mappings *ls_3_9* *ls_a_bz* + *smart-keys* + +Latex-Suite ships with the following smart keys: + +Smart Backspace +--------------- + *smart-backspace* *ls_a_dZ* +Pressing <BS> in insert mode checks to see whether we are just after something +like \'{a} and if so, deletes all of it. i.e, diacritics are treated as single +characters for backspacing. + +Smart Quotes +------------ +Pressing " (English double quote) will insert `` or '' by making an intelligent +guess about whether we intended to open or close a quote. + +Smart Space +----------- +Latex-Suite maps the <space> key in such a way that $ characters are not broken +across lines. It does this by first setting tw=0 so that Vim will not +automatically break lines and then maps the <space> key to insert newlines +keeping $$'s on the same line. + +Smart Dots +---------- +Pressing ... (3 dots) results in \ldots outside math mode and \cdots in math +mode. + +-------------------------------------------------------------------------------- +Alt Key Macros *ls_3_10* *ls_a_bA* + *altkey-mappings* + +Latex-Suite utilizes a set of macros originally created by Carl Mueller in +auctex.vim to make inserting all the \left ... \right stuff very easy and to +also make some use of the heavily under-utilized <Alt> key. + +NOTE: By default, typing Alt-<key> in Vim takes focus to the menu bar if a menu + with the hotkey <key> exists. If in your case, there are conflicts due to + this behavior, you will need to set > + set winaltkeys=no +< in your $VIM/ftplugin/tex.vim in order to use these maps. + + +NOTE: Customizing the maps + -------------------- + If for some reason, you wish to not map the <Alt> keys, (some European + users need to use the <Alt> key to enter diacritics), you can change these + maps to other keys as described in the section Customizing Alt-key maps + [|ls_a_cx|]. + + + + +<Alt-L> *ls_3_10_1* *ls_a_bB* *Alt-L* + +This is a polymorphic insert-mode mapping which expands to one of the following +depending on the character just before the cursor location. + +Character before cursor Expansion~ +( \left( <++> \right) +[ \left[ <++> \right] +| \left| <++> \right| +{ \left\{ <++> \right\} +< \langle <++> \rangle +q \lefteqn{<++>}<++> + +If the character before the cursor is none of the above, then it will simply +insert a \label{<++>}<++>. + + +<Alt-B> *ls_3_10_2* *ls_a_bC* *Alt-B* + +This insert-mode mapping encloses the previous character in \mathbf{}. + + +<Alt-C> *ls_3_10_3* *ls_a_bD* *Alt-C* + +In insert mode, this key is polymorphic as follows: + + +1. If the previous character is a letter or number, then capitalize it and + enclose it in \mathcal{}. + +2. otherwise insert \cite{}. +In visual mode, it will simply enclose the selection in \mathcal{} + + +<Alt-I> *ls_3_10_4* *ls_a_bE* *Alt-I* + +This mapping inserts an \item command at the current cursor location depending +on which environment the cursor is enclosed in. The style of the \item command +is dependent on the enclosing environment. By default, <Alt-I> has styles +defined forthe following environments: + +Environment Style~ +itemize \item +enumerate \item +theindex \item +thebibliography \item[<+biblabel+>]{<+bibkey+>} <++> +description \item[<+label+>] <++> + +<Alt-I> is intelligent enough to account for nested environments. For example, > + \begin{itemize} + \item first item + \item second item + \begin{description} + \item[label1] first desc + \item[label2] second + % <Alt-I> will insert "\item[<+label+>] <++>" if + % used here + \end{description} + \item third item + % <Alt-I> will insert "\item " when if used here. + \end{itemize} + % <Alt-I> will insert nothing ("") if used here +< + +The style used by <Alt-I> can be customized using the +g:Tex_ItemStyle_environment [|ls_a_dl|] variable. + +-------------------------------------------------------------------------------- +Custom Macros *ls_3_11* *ls_a_bF* + *custom-macros-menu* + +This functionality available via the TeX-Suite.Macros menu, provides a way of +inserting customized macros into the current file via the menu. + +When Latex-Suite starts up, it scans the $VIM/ftplugin/latex-suite/macros/ +directory and creates a menu from the files found there. Each file is considered +as a single macro. You can place your own macros in this directory, using +placeholders [|ls_a_eD|] if wanted. + +When you choose a macro from the menu, the corresponding file is read into the +current buffer after the current cursor position. In non-gui mode, you can use +the |TMacro| command instead of choosing from the menu. This command takes the +macro file name as an argument. When called without arguments (preferred usage), +then a list of available macro files is displayed and the user is prompted to +choose one of them). + +There are some other tools provided in this menu, namely: + + +{New} Creates a new (unnamed) buffer in the latex-suite/macros/ directory. + Use the command :TexMacroNew in non-gui mode. +{Edit} Opens up the corresponding macro file for editing. Use |:TexMacroEdit| + in non-gui mode. When you try to edit {macro} not from local directory + Latex-Suite will copy it to your local directory with suffix "-local". + If local copy already exists Latex-Suite prompt for overwriting it. +{Delete} Deletes the corresponding macro. Use the prefixed numbers for fast + navigation of menus. Use |:TexMacroDelete| in non-gui mode. When you + choose to delete {macro} which is not in your local directory + Latex-Suite will refuse to delete it. +{Redraw} Rescans the macros/ directories and refreshes the macros list. + +-------------------------------------------------------------------------------- +Making your own Macros via IMAP() *ls_3_12* *ls_a_bG* + *ls-new-macros* + +If you find the need to create your own macros, then you can use the IMAP() +function provided with Latex-Suite. See [|ls_a_bH|] for a short explanation of +why you might prefer IMAP() over Vim's standard :imap command. An example best +explains the usage: > + :call IMAP('NOM', '\nomenclature{<++>}<++>', 'tex') +This will create a Latex-Suite-style mapping, where if you type NOM in insert +mode, you will get \nomenclature{<++>}<++> with the cursor left in place of the +first <++> characters. See [|ls_a_bI|] for a detailed explanation of the IMAP() +command. + +For maps which are triggered for a given filetype, the IMAP() command above +should be put in the filetype plugin script for that file. For example, for +tex-specific mappings, the IMAP() calls should go in $VIM/ftplugin/tex.vim. For +globally visible maps, you will need to use the following in either your +~/.vimrc or a file in your $VIM/plugin directory. > + augroup MyIMAPs + au! + au VimEnter * call IMAP('Foo', 'foo', '') + augroup END + + + + +Why use IMAP() *ls_3_12_1* *ls_a_bH* + *why-IMAP* + +Using IMAP instead of Vim's built-in :imap command has a couple of advantages: +1. The 'ttimeout' option will generally limit how easily you can type the left + hand side for a normal :imap. if you type the left hand side too slowly, then + the mapping will not be activated. + +2. If you mistype one of the letters of the lhs, then the mapping is deactivated + as soon as you backspace to correct the mistake. + +3. The characters in lhs are shown on top of each other. This is fairly + distracting. This becomes a real annoyance when a lot of characters initiate + mappings. + + +IMAP() syntax *ls_3_12_2* *ls_a_bI* + *ls-imaps-syntax* + +Formally, the syntax which is used for the IMAP function is: > + call IMAP (lhs, rhs, ft [, phs, phe]) + + +Argument Explanation~ +lhs This is the "left-hand-side" of the mapping. When you use IMAP, only + the last character of this word is actually mapped, although the + effect is that the whole word is mapped. + + If you have two mappings which end in a common lhs, then the mapping + with the longer lhs is used. For example, if you do > + call IMAP('BarFoo', 'something', 'tex') + call IMAP('Foo', 'something else', 'tex') +< Then typing BarFoo inserts "something", whereas Foo by itself inserts + "something else". + + Also, the nature of IMAP() makes creating certain combination of + mappings impossible. For example if you have > + call IMAP('foo', 'something', 'tex') + call IMAP('foobar', 'something else', 'tex') +< Then you will never be able to trigger "foobar" because typing "foo" + will immediately insert "something". This is the "cost" which you + incur over the normal :imap command for the convenience of no + 'timeout' problems, the ability to correct lhs etc. + + +rhs The "right-hand-side" of the mapping. This is the expansion you will + get when you type lhs. + + This string can also contain special characters such as <enter> etc. + To do this, you will need to specify the second argument in + double-quotes as follows: > + :call IMAP('EFE', "\\begin{figure}\<CR><++>\\end{figure}<++>", 'tex') +< With this, typing EFE is equivalent to typing in the right-hand side + with all the special characters in insert-mode. This has the advantage + that if you have filetype indentation set up, then the right hand side + will also be indented just as if you had typed it in normally. + + *IMAP_PutTextWithMovement* *ls_a_ea* + You can also set up a Latex-Suite style mapping which calls a custom + function as follows: > + :call IMAP('FOO', "\<C-r>=MyFoonction()\<CR>", 'tex') +< where MyFoonction is a custom function you have written. If + MyFoonction also has to return a string containing <++> characters, + then you will need to use the function IMAP_PutTextWithMovement(). An + example best explains the usage: + + > + call IMAP('FOO', "\<C-r>=AskVimFunc()\<CR>", 'vim') + " Askvimfunc: Asks For Function Name And Sets Up Template + " Description: + function! AskVimFunc() + let name = input('Name of the function : ') + if name == '' + let name = "<+Function Name+>" + end + let islocal = input('Is this function scriptlocal ? [y]/n : ', 'y') + if islocal == 'y' + let sidstr = '<SID>' + else + let sidstr = '' + endif + return IMAP_PutTextWithMovement( + \ "\" ".name.": <+short description+> \<cr>" . + \ "Description: <+long description+>\<cr>" . + \ "\<C-u>function! ".name."(<+arguments+>)<++>\<cr>" . + \ "<+function body+>\<cr>" . + \ "endfunction \" " + \ ) + endfunction +< + + +ft The file type for which this mapping is active. When this string is + left empty, the mapping applies for all file-types. A filetype + specific mapping will always take precedence. + + +phs, phe If you prefer to write the rhs with characters other than <+ and +> to + denote place-holders, you can use the last 2 arguments to specify + which characters in the rhs specify place-holders. By default, these + are <+ and +> respectively. + + Note that the phs and phe arguments do not control what characters + will be displayed for the placeholders when the mapping is actually + triggered. What characters are used to display place-holders when you + trigger an IMAP are controlled by the Imap_PlaceHolderStart + [|ls_a_cV|] and Imap_PlaceHolderEnd [|ls_a_er|] settings. + + + +================================================================================ +Package Handling *ls_4* *ls_a_bJ* + *latex-packages* + +|ls_4_1| Inserting package commands +|ls_4_2| Actions taken for supported packages +|ls_4_3| Automatic Package detection +|ls_4_4| Writing supporting for a package + + +Latex-Suite has a lot of functionality written to ease working with packages. +Packages here refers to files which you include into the LaTeX document using +the \usepackage command. + + +-------------------------------------------------------------------------------- +Inserting package commands *ls_4_1* *ls_a_bK* + *inserting-packages* + +When you first invoke Latex-Suite, it scans the +$VIM/ftplugin/latex-suite/packages directory for package script files and +creates a menu from all the files found there. This menu is created under +TeX-Suite > Packages > Supported. This menu contains a list of packages +"supported" by Latex-Suite. When you choose one of the packages from this menu +(for example the amsmath package), then a line of the form > + \usepackage[<++>]{amsmath}<++> +will be inserted into the current file. + +The \usepackage line can also be inserted in an easy manner in the current file +by pressing <F5> while in the preamble of the current document. This will set up +a prompt from the supported packages and ask you to choose from one of them. If +you do not find the package you want to insert in the list, you can type in a +package-name and it will use that. Pressing <F5> in the preamble on a line +containing a single word will construct a \usepackage line from that word. + +You can also use the TPackage [|ls_a_cD|] to insert the \usepackage line. + +Once you have inserted a \usepackage line, for supported packages, you can use +the Options and Commands menus described in the next section [|ls_a_bL|]. + +-------------------------------------------------------------------------------- +Actions taken for supported packages *ls_4_2* *ls_a_bL* + *package-actions* + +Latex-Suite takes the following actions for packages detected when a file is +loaded, or a new \usepackage line is inserted using one of the methods described +in the previous section [|ls_a_bK|]. + +If you are using the GUI and you have g:Tex_Menus [|ls_a_dI|] set to 1, +Latex-Suite will create the following sub-menus +TeX-Suite > Packages > <package> Options + +TeX-Suite > Packages > <package> Commands + +where <package> is the package you just inserted (or was detected). You can use +these menus to insert commands, environments and options which Latex-Suite +recognizes as belonging to this package. + +NOTE: While inserting an option, you need to position yourself in the + appropriate place in the document, most commonly inside the square braces + in the \usepackage[]{packname} command. Latex-Suite will not navigate to + that location. + + +In addition to creating these sub-menus, Latex-Suite will also scan the +$VIM/ftplugin/latex-suite/dictionaries directory and if a dictionary file +corresponding to the package file is found, then it will add the file to the +'dict' setting in Vim so you can use the <C-X><C-K> command to complete words +from that file. + +For example, the SIUnits package has a custom dictionary. + + *latex-package-scanning* *ls_a_eb* +If a package detected at startup is found by Latex-Suite in the current +directory or in a location specified by the g:Tex_TEXINPUTS [|ls_a_dT|] +variable, Latex-Suite will scan the package for \newenvironment and newcommand +lines and also append any commands and environments found to the list of +commands and environments which you are prompted with when you press <F5> +[|ls_a_bh|] or <F7> [|ls_a_dW|] in insert mode. +In addition, the TeX-Suite > Packages menu also contains the following submenus + +Update +------ +This command is to be invoked with the cursor placed on the package name. If the +corresponding package is found, then a sub-menu with the supported commands and +options is created. + +Update All +---------- +This function reads the preamble of the document for \usepackage lines and if +Latex-Suite supports the detected packages, then sub-menus containing the +package options and commands are created. + + +-------------------------------------------------------------------------------- +Automatic Package detection *ls_4_3* *ls_a_bM* + *automatic-package-detection* + +Whenever Latex-Suite begins editing a new LaTeX file, it scans it for +\usepackage{name} lines, and if a supported package is found, then it will +create sub-menus and add to the 'dict' setting as described above. + +If a master-file [|ls_a_ct|] has been specified, then it will scan that file +instead of the current file. See the section Custom Packages [|ls_a_bN|] to see +which files Latex-Suite will scan in more detail. + +For all the packages detected in this manner, Latex-Suite will take certain +actions as described in the section package support. [|ls_a_bL|]. + + + +Custom Packages *ls_4_3_1* *ls_a_bN* + *custom-packages* + +Often times, the preamble can become too long, and some people prefer to put +most of their personalization in a custom package and include that using a +\usepackage line. Latex-Suite tries to search such customs package for other +\usepackage lines, so that supported packages included in this indirect manner +can also be used to create sub-menus, extend the 'dict' setting etc. The most +obvious place to place such custom packages is in the same directory as the +edited file. In addition, LaTeX also supports placing custom packages in places +pointed to by the $TEXINPUTS environment variable. + +If you use the $TEXINPUTS variable in LaTeX, and you wish Latex-Suite to search +these custom packages for \usepackage lines, then you need to initialize the +g:Tex_TEXINPUTS [|ls_a_dT|] variable. + +The g:Tex_TEXINPUTS variable needs to be set in the same format which Vim uses +for the 'path' setting. This format is explained in detail if you do > + :help file-searching +from within Vim. + +Therefore the value of g:Tex_TEXINPUTS will most probably be different from +$TEXINPUTS which your native LaTeX distribution uses. + +Example: > + let g:Tex_TEXINPUTS = '~/texmf/mypackages/**,./**' +The ** indicates that all directories below the directory ~/texmf/mypackages and +./ are to be scanned for custom packages. + +NOTE: The present directory '.' is always searched. You need not include that in + g:Tex_TEXINPUTS. + + + +-------------------------------------------------------------------------------- +Writing supporting for a package *ls_4_4* *ls_a_bO* + *supporting-packages* + +Supporting a package is easy and consists of writing a vim script with the same +name as the package and placing it in the $VIM/ftplugin/latex-suite/packages +directory. A package script should define two variables as described in the next +two sections. In addition to these two variables, you can also define any +functions, environment definitions etc. in this file. + + + +g:Tex_package_option_<package> *ls_4_4_1* *ls_a_bP* + +This setting is a string containing a comma separated list of options supported +by this package. + +Example: > + g:Tex_package_option_mypack = 'opt1,opt2=,sbr:group1,opt3,opt4' +The = suffix means that the option takes a value. Use sbr:group name to separate +options into sub-menus. All successive options will be clubbed into the group1 +sub-menu till the next sbr: option is encountered. + + +g:Tex_package_<package> *ls_4_4_2* *ls_a_bQ* + + > + + g:TeX_package_<package> = "pre:Command,pre:Command1" + More detailed example is in latex-suite/packages/exmpl file (slightly + outdated). + Here is short summary of prefixes which can be used in package files: + (x - place with cursor, <++> - |placeholder|) + + {env:command} Environment: creates simple environment template + \begin{command} + x + \end{command}<++> + {eno:command} Environment with option: + \begin[x]{command} + <++> + \end{command}<++> + {ens:command[<<option>>]...} Environment special: + \begin[<<option>>]...{command} + <++> + \end{command}<++> + {bra:command} Brackets: + \command{x}<++> + {brd:command} Brackets double: + \command{x}{<++>}<++> + {brs:command[<<option>>]...} Brackets special (as environment special: + \command[<+x+>]{<++>}{<++>}<++> + {nor:command} Normal: + \command<Space + {noo:command} Normal with option: + \command[x]<++> + {nob:command} Normal with option and brackets: + \command[x]{<++>}<++> + {pla:command} Plain: + command<Space + {spe:command} Special: + command <-literal insertion of command + {sep:command} creates separator. Good for aesthetics and usability :) + {sbr:command} Breaks menu into submenus. <command> will be title of submenu. + Can be used also in package variable. + + Command can be also given without prefix:. The result is + \command + + + +================================================================================ +Latex Completion *ls_5* *ls_a_bR* + *latex-completion* + +|ls_5_1| Latex-Suite completion example +|ls_5_2| Latex-Suite \ref completion +|ls_5_3| Latex-Suite \cite completion +|ls_5_4| Latex-Suite filename completion +|ls_5_5| Custom command completion + + +Latex-Suite provides an easy way to insert references to labels and +bibliographic entries and also provide filename arguments to commands such as +\includegraphics. Although the completion capabilities are very diverse, +Latex-Suite only uses a single key (<F9> by default) to do all of it. Pressing +the <F9> key does different things based on where you are located. Latex-Suite +tries to guess what you might be trying to complete at the location where you +pressed <F9>. For example, pressing <F9> when you are within a \ref command will +try to list the \label's in the present directory. Pressing it when you are in a +\cite command will list bibliography keys. Latex-Suite also recognizes commands +which need a file name argument and will put up an explorer window for you to +choose a filename. + + *ls-set-grepprg* *ls_a_eG* +NOTE: Before you start with Latex-Suite's completion function... + ---------------------------------------------------------- + All of Latex-Suite's completion capabilities depend on a external program + being available on your system which can search through a number of files + for a reg-exp pattern. On *nix systems, the pre-installed grep utility is + more than adequate. Most windows systems come with a utility findstr, but + that has proven to be very inadequate (for one, it does not have an option + to force the file name to be displayed when searching through a single + file). Your best bet is to install cygwin |ls_u_3|, but if you think + that's overkill, you can search for |ls_u_4| a windows implementation of + GNU grep. (Latex-Suite testing on windows has been done with cygwin's port + of GNU grep). + + Once you have a grep program installed, you need to set the 'grepprg' + option for vim. Make sure you use a setting which forces the program to + display file names even when you are searching through a single file. For + GNU grep, the syntax is > + set grepprg=grep\ -nH\ $* +< + + + +-------------------------------------------------------------------------------- +Latex-Suite completion example *ls_5_1* *ls_a_bS* + *ls-completion-usage* + +Consider the situation where you are editing a file with two equations labelled +eqn:euler and eqn:einstein. Now you want to insert a reference to one of these +equations. To do this, you type the \ref{eqn:} command and with the cursor +placed after eqn:, press <F9>. This will bring up two new windows beneath the +main window you were working in as shown in the figure below. > + + 8 These are a couple of equations: + 9 +-- 4 lines: eqnarray (eqn:euler) : e^{j\pi} + 1 &=& 0--------------- + 13 +-- 4 lines: equation (eqn:einstein) : E = m c^2--------------------- + 17 + 18 These are a couple of figures: + 19 +-- 7 lines: figure (fig:monkeys) : Monkeys can Type------------------- + 26 +-- 7 lines: figure (fig:shakespeare) : Shakespeare could not type----- + 33 + 34 This is a reference to \ref{eqn:}<++> + 35 + 36 + 37 \end{document} + 38 + ~ + ~ + ~ + newfile.tex 34,32 Bot + newfile.tex|11| \label{eqn:euler} + newfile.tex|15| \label{eqn:einstein} + ~ + [Error List] 1,1 All + 7 + 8 These are a couple of equations: + 9 \begin{eqnarray} + 10 e^{j\pi} + 1 &=& 0 + 11 \label{eqn:euler} + 12 \end{eqnarray} + 13 \begin{equation} + 14 E = m c^2 + 15 \label{eqn:einstein} + 16 \end{equation} + newfile.tex [Preview] 11,3 21% + + + +The first window (shown as [ErrorList] above) is a |cwindow| containing a list +of possible matches for the reference. The cursor will be located in the first +line of this window. The bottom window is a preview-window showing the context +of the \label. Moving around in the [ErrorList] window automatically scrolls the +preview window so as to always keep showing the context of the \label being +viewed in the [ErrorList] window. You can also press J and K in the [ErrorList] +window to scroll the preview window up and down. + +To insert one of the labels, simply position the cursor in the correct line in +the [ErrorList] window and press <enter>. This will immediately close the two +newly opened windows, get back to the correct location in the original file +being edited and insert the label into the \ref command. + +If you notice carefully in the example above, the [ErrorList] window only showed +the matches for the equations and did not list any of the figure labels. This is +because we pressed <F9> after \ref{eqn: instead of simply after \ref{. This +caused Latex-Suite to search only for those labels which started with the string +eqn:. If you had pressed <F9> after a \ref{, you would have been shown matches +from _all_ labels, not just those starting with eqn:. + +Thus prefixing all your labels with eqn:, fig:, tab: etc. depending on what you +are labelling will lead to an easier time completing references. + +-------------------------------------------------------------------------------- +Latex-Suite \ref completion *ls_5_2* *ls_a_bT* + *ls-completion-ref* + +Pressing <F9> when you are within a partially completed \ref command will split +open a window (named __OUTLINE__) which contains a nicely formatted list of all +the \labels found in the present project. The \labels are heirarchically +arranged according to which \section, \subsection etc of the overall document +structure they are present in. For example, when you first press <F9> after +typing \ref{, you should see something like: > + + +-- 54 lines: 2. Kinematics-------------------------------- + +-- 98 lines: 3. Aerodynamics of the MFI thorax------------ + +-- 40 lines: 4. Jump Resonance in Fourbar Mechanisms------ + +-- 28 lines: 5. Design and Fabrication Issues------------- + +Each chapter is |fold|ed away so that you can quickly jump to the correct +section/subsection in which the relevant equation is defined. This makes +inserting references significantly faster for large projects with hundreds of +equations. You can then open some of the folds to see for example: > + + +-- 54 lines: 2. Kinematics-------------------------------- + 3. Aerodynamics of the MFI thorax + 3.1. Aerodynamic modeling of the MFI wing forces + 3.1.1. Geometric Specification + eqn:wingnormal-pos + \nhat = T_z(\theta_2) T_y(\theta_y)T_x(\theta_x)\nhat_0, + eqn:T-1 + T_1(\theta_2) &=& T_z(\theta_2) + +The <Tab> key is mapped in this window to toggle folds so that you can quickly +open/close folds in order to navigate the heirarchy faster. Once you are +positioned on a label, press <Enter>. This closes the __OUTLINE__ window, +returns to the window in which you pressed <F9> and inserts the reference at the +current cursor position. + +NOTE: Filtering labels by prefix + -------------------------- + You can press <F9> after typing part of the \label. In this case, + Latex-Suite only presents \labels which begin with the already filled + characters. You can use this to choose between equations, figures, tables + etc. if you consistently label equations to begin with eqn:, figures to + begin with fig: etc. For example, with this scheme, pressing <F9> after + typing \ref{eqn: will only list equations. + + +NOTE: Latex-Suite works the same way if you press <F9> after any command which + contains the letters ref. Thus you can complete \eqref in exactly the same + manner. + + +NOTE: Requirements + ------------ + This method of preseting the \labels depends on Vim being compiled with + python support. To check if you have this, see the output of the :ver + command. If you see something like +python, you are all set. Failing this, + you will need to have python somewhere in your $PATH. + + + +-------------------------------------------------------------------------------- +Latex-Suite \cite completion *ls_5_3* *ls_a_bU* + *latex-completion-cite* + +Latex-Suite provides an easy way to insert references to bibliographic entries. +Pressing <F9> when the cursor is placed inside a partially completed \cite +command will split open a new window (named __OUTLINE__) which contains a +formatted and syntax highlighted list of all bibtex entries found. For example, +pressing <F9> after typing \ref{ should present you with a window which looks +something like this: > + + Article [dickinson:science:99] + "Wing rotation and aerodynamic basis of insect flight" + M. H. Dickinson and F-O. Lehman and S. P. Sane + In Science, 1999 + + Article [ellington:84:part1] + "The Aerodynamics of Hovering Insect Flight. I. The Quasi-Steady Analysis" + Ellington, C P + In Philosophical Transactions of the Royal Society of London. Series B, Biological Sciences, 1984 + + Article [ellington:84:part2] + "The Aerodynamics of Hovering Insect Flight. II. Morphological Parameters" + Ellington, C P + In Philosophical Transactions of the Royal Society of London. Series B, Biological Sciences, 1984 + + + +You can easily jump from one entry to another using the 'n' and 'p' keys (to go +to the next / previous entry respectively). + +You can also filter out a subset of the bibtex entries by pressing 'f' while in +this window. Doing this presents the following prompt: > + + Field acronyms: (`:let g:Tex_EchoBibFields = 0` to avoid this message) + [t] title [a] author [b] booktitle + [j] journal [y] year [p] bibtype + (you can also enter the complete field name) + Enter filter criterion [field<space>value]: + +At the prompt, type > + a ellington +Notice that the letter a is an acronym for author according to the prompt above. +Therefore this filter only shows those bibtex entries whose author field +contains the text ellington. You can keep narrowing your selection by repeatedly +filtering the results. If you would like to remove all the filters and see all +entries again, press 'a', which removes all the filters. + +You can also sort the bibtex entries based on a field. To do this, press 's'. +This will present you with a prompt like in the case of the filter and you are +asked to choose a field. In this case, you would type in a single character. +This sorts the entries according to that field. + +NOTE: <F9> will also work in a similar way after any command which contains the + word cite in it. For example, pressing <F9> will also work with \citenum + etc. + + +The following logic is applied to find out which bibliographic entries are +included in the completion. + + +1. Firstly, if the present file has a master-file [|ls_a_ct|] defined for it, + then Latex-Suite will perform the following steps on that file instead of on + the current file. + +2. First, the file is scanned for a \bibliography command. To explain better, + assume that a command > + \bibliography{file1,file2} +< is found in the present file. For each bibliography file, say file1, + Latex-Suite first tries to see if a .bib file, file1.bib can be found. If so, + it will scan it for bib-keys of the form @BOOK{ etc., and add these searches + to the completion list. If a .bib file cannot be found, then it will try to + see if file1.bbl can be found. If so, Latex-Suite will search it for bib-keys + of the form \bibitem and add these to the completion list. + + You can set the location where Latex-Suite will search for .bib and .bbl + files using the |Tex_BIBINPUTS| [|ls_a_dr|] variable. + +3. If a \bibliography command is not found, then Latex-Suite tries to scan the + present file for a \begin{thebibliography} environment. If found, Latex-Suite + searches the present file for bib-keys of the form \bibitem. + +4. Finally, it will try to see if this file includes other files via the \input + command. For each such file found, Latex-Suite will repeat the previous two + steps stopping at the first file which has either a \bibliography command or + a thebibliography environment. + + +Caching the \cite completion results *ls_5_3_1* *ls_a_bV* + *cite-search-caching* + + *TClearCiteHist* *ls_a_ec* +Often times, the editing cycle proceeds by first laying out a comprehensive +bibliography and then completing all the \cite commands in one session. In such +situations, it is inefficient to scan the whole list of bibliography files for +bib-keys each time. Latex-Suite provides a way to cache the results of the cite +completion search using the Tex_RememberCiteSearch [|ls_a_du|] variable. If set, +Latex-Suite will perform the search only the first time <F9> is used. Next time +on, it will reuse the search results. If you wish to redo the search results, +issue the command > + TClearCiteHist +This will redo the completion list next time you use <F9>. + +-------------------------------------------------------------------------------- +Latex-Suite filename completion *ls_5_4* *ls_a_bW* + *ls-filename-completion* + +When you press <F9> at a location where Latex-Suite guesses a filename needs to +be typed, then a new explorer window will open up with the list of files. You +can use this window to change directories etc. Pressing <enter> on a filename in +the explorer window will automatically close the explorer window, return to the +location where you pressed <F9> from and insert the filename into that position. + +Latex-Suite also tries to guess what kinds of files you might not want to insert +and hides those accordingly. For example, if you press <F9> when you are located +at \includegraphics{, then Latex-Suite knows that you will not want to insert +.tex files. Therefore, the explorer window will automatically hide these files. + +As of now, Latex-Suite recognizes the following commands for filename +completion. Along with the commands, this table also lists the files which +Latex-Suite will not show for completing each command. + +command hide pattern~ +\bibliography '^\.,\.[^b]..$' +\include \includeonly '^\.,\.[^t]..$' +\includegraphics \psfig '^\.,\.tex$,\.bib$,\.bbl$,\.zip$,\.gz$' +\input '' + +-------------------------------------------------------------------------------- +Custom command completion *ls_5_5* *ls_a_bX* + *ls-completion-custom* + +Latex-Suite also recognizes certain commonly used LaTeX commands for the <F9> +key. At the moment, the \bibliographystyle, \addtocontents and the +\addcontentsline commands are recognized, although more will be added in the +future. When you press the <F9> after such a command, Latex-Suite will prompt +you with a list of arguments which make sense for the command. + +This functionality is available for commands for which a global variable of the +form g:Tex_completion_{<command>} is defined where <command> is the command +name. This variable is a comma separated list of values which this command +takes. For example, the argument to the \bibliographystyle command is commonly +one of abbr,alpha,plain,unsrt. Therefore, Latex-Suite defines > + let g:Tex_completion_bibliographystyle = 'abbr,alpha,plain,unsrt' +You can define your own completion variables in a similar manner for commands +which you might use. + +================================================================================ +LaTeX Compiling *ls_6* *ls_a_bY* + *latex-compiling* + +|ls_6_1| Setting Compilation rules +|ls_6_2| Handling dependencies in compilation +|ls_6_3| Compiling multiple times +|ls_6_4| Customizing the compiler output +|ls_6_5| Compiling parts of a file + + +This functionality, available via the TeX-Suite menu, provides various tools to +compile and debug LaTeX files from within Vim. + +If you are using commonly used LaTeX tools, then you should be all set as soon +as you download and install Latex-Suite. In order to compile a LaTeX file, +simply press \ll while editing the file. This runs latex on the current file and +displays the errors in a |quickfix-window| below the file being edited. You can +then scroll through the errors and press <enter> to be taken to the location of +the corresponding error. Along with the errors being listed in the quickfix +window, the corresponding log file is also opened in |preview| mode beneath the +quickfix window. It is scrolled automatically to keep in sync with the error +being viewed in the quickfix window. You will be automatically taken to the +location of the first error/warning unless you set the g:Tex_GotoError +[|ls_a_dD|] variable to 0. + +Latex-Suite also supports compiling LaTeX into formats other than DVI. By +default, Latex-Suite supports PDF and PS formats. In order to choose a format +other than DVI, use the TTarget command or the TeX-Suite > Target Format menu +item. This will ask you to type in the name of the target format you want to +compile to. If a rule has been defined for the format (as described in the next +section [|ls_a_bZ|]), then Latex-Suite will switch to that format. + +Trying to choose a format for which no rule has been defined will result in +Latex-Suite displaying a warning message without taking any action. + +If you are using a multiple file project and need to compile a master file while +editing other files, then Latex-Suite provides a way to specify the file to be +compiled as described in latex-master-file [|ls_a_ct|]. + + +-------------------------------------------------------------------------------- +Setting Compilation rules *ls_6_1* *ls_a_bZ* + *compiler-rules* + +In order to compile LaTeX files into various formats, Latex-Suite needs to know +which external programs to call and in which way they need to be called. This +information is provided to Latex-Suite via a number of "rules". For each format +you want to compile to, you need to specify a rule. A rule is specified by +defining a variable of the form: > + g:Tex_CompileRule_<format> +where <format> is a string like "pdf", "dvi" etc. + +Example: By default, Latex-Suite uses the following rule for compiling LaTeX +documents into DVI. > + g:Tex_CompileRule_dvi = 'latex --interaction=nonstopmode $*' + + +Default values are also provided for ps and pdf formats. You might want to +change these rules in texrc according to your local tex environment. + +NOTE: For win32 users user MikTeX, sometimes the latex compiler's output has a + bug where a single number is split across different lines. In this case, + put the included vim-latex file distributed with Latex-Suite. + + + +-------------------------------------------------------------------------------- +Handling dependencies in compilation *ls_6_2* *ls_a_ca* + *compiler-dependency* + +Latex-Suite also handles compiling dependencies automatically via certain rules +which specify the "dependency chain" for each target format. For example, if in +your case, you use > + .tex -> .dvi -> .ps -> .pdf +to generate pdf files from dvi files, then you will need to specify the +following setting in your Latex-Suite configuration (see customizing Latex-Suite +[|ls_a_cP|] for where these settings should go): > + + let g:Tex_FormatDependency_pdf = 'dvi,ps,pdf' + +This is a comma separated string of formats specifying the order in which the +formats to be compiled into should be chosen. With this setting, if you set the +target format to pdf, then the next time you compile via the \ll shortcut, +Latex-Suite will first generate a dvi file, then use that to generate the ps +file and finally create the pdf file from that. + +NOTE: If any of the intermediate formats is listed in the + g:Tex_MultipleCompileFormats setting as described in the section Compiling + multiple times [|ls_a_cb|], then Latex-Suite might make multiple calls to + the compiler to generate the output file of that format. + + +Along with the g:Tex_FormatDependency_{format} setting, you should ofcourse +specify the rule for compiling to each of the formats as described in the +previous section [|ls_a_bZ|]. For example, with the setting above, you could +use: > + + let g:Tex_CompileRule_dvi = 'latex --interaction=nonstopmode $*' + let g:Tex_CompileRule_ps = 'dvips -Ppdf -o $*.ps $*.dvi' + let g:Tex_CompileRule_pdf = 'ps2pdf $*.ps' + + +NOTE: By default, Latex-Suite does not specify any compiler dependencies. Each + target format for which a rule has been derived will be compiled + independently. + + + +-------------------------------------------------------------------------------- +Compiling multiple times *ls_6_3* *ls_a_cb* + *compiling-multiple* + +Most LaTeX compilers need to be re-run several times in several commonly +occurring situations in order to get a final camera ready copy. For example, +when \label's change, when new \cite commands are added etc. If the target +format you are compiling to requires multiple compilations, then you will need +to include the format in the g:Tex_MultipleCompileFormats setting. This is a +comma separated string of formats which need multiple compilations to be +generated correctly. + +By default, this setting contains just the dvi format. If you use the pdflatex +compiler to generate pdf files, then you might want to also include pdf into the +above setting. + +For every format included in the g:Tex_MultipleCompileFormats setting described +above, Latex-Suite will use the following logic to generate the file. Note that +although the following description uses latex to refer to the compiler, it could +be some other compiler such as pdflatex for generating pdf output. + +1. If there was a .idx file, then remember its contents. + +2. Run latex. + +3. If the .idx file changed due to the latex compiler, then run makeindex to + redo the .ind file and then remember to rerun latex. + +4. If the .aux file generated by the latex compiler contains a \bibdata line, + then it means that we are using a .bib file. Therefore, run bibtex. + + NOTE: This means that we will always run bibtex whenever we use the + \bibliography command whether or not we actually need to. At this time, + Latex-Suite does not parse the .aux file before and after the latex + compiler to see if we are required to rerun bibtex. + +5. If the .bbl file changes because of this, then remember to rerun latex again. + +6. Also, we check to see if the LaTeX compiler gives certain standard warnings + which notify that we need to compile once again. In this case also, remember + to rerun LaTeX. + +7. If we found we had to rerun latex, then we repeat the steps above but not + running makeindex or bibtex again. + +The LaTeX file is compiled atmost 5 times using this logic. These steps will +ensure that on most platforms/environments, you will get a clean output with all +the cross-references, citations etc correctly labelled and ordered. + +-------------------------------------------------------------------------------- +Customizing the compiler output *ls_6_4* *ls_a_cc* + *compiler-output-customization* + +Most LaTeX compilers produce a very large amount of output during compilation, +most of which is not relevant to debugging type-setting errors. The compiler +plugin provided with Latex-Suite (which is an enhanced version of the standard +compiler plugin maintained by Artem Chuprina), provides a way to filter the +compiler output so that the actual errors/warnings can be presented much more +concisely. + +The compiler plugin is set up by default to function in a "non-verbose", +"ignore-common-warnings" mode, which means that irrelevant lines from the +compiler output will be ignored and some very common warnings are also ignored. +Latex-Suite does this via the global variable g:Tex_IgnoredWarnings [|ls_a_dA|]. +This is a list of patterns, which can be used to filter out (or ignore) some or +the warnings and errors reported by the compiler. See the link above for its +default value. + +Latex-Suite uses the g:Tex_IgnoreLevel [|ls_a_dB|] setting to set a default +ignore level. For example, for the default value of 4, Latex-Suite ignores +warnings and errors matching the first 4 patterns in g:Tex_IgnoredWarnings. + +In addition to setting a default value of the ignore level, Latex-Suite provides +the ability to set the level dynamically, using the TCLevel command. For +example, if you issue the command: > + TCLevel 3 +from within Vim, then the next time you compile the document, Latex-Suite will +ignore warnings and errors which match the first three patterns in +g:Tex_IgnoredWarnings. + +When TCLevel is called with the unquoted string strict as follows: > + TClevel strict +then Latex-Suite switches to a "verbose", "no-lines-ignored" mode which is +useful when you want to make final checks of your document and want to be +careful not to let things slip by. + +See the explanation of the settings g:Tex_IgnoredWarnings [|ls_a_dA|] and +g:Tex_IgnoreLevel [|ls_a_dB|] to find out how to customize the filtering done by +Latex-Suite + +-------------------------------------------------------------------------------- +Compiling parts of a file *ls_6_5* *ls_a_cd* + *part-compiling* + +Latex-Suite also provides a way to compile a fragment of a document. This can be +very useful while debugging a complex equation or one chapter in a book, etc. + +To do this, visually select a portion of the text and press \ll while in visual +mode. The visually selected portion will be saved to a temporary file with the +preamble from the current document prepended. Latex-Suite will then switch focus +to this temporary file and compile it. Continue to debug this file as required +and then replace the portion of the original file with this one. + +Pressing \lv while viewing the temporary file will view the output file +generated from the temporary file, not the original file + +Two commands |TPartComp| and |TPartView| are provided to be able to get this +functionality via the command line. + +From release 1.6 onwards of Latex-Suite, the temporary file created for part +compilation will reside in the same directory as the file from which the +fragment is being created. This ensures that any relative path-names defined in +the fragment will still work. Latex-Suite will attempt to clean the temporary +file(s) created when Vim exits. + +================================================================================ +Latex Viewing and Searching *ls_7* *ls_a_ce* + *latex-viewing* + +|ls_7_1| Setting Viewing rules +|ls_7_2| Forward Searching documents +|ls_7_3| Inverse Searching + + + +-------------------------------------------------------------------------------- +Setting Viewing rules *ls_7_1* *ls_a_cf* + *latex-viewing-rules* + +In order to view the output files created by compiling the source files, you +need to specify which external program Latex-Suite should call. You can specify +the external program using one of two settings Tex_ViewRule_format [|ls_a_dF|] +or Tex_ViewRuleComplete_format [|ls_a_dG|]. By default, Latex-Suite has default +settings for viewing various common output formats via the Tex_ViewRule_format +settings, so that if you are using commonly used programs, you should be all set +to view compiled files from within Vim by simply pressing \lv. + +NOTE: The viewing function also takes the *.latexmain [|ls_a_ct|] file into + account to decide which file to show. + + +If pressing \lv does not work, then it most probably has to do with incorrect +settings of the g:Tex_ViewRule_<format> [|ls_a_dF|] where <format> is the format +you are attempting to view. See the link above for how to set this according to +your system. + +NOTE: On Windows and OS/X, you can leave the view rule empty to open the + document with the default viewer on your system. On Linux/UNIX systems, + you can use the xdg-open command to open the document with the default + viewer. + + +In addition to viewing the files, Latex-Suite also supports forward and inverse +searching for certain common tools for viewing documents. See the next few +sections for details on forward and inverse searching, including an overview of +viewers. + +-------------------------------------------------------------------------------- +Forward Searching documents *ls_7_2* *ls_a_cg* + *forward-searching* + +Forward searching refers to making a viewer display a given document at a given +location from within Vim. At present, these viewers are known to support forward +searching, but viewers that are not listed here may work, too:Viewer OS Supported documents Comment~ +Skim |ls_u_5| Apple / OS X Tiger PDF Supports also + inverse searching +PDFView |ls_u_6| Apple / OS X PDF No longer in + development, + supports also + inverse searching +TeXniscope |ls_u_7| Apple PDF, DVI +YAP |ls_u_8| Windows DVI, PS ships with MikTex +Sumatra PDF |ls_u_9| Windows PDF +kdvi |ls_u_10| Linux/UNIX DVI +okular |ls_u_11| Linux/UNIX DVI, PDF, PS and Included in KDE 4 + many more +xdvi |ls_u_12| Linux/UNIX DVI +xdvik |ls_u_13| Linux/UNIX DVI + +Pressing \ls from within Vim should make the viewer display the portion of the +document where your cursor is placed.NOTE: OS/X users need to set the g:TreatMacViewerAsUNIX flag to 1 and provide a + UNIX-like viewrule, that expects as arguments the document, the linenumber + and the sourcefile in this order. + + + + *enabling-searching* *ls_a_ed* +NOTE: Enabling Forward and Inverse Searching + -------------------------------------- + Most DVI viewers need "source-special" information in order to do forward + (and inverse) searching. This information is embedded in the dvi file if + the LaTeX source is compiled with the --src-specials option. By default, + Latex-Suite does not supply this argument to the compiler. See the section + on to find out how this option can be set. + + For pdf viewers you need to use the pdfsync |ls_u_14| package in your + LaTeX document. + + + +-------------------------------------------------------------------------------- +Inverse Searching *ls_7_3* *ls_a_ch* + *inverse-searching* + +Inverse searching refers to the viewer telling Vim to display the LaTeX source +file at a given location when you double-click in the viewer window. + +You will need to enable searching [|ls_a_ed|] in order to use this +functionality. + +You will also need to specify certain settings to the DVI viewer conveying the +syntax which it needs to use to tell Vim how to display the source file. In YAP, +you can set this option in View > Options > Inverse Search. The Command Line +field needs to be set as follows: > + "C:\Program Files\vim\vim61\gvim" -c ":RemoteOpen +%l %f" +The command :RemoteOpen is supplied when you install Latex-Suite. + +On *nix machines, Latex-Suite attempts to call the DVI viewer in such a way that +it already knows how to communicate with Vim. If this does not seem to be +working, you can use the RemoteOpen command described above. + +================================================================================ +Latex Folding *ls_8* *ls_a_ci* + *latex-folding* + +|ls_8_1| Default Folding Scheme in Latex-Suite +|ls_8_2| Customizing what to fold +|ls_8_3| Editing the folding.vim file directly + + +Latex-Suite ships with the plugin SyntaxFolds.vim which is a plugin for creating +"fake" syntax folds on the fly. The fold method is actually manual but the +folding is based on LaTeX syntax. This offers a speed increase over regular +syntax folding. Ofcourse it has the disadvantage that the folds are not dynamic, +i.e newly created syntax items are not automatically folded up. (This is a +compromise between speed and convenience). + +When you open up a LaTeX file, all the portions will be automatically folded up. +However, no new folds will be created until you press <F6> or \rf. (rf stands +for "refresh folds"). + +The fold-text is set to the first line of the folded text unless the fold is a +table, figure etc. (an environment). In this case, if a \caption and/or a label +is found in the folded region, then those are used to make a more meaningful +fold-text, otherwise the second line of the environment is displayed along with +the name of the environment. In other words, the following > + \begin{figure}[h] + \centerline{\psfig{figure=slidercrank.eps,height=6cm}} + \caption{The Slider Crank Mechanism.} + \label{fig:slidercrank} + \end{figure} + % a LaTeX comment. + \begin{eqnarray} + \sin(\pi) = 0 + \end{eqnarray} + + +will be shown as: > + +--- 5 lines: figure (fig:slidercrank) : The Slider Crank Mechanism. ----- + % a LaTeX comment. + +--- 3 lines: eqnarray () : \sin(\pi) = 0 -------------------------------- + + + +-------------------------------------------------------------------------------- +Default Folding Scheme in Latex-Suite *ls_8_1* *ls_a_cj* + *default-folding* + +By default Latex-Suite creates folds in the following manner: + + > + \chapter + \section + %%fakesection + \subsection + \subsubsection + \item + \equation + \eqnarray + \figure + \table + \footnote +The indentation shows the "nestedness" of the folding scheme. See the next +section [|ls_a_ck|] to see how you can change this scheme. + +-------------------------------------------------------------------------------- +Customizing what to fold *ls_8_2* *ls_a_ck* + *customizing-what-to-fold* + +From version 1.6 onwards, the folding in Latex-Suite can be controlled to a +large extent via a number of global variables. + + + +Tex_FoldedSections *ls_8_2_1* *ls_a_cl* + *Tex_FoldedSections* + +This entry defines which sections will be folded. This setting is a comma +separated list of section names. The default value is: > + part,chapter,section,%%fakesection, + subsection,subsubsection,paragraph +Each of the entries in the list will fold up a section of the corresponding +name. The %%fakesection section is provided as a means for the user to group +lines into "fake" sections. A %%fakesection is assumed to start on a line which +begins with the string %%fakesection and continue till the start of the next +\section, \subsection or any other section. + +See also advanced fold settings [|ls_a_cp|]. + + +Tex_FoldedEnvironments *ls_8_2_2* *ls_a_cm* + *Tex_FoldedEnvironments* + +This entry defines which environments will be folded. It is a comma separated +string of words each of which defines a single environment. The default setting +is > + verbatim,comment,eq,gather, + align,figure,table,thebibliography, + keywords,abstract,titlepage +The words need not be standard Latex environments. You can add any word you +like. Also, each word will fold up all environments whose name begins with that +word. For example, in the setting above, the word "eq" folds up the +\begin{equation}, \begin{eqnarray}, \begin{eqnarray*} environments. To avoid +this, you can replace the word "eq" with "eq}". + +See also advanced fold settings [|ls_a_cp|]. + + +Tex_FoldedCommands *ls_8_2_3* *ls_a_cn* + *Tex_FoldedCommands* + +This entry defines which commands will be folded. It is a comma separated string +of words each of which defines a single command. The default setting is empty, +i.e no commands are folded. The words need not be standard Latex commands. You +can use whatever words you like. Each word will fold all commands whose name +begins with that word as in the case of the Tex_FoldedEnvironments [|ls_a_cm|] +variable. + +NOTE: It is very difficult to fold commands reliably because it is very + difficult to create a regexp which will match a line containing unmatched + parentheses (or curly brackets), but will not match a line containing + matched parentheses. + + Just to make things safer, only lines which start a command but do not + contain additional curly braces after the command has started are folded. + In other words, if you wanted to fold the the command "mycommand", then + the lines > + \mycommand{This is a line + and some more text on the next line + } +< will be folded, but the lines > + \mycommand{This is a \textbf{line} + and some more text + } +< will not be folded. This is a bug which is very difficult to fix. + + +See also advanced fold settings [|ls_a_cp|]. + + +Tex_FoldedMisc *ls_8_2_4* *ls_a_co* + *Tex_FoldedMisc* + +This entry defines fold syntax for certain items which do not naturally fit into +the section, environment of command lists. It is a comma separated list of +words. The default value is: > + item,preamble,<<< +NOTE: Unlike the other Tex_FoldedXXXX variables, the words in this setting are + limited to take values from the following list: + + Value Meaning~ + comments Folds up contiguous blocks of comments + item Folds up the \items within list environments + preamble Folds up the preamble of a document. (The part between the + \documentclass command and the \begin{document} environment) + <<< Folds defined manually by the user using the <<< and >>> strings + as fold-markers. + + Any other words in the Tex_FoldedMisc setting are silently ignored. + + + +See also advanced fold settings [|ls_a_cp|]. + + +Advanced Fold setting details *ls_8_2_5* *ls_a_cp* + *fold-setting-advanced* + +The order of the words in the Tex_FoldedXXXX variables is _important_. The order +defines the order in which the folds are nested. For example, the value +"subsection,section" for the Tex_FoldedSections variable will not fold any +subsections at all. This is because the folds are created in the _reverse_ order +in which they occur in the Tex_FoldedSections setting and also, once a fold is +created, the interior of the fold is not examined for creating additional folds. +In the above case, this means that a \section is folded first and then its +interior is not examined further. The correct value should have been +"section,subsection" + + *fold-setting-adding* *ls_a_ee* +Each of the fold setting variables Tex_FoldedSections, Tex_FoldedEnvironments +etc., as explained previously is a comma separated string of variables. However, +to make it easier to _add_ to the default settings without having to repeat the +whole default setting again, Latex-Suite uses the following logic in forming the +complete setting string from the Tex_FoldedXXXX variables. If the variable +starts with a comma, then Tex_FoldedXXXX is added to the end of the default +string rather than replacing it. Similarly, if it ends with a comma, then it +will be prepended to the beginning of the default setting rather than replacing +it. + +For example, if Tex_FoldedEnvironments is set to the string "myenv", then only +an environment of the form \begin{myenv} will be folded. However, if the +Tex_FoldedEnvironments setting is ",myenv", then the \begin{myenv} environment +will be folded after all other environments in the default setting have been +folded. On the other hand if Tex_FoldedEnvironments is of the form "myenv,", the +\begin{myenv} environment will be folded before the rest of the environments in +the default setting. + +-------------------------------------------------------------------------------- +Editing the folding.vim file directly *ls_8_3* *ls_a_cq* + *editing-folding* + +If you are using version 1.5 of Latex-Suite or older, you will need to directly +edit the $VIM/ftplugin/latex-suite/folding.vim file if you wish to modify the +folding scheme. You will need to modify the function MakeTexFolds() defined in +that file to modify the fold syntax. MakeTexFolds makes a number of calls to +AddSyntaxFoldItem. Each such call defines a new "fold item". The order in which +these calls are made defines how the folds are nested. For example, if you +desire an figure environment to be nested within a section, then you should +define the fold for the figure first. The syntax of AddSyntaxFoldItem is as +follows: > + AddSyntaxFoldItem(startpat, endpat, startoff, endoff [, startskip, endskip]) +If the last two arguments are omitted, then they are assumed to default to the +empty strings ''. The explanation for each argument is as follows: + +Argument Explanation~ +startpat a line matching this pattern defines the beginning of a fold. +endpat a line matching this pattern defines the end of a fold. +startoff this is the offset from the starting line at which folding will + actually start +endoff like startoff, but gives the offset of the actual fold end from the + line satisfying endpat. startoff and endoff are necessary when the + folding region does not have a specific end pattern corresponding to + a start pattern. for example in LaTeX, \section{Section Name} defines + the beginning of a section, but there is no command which + specifically ends a section. Thus a \section is assumed to end 1 line + _before_ another section starts. +startskip A Pattern Which Defines The Beginning Of A "Skipped" Region. + + For example, suppose we define a \itemize fold as follows: > + = '^\s*\\item', + = '^\s*\\item\|^\s*\\end{\(enumerate\|itemize\|description\)}', + = 0, + = -1 +< + + This defines a fold which starts with a line beginning with an \item + and ending one line before a line beginning with an \item or + \end{enumerate} etc. + + Then, as long as \item's are not nested things are fine. However, + once items begin to nest, the fold started by one \item can end + because of an \item in an \itemize environment within this \item. + i.e, the following can happen: > + \begin{itemize} + \item Some text <------- fold will start here + This item will contain a nested item + \begin{itemize} <----- fold will end here because next line contains \item... + \item Hello + \end{itemize} <----- ... instead of here. + \item Next item of the parent itemize + \end{itemize} +< + + Therefore, in order to completely define a folding item which allows + nesting, we need to also define a "skip" pattern. startskip and end + skip do that. Leave '' when there is no nesting. +endskip the pattern which defines the end of the "skip" pattern for nested + folds. + +NOTE: Example 1 + --------- + A syntax fold region for the latex section is defined with the following + arguments to AddSyntaxFoldItem: > + startpat = "\\section{" + endpat = "\\section{" + startoff = 0 + endoff = -1 + startskip = '' + endskip = '' +< Note that the start and end patterns are thus the same and endoff has a + negative value to capture the effect of a section ending one line before + the next starts. + + +NOTE: Example 2 + --------- + A syntax fold region for the \itemize environment is: > + startpat = '^\s*\\item', + endpat = '^\s*\\item\|^\s*\\end{\(enumerate\|itemize\|description\)}', + startoff = 0, + endoff = -1, + startskip = '^\s*\\begin{\(enumerate\|itemize\|description\)}', + endskip = '^\s*\\end{\(enumerate\|itemize\|description\)}' +< Note the use of startskip and endskip to allow nesting. + + + +================================================================================ +Multiple file LaTeX projects *ls_9* *ls_a_cr* + *latex-project* + +|ls_9_1| Latex-Suite project settings +|ls_9_2| Specifying which file to compile + + + *latex-project-example* *ls_a_ef* +Many LaTeX projects contain multiple source files which are \included from a +master file. A typical example of this situation is a directory layout such as +the following + + > + thesis/ + main.tex + abstract.tex + intro/ + intro.tex + figures/ + fig1.eps + fig2.eps + chapter1/ + chap1.tex + figures/ + fig1.eps + conclusion/ + conclusion.tex + figures/ + + +In the above case, main.tex will typically look like + + > + % file: main.tex + \documentclass{report} + \begin{document} + + \input{abstract.tex} + \input{intro/intro.tex} + \input{chapter1/chap1.tex} + \input{conclusion/conclusion.tex} + + \end{document} + + + *latex-master-file-specification* *ls_a_eg* +In such situations, you will need to convey to Latex-Suite that main.tex is the +main file which \inputs the other files. This is done by creating an empty file +called main.tex.latexmain in the same directory in which main.tex resides. This +file is called the _master file_ in this manual. See Tex_MainFileExpression +[|ls_a_eh|] for an alternative way of specifying the master file. + +NOTE: Here main.tex.latexmain is (obviously) a different file from main.tex + itself. main.tex need not be renamed. This ofcourse restricts each + directory to have a single master file. + + +Each time Latex-Suite opens a new LaTeX file, it will try to see if it is part +of a multiple file project by searching upwards (to the root of the file-system) +from the current file's directory to see if it finds a file of the form +*.latexmain. If such a file is found, then it is considered that the current +file is part of a larger project. The name of the LaTeX master file is inferred +directly from the first part of the *.latexmain file as described in the example +above. + + +-------------------------------------------------------------------------------- +Latex-Suite project settings *ls_9_1* *ls_a_cs* + *latex-project-settings* + +If a master file [|ls_a_ct|] is found, then Latex-Suite :sources the file. Thus +this file needs to contain valid Vim commands. This file is typically used to +store project specific settings. + +Some typical per-project settings which are best put in the master file are +Tex_ProjectSourceFiles [|ls_a_dt|] + +-------------------------------------------------------------------------------- +Specifying which file to compile *ls_9_2* *ls_a_ct* + *latex-master-file* + +In the example described previously [|ls_a_ef|], if you are editing +intro/intro.tex and press \ll, then you still want Latex-Suite to compile +main.tex, because intro/intro.tex is merely a fragment which is \input'ed into +main.tex. If the master file is already specified using the *.latexmain +convention described previously [|ls_a_ef|], then Latex-Suite will automatically +compile the master file when you are editing any of its \input'ed fragments. +Thus pressing \ll while editing intro/intro.tex will compile main.tex. + + *Tex_MainFileExpression* *ls_a_eh* +If you wish to use some different logic to specify the main file name, you can +specify a custom expression via the Tex_MainFileExpression variable. This is a +string containing a valid vim expression. In addition, you can use a variable +modifier which is in the format used for |filename-modifiers|, for example, +':p:h'. You should utilize this variable to modify the filename of the main +file. > + let g:Tex_MainFileExpression = 'MainFile(modifier)' + function! MainFile(fmod) + if glob('*.latexmain') != '' + return fnamemodify(glob('*.latexmain'), a:fmod) + else + return '' + endif + endif + + +================================================================================ +Latex-Suite Commands and Maps *ls_10* *ls_a_cu* + *latex-suite-commands-maps* + +|ls_10_1| Latex-Suite Maps +|ls_10_2| Latex Suite Commands + + +This section describes the maps and commands used in Latex-Suite. It also +describes a way to change the map sequences according to your preference. + + +-------------------------------------------------------------------------------- +Latex-Suite Maps *ls_10_1* *ls_a_cv* + *latex-suite-maps* + + *remapping-latex-suite-keys* *ls_a_ei* +Most of the mappings used in Latex-Suite can be mapped to a different key +combination to suit your particular needs. An example best explains the +procedure for doing this. Suppose you want to remap the <C-j> key which +Latex-Suite (actually imaps.vim) uses to jump to the next placeholder. To do +this, you first need to find out which <Plug> mapping <C-j> is derived from. You +will need to look at the relevant section of this manual to do this. For +example, the section IMAP mappings [|ls_a_cw|] has the information that the +<C-j> key is derived from <Plug>IMAP_JumpForward. Therefore to remap the <C-j> +key to say <C-space>, you will need to put a statement like the following in +your ~/.vimrc. > + imap <C-space> <Plug>IMAP_JumpForward + + +NOTE: To change the IMAP mappings which affect jumping between placeholders, the + map statement above has to be placed in your ~/.vimrc. For other mappings + you can place the map statement in your $VIM/ftplugin/tex.vim file. The + reason for this is that the <C-j> maps are created in plugin/imaps.vim, + which is sourced as soon as Vim starts before sourcing any ftplugin files. + + + + +IMAP mappings *ls_10_1_1* *ls_a_cw* + *customize-imap-maps* + +These mappings are utilized for jumping between placeholders as described here +[|ls_a_eD|]. See the parent section [|ls_a_cv|] to find out how to use this +information to change the default maps. + + *Plug_IMAP_JumpForward* *ls_a_ej* + *Plug_IMAP_JumpBack* *ls_a_ek* + *Plug_IMAP_DeleteAndJumpForward* *ls_a_el* + *Plug_IMAP_DeleteAndJumBack* *ls_a_em* +Plug map Default Key~ +<Plug>IMAP_JumpForward <C-j> +<Plug>IMAP_JumpBack (none) +<Plug>IMAP_DeleteAndJumpForward (none) +<Plug>IMAP_DeleteAndJumpBack (none) + +<Plug>IMAP_JumpForward takes you to the location of the next place-holder +[|ls_a_eD|]. + +<Plug>IMAP_JumpBack takes you to the previous place-holder [|ls_a_eD|]. + +<Plug>IMAP_DeleteAndJumpForward deletes the presently selected place-holder and +jumps to the next place-holder irrespective of whether the present placeholder +is empty or not and ignoring the value of place-holder settings like +g:Imap_DeleteEmptyPlaceHolders [|ls_a_cW|] and g:Imap_StickyPlaceHolders +[|ls_a_cX|] + +<Plug>IMAP_DeleteAndJumpBack deletes the presently selected place-holder and +jumps to the previous place-holder irrespective of whether the present +placeholder is empty or not and ignoring the value of place-holder settings like +g:Imap_DeleteEmptyPlaceHolders [|ls_a_cW|] and g:Imap_StickyPlaceHolders +[|ls_a_cX|] + + +Alt-Key mappings *ls_10_1_2* *ls_a_cx* + *customize-alt-key-maps* + +These mappings are are described in the section Alt key macros [|ls_a_bA|]. See +the parent section [|ls_a_ei|] to see how to use the following information to +remap keys. + + *Plug_Tex_MathBF* *ls_a_en* + *Plug_Tex_MathCal* *ls_a_eo* + *Plug_Tex_LeftRight* *ls_a_ep* + *Plug_Tex_InsertItemOnThisLine* *ls_a_eq* +Plug Mapping Default Key~ +<Plug>Tex_MathBF <Alt-B> +<Plug>Tex_MathCal <Alt-C> +<Plug>Tex_LeftRight <Alt-L> +<Plug>Tex_InsertItemOnThisLine <Alt-I> + +-------------------------------------------------------------------------------- +Latex Suite Commands *ls_10_2* *ls_a_cy* + *latex-suite-commands* + + + +:TMacro [{macro}] *ls_10_2_1* *ls_a_cz* *TMacro* + +When used without any arguments lists all available macros defined in runtime +ftplugin/latex-suite/macros/ directories and prompts you to choose one of them. +With one argument |:read| this macro under cursor position. With more than one +argument it will not work :) In Vim >= 6.2 works completion of names of macros +(see 'wildmenu', 'wildmode' for more about command-line completion). + + +:TMacroEdit [{macro}] *ls_10_2_2* *ls_a_cA* + *TMacroEdit* + +Splits window for editing {macro}. When used without any arguments lists all +available macros defined in runtime ftplugin/latex-suite/macros/ directories and +prompt you to choose one of them. When you try to edit {macro} not from local +directory Latex-Suite will copy it to your local directory with suffix "-local". +If local copy already exists Latex-Suite prompt for overwriting it. In Vim >= +6.2 works completion of names of macros (see 'wildmenu', 'wildmode' for more +about command-line completion). + + +:TMacroNew *ls_10_2_3* *ls_a_cB* + *TMacroNew* + +Splits window to write new macro. Directory in new buffer is locally changed to +Latex-Suite/macros/. + + +:TMacroDelete [{macro}] *ls_10_2_4* *ls_a_cC* + *TMacroDelete* + +Delets {macro} from your local ftplugin/latex-suite/macros/ directory. When used +without any arguments lists all available macros defined in Latex-Suite/macros/ +directory and prompt you to choose one of them. When you choose to delete +{macro} which is not in your local directory Latex-Suite will refuse to delete +it. In Vim >= 6.2 works completion of names of macros (see 'wildmenu', +'wildmode' for more about command-line completion) + + +:TPackage [{package, ...}] *ls_10_2_5* *ls_a_cD* + *TPackage* + +When used without any arguments lists name of the packages for which support is +available. If you are using Vim GUI and have Tex_Menus set to 1, then it will +list all files found in the $VIM/ftplugin/latex-suite/packages directory. +Otherwise, Latex-Suite will list files found in the +$VIM/ftplugin/latex-suite/dictionaries directory. Choosing a file from the list +will insert a > + \usepackage[<++>]{<packname>} +line into the buffer at the current cursor location. For Vim 6.2 and above, you +can use command-line completion to choose a package file. You can also call +TPackage with one or more package names separated with spaces in which case, +Latex-Suite will insert \usepackage lines for each of them in turn. + +After inserting the \usepackage line(s), Latex-Suite will support it (them) in +various ways as described in the section Actions taken for supported packages +[|ls_a_bL|]. + + +:TPackageUpdate *ls_10_2_6* *ls_a_cE* + *TPackageUpdate* + +This command `reads' name of package under cursor and turns on possible support. + + +:TPackageUpdateAll *ls_10_2_7* *ls_a_cF* + *TPackageUpdateAll* + +After issuing this command latexSuite scans the file in looking for not declared +packages, removing not needed entries from Packages menu and turning off not +necessary packages' dictionaries. + + +:TTemplate [{template}] *ls_10_2_8* *ls_a_cG* + *TTemplate* + +When used without any arguments lists all available templates from +latex-suite/templates/ directory and prompts to choose one of them. With one +argument :0|read| {template} file. With more than one argument it will not work +:) In Vim >= 6.2 works completion of names of macros (see 'wildmenu', 'wildmode' +for more about command-line completion) + + +:TSection [{argument}] *ls_10_2_9* *ls_a_cH* + *TSection* + +Used without any arguments inserts last section type (|latex-sectioning|). +Accepts arguments: n> inserts section name in <n> logical level. Levels are: +0 part +1 chapter +2 section +3 subsection +4 subsubsection +5 paragraph +6 subparagraph + + ++<n> inserts section name <n> logical levels above the last used comand +-<n> inserts section name <n> logical levels below the last used comand ++ inserts section name one logical level below the last used command (equal + to +1). +++ inserts section name two logical levels below the last used command (equal + to +2). +- inserts section name one logical level over the last used command (equal + to -1). +-- inserts section name two logical levels over the last used command (equal + to -2). + + + +Command accepts also latexSuite mappings (|latex-macros|) without preceding S +and in lowercase: > + :TSection pa +will result in \part{}. It is possible to use full names of sections: :TSection +part + + +:TSectionAdvanced *ls_10_2_10* *ls_a_cI* + *TSectionAdvanced* + +Accepts the same arguments as |TSection| but leads to a couple of questions +(whether you want to include the section in the table of contents, whether there +is a shorter name for the table of contents) and then creates a more intelligent +template. + + +:TLook *ls_10_2_11* *ls_a_cJ* *TLook* + +Accepts one argument. Will look through .tex files in directory of edited file +for argument. It can be regexp. You don't have to enclose argument in "". <cr> +takes you to location. Other keys work as described in |latex-viewer|. Note: +TLook uses :grep command and is using 'grepprg'. Its regular expressions can be +different from those of Vim. + + +:TLookBib *ls_10_2_12* *ls_a_cK* + *TLookBib* + +Accepts one argument. Will look through .bib files in directory of edited file +for argument. It can be regexp. You don't have to enclose argument in "". <cr> +takes you to location. Other keys work as described in |latex-viewer|. + +NOTE: TLookBib uses :grep command and is using 'grepprg'. Its regular + expressions can be different from those of Vim. + + + + +:TLookAll *ls_10_2_13* *ls_a_cL* + *TLookAll* + +Accepts one argument. Will look through all files in directory of edited file +for argument. It can be regexp. You don't have to enclose argument in "". <cr> +takes you to location. Other keys work as described in |latex-viewer|. Note: +TLook uses :grep command and is using 'grepprg'. Its regular expressions can be +different from those of Vim. + + +:TPartComp *ls_10_2_14* *ls_a_cM* + *TPartComp* + +No argument allowed but accepts range in all formats. Define fragment of +interest with :'a,'b, :/a/,/b/, :'<,'> or :20,30. All other rules of compilation +apply. + + +:TPartView *ls_10_2_15* *ls_a_cN* + *TPartView* + +Show last compiled fragment. All rules of viewing apply but |latex-searching|. + + +:Tshortcuts [{arg}] *ls_10_2_16* *ls_a_cO* + *Tshortcuts* + +Show shortcuts in terminal (not using menu). Without {arg} you will see simple +menu prompting for one of them. Possible arguments: +g General shortcuts +e Environment shortcuts +f Font shortcuts +s Section shortcuts +m Math shortcuts +a All shortcuts + +================================================================================ +Customizing Latex-Suite *ls_11* *ls_a_cP* + *customizing-latex-suite* + +|ls_11_1| General Settings +|ls_11_2| Place-Holder Customization +|ls_11_3| Macro Customization +|ls_11_4| Smart Key Customization +|ls_11_5| Latex Completion Customization +|ls_11_6| Compiler Customization +|ls_11_7| Viewer Customization +|ls_11_8| Menu Customization +|ls_11_9| Folding Customization +|ls_11_10| Package Handling Customization + + +Customizing Latex-Suite is done by defining certain global variables in +$VIM/ftplugin/tex.vim, where $VIM corresponds to ~/.vim for *nix machines and +~/vimfiles for windows machines. This file is not part of the Latex-Suite +distribution. You will need to create this file yourself (or modify it if it +exists) if you need to change any default settings. Since this file is not +included as part of the Latex-Suite distribution, it will not be over-written in +subsequent updates. + +The default settings in Latex-Suite are defined in +$VIM/ftplugin/latex-suite/texrc. Please take a look at this file if you find +this documentation incomplete or confusing. That file is also well documented. + +This chapter describes the various settings which effect Latex-Suite and their +default values. The settings are broken up into sections according to the +behavior which they influence. + + +-------------------------------------------------------------------------------- +General Settings *ls_11_1* *ls_a_cQ* + *ls-general-purpose-settings* + + + +Tex_Debug *ls_11_1_1* *ls_a_cR* + *Tex_Debug* + +Type boolean +Default Value 0 + +If set to 1, then Latex-Suite will create certain global debug statements which +can be printed by doing > + :call Tex_PrintDebug() + + + +Tex_UsePython *ls_11_1_2* *ls_a_cS* + *Tex_UsePython* + +Type boolean +Default Value 1 + +If Latex-Suite detects that your vim is python enabled (using has('python')), +then it tries to use python in certain places to speed things up. If this +misbehaves, you can set this to zero, in which case, Latex-Suite will use +vimscript to accomplish the same. + +-------------------------------------------------------------------------------- +Place-Holder Customization *ls_11_2* *ls_a_cT* + *customizing-place-holders* + +Latex-Suite uses place-holders [|ls_a_eD|] to minimize using the movement keys +while typing. The following settings affect how place-holders are used. + +NOTE: These setting need to be set in your ~/.vimrc, not $VIM/ftplugin/tex.vim + because these settings affect the behavior of imaps.vim, which is a global + plugin, not a file-type plugin. + + + + +g:Imap_UsePlaceHolders *ls_11_2_1* *ls_a_cU* + *Imap_UsePlaceHolders* + + +Type Boolean +Default Value 1 + +Setting this to zero completely disables using place-holders. + + +g:Imap_PlaceHolderStart & g:Imap_PlaceHolderEnd *ls_11_2_2* *ls_a_cV* + *Imap_PlaceHolderStart* + + *Imap_PlaceHolderEnd* *ls_a_er* +Setting Type Value~ +Imap_PlaceHolderStart String '<+' +Imap_PlaceHolderEnd String '+>' + +These settings affect the strings displayed at the beginning and end of the +place-holder string. Set these strings to a value different than a commonly +occurring sequence of characters. + +NOTE: TIP + --- + If you use the latin1 encoding and do not type in french, then you can set + these strings to the \xab and \xbb characters (the french quotation + marks). + + + + +g:Imap_DeleteEmptyPlaceHolders *ls_11_2_3* *ls_a_cW* + *Imap_DeleteEmptyPlaceHolders* + + +Type Boolean +Default Value 1 + +When set to one, non-descriptive or empty place-holders are deleted on pressing +<Ctrl-J>. + + +g:Imap_StickyPlaceHolders *ls_11_2_4* *ls_a_cX* + *Imap_StickyPlaceHolders* + + +Type Boolean +Default Value 1 + +When set to 1, in visual mode, <Ctrl-J> takes you to the next placeholder +without deleting the current placeholder. + +-------------------------------------------------------------------------------- +Macro Customization *ls_11_3* *ls_a_cY* + *customizing-macros* + + + +Tex_Env_name *ls_11_3_1* *ls_a_cZ* + *Tex_Env_name* + +If you wish to wish to expand certain environments differently from the way +Latex-Suite does it, you can define custom expansions using global variables of +the form Tex_Env_{name} where name corresponds to the environment. + +For example, if you press <F5> after typing theorem, Latex-Suite will by default +expand it to > + \begin{theorem} + \label{<++>}<++> + \end{theorem}<++> +However, if you wish change this to > + \begin{theorem} + <++> + \end{theorem}<++> +then define the following variable > + let g:Tex_Env_theorem = "\\begin{theorem}\<CR><++>\<CR>\\end{theorem}" +< + +If the expansion uses special keys such as carriage return etc, then use +double-quotes and use the "\<key>" notation for special keys. Backslashes have +to be doubled. + +You could even use strings returned by functions as the expansion by using the +IMAP_PutTextWithMovement() [|ls_a_ea|] function. + +If the name of the environment contains special characters (for example, the +eqnarray* environment), then use the following form: > + let g:Tex_Env_{'eqnarray*'} = + \ "\\begin{eqnarray*}\<CR><++> &=& <++>\<CR>\\end{eqnarray*}<++>" +This will make pressing <F5> after eqnarray* expand to > + \begin{eqnarray*} + <++> &=& <++> + \end{eqnarray*}<++> + + + +Tex_Com_name *ls_11_3_2* *ls_a_da* + *Tex_Com_name* + +If you wish to define new expansions for fast command insertion as described +here [|ls_a_bo|], or redefine expansions from the default values in Latex-Suite, +you will need to define variables of the form g:Tex_Com_{name} where name is a +command name. For example, with the setting > + let g:Tex_Com_frac = "\\frac{<++>}{<++>}<++>" +pressing <F7> after typing frac will change it to \frac{<++>}{<++>}<++> + +See Tex_Env_name [|ls_a_cZ|] for additional details on how to create this +setting in various special circumstances. + + +Enabling / disabling macros *ls_11_3_3* *ls_a_db* + *macro-enabling* + +The following variables disable various parts of the macro functionality of +Latex-Suite. See the links to the relevant sections to see what functionality +setting each of the variables to zero will take away. + + *Tex_EnvironmentMaps* *ls_a_es* + *Tex_EnvironmentMenus* *ls_a_et* + *Tex_FontMaps* *ls_a_eu* + *Tex_FontMenus* *ls_a_ev* + *Tex_SectionMaps* *ls_a_ew* + *Tex_SectionMenus* *ls_a_ex* +Setting Link to relevant section Default Value~ +g:Tex_EnvironmentMaps Environment Mappings [|ls_a_bf|] 1 +g:Tex_EnvironmentMenus 1 +g:Tex_FontMaps Font Mappings [|ls_a_bs|] 1 +g:Tex_FontMenus 1 +g:Tex_SectionMaps Section Mappings [|ls_a_bt|] 1 +g:Tex_SectionMenus 1 + + +g:Tex_UseMenuWizard *ls_11_3_4* *ls_a_dc* + *Tex_UseMenuWizard* + + +Type Boolean +Default Value 0 + +If this variable is set to 1, then when an environment is chosen from the menu +then for selected environments, Latex-Suite asks a series of questions on the +command line and inserts a template with the corresponding fields already filled +in. Setting this to zero will insert a template with place-holders [|ls_a_eD|] +marking off the places where fields need to be filled. + + +g:Imap_FreezeImap *ls_11_3_5* *ls_a_dd* + *Imap_FreezeImap* + +Type boolean +Default Value 0 + +This option when set to 1, temporarily freezes Latex-Suite's macro expansion. It +might be useful when you are using some other keymap which is causing excessive +macro expansion. Use a buffer-local variable of the same name if you wish to +affect just the present buffer. + + +g:Tex_CatchVisMapErrors *ls_11_3_6* *ls_a_de* + *Tex_CatchVisMapErrors* + + +Type Boolean +Default Value 1 + +With so many visual maps, its helpful to have a way of catching typing errors +made in visual mode. What this does is to prompt you to correct your visual mode +mapping if you start out with and then type some illegal keys. It basically maps +just the g:Tex_Leader character to a function. + + +g:Tex_Diacritics *ls_11_3_7* *ls_a_df* + *Tex_Diacritics* + + +Type Boolean +Default Value 0 + +Whether or not you want to use diacritics [|ls_a_bw|]. + + +g:Tex_Leader *ls_11_3_8* *ls_a_dg* + *Tex_Leader* + + +Type String +Default Value '`' + +The mappings in Latex-Suite are by default prefixed with the back-tick +character. For example, `/ inserts \frac{<++>}{<++>}<++> etc. You can change the +prefix with the following setting. ',', '/', '`' are preferred values. '' or '\' +will lead to a _lot_ of trouble. + +g:Tex_Leader is also used for visual mode mappings for fonts. + + +g:Tex_Leader2 *ls_11_3_9* *ls_a_dh* + *Tex_Leader2* + + +Type String +Default Value ',' + +In order to avoid clashes between the large number of visual mode macros +provided, the visual mode macros for environments [|ls_a_bm|] and sections start +with a character different from g:Tex_Leader. + + +g:Tex_PromptedEnvironments *ls_11_3_10* *ls_a_di* + *Tex_PromptedEnvironments* + + +Type String +Default Value 'eqnarray*,eqnarray,equation,equation*,\[,$$,align,align*' + +This string represents a comma separated list of fields corresponding to +environments. Pressing <F5> in insert-mode in the body of the document asks you +to choose from one of these environments to insert. + +Leaving this string empty will leave the <F5> key unmapped + + +g:Tex_HotKeyMappings *ls_11_3_11* *ls_a_dj* + *Tex_HotKeyMappings* + + +Type String +Default Value 'eqnarray*,eqnarray,bmatrix' + +This string represents a comma separated list of environments which are mapped +to <Shift-F-1> through <Shift-F-4>. For example, pressing <Shift-F-2> with this +setting inserts the eqnarray environment. + +Leaving this string empty will leave <Shift-F-1> through <Shift-F-4> unmapped. + +NOTE: Only the first four fields of this list are used. The rest are silently + ignored. + + + + +g:Tex_PromptedCommands *ls_11_3_12* *ls_a_dk* + *Tex_PromptedCommands* + + +Type String +Default Value 'footnote,cite,pageref,label' + +This string represents a comma separated list of LaTeX commands which +Latex-Suite uses for the <F7> and <S-F7> maps as described here [|ls_a_bo|]. + +Leaving this string empty will leave the <F7> key unmapped. + + +Tex_ItemStyle_environment *ls_11_3_13* *ls_a_dl* + *Tex_ItemStyle_environment* + +This setting affects the style which Latex-Suite uses to insert an \item when +<Alt-I> is pressed as described here [|ls_a_bE|]. By default Latex-Suite defines +styles for the following environments: + +Environment Style~ +itemize \item +enumerate \item +theindex \item +thebibliography \item[<+biblabel+>]{<+bibkey+>} <++> +description \item[<+label+>] <++> + +Each style is defined by a variable of the form g:Tex_ItemStyle_{envname} where +envname is the name of the environment for which the style is defined. For +example, by default > + g:Tex_ItemStyle_description = '\item[<+label+>] <++>' +Redefining the style for a particular environment or defining a style for an +entirely new environment is simply a matter of setting the value of a variable +of the corresponding name. + +-------------------------------------------------------------------------------- +Smart Key Customization *ls_11_4* *ls_a_dm* + *customizing-smart-keys* + +These settings affect the smart key functionality as described here [|ls_a_bz|]. + + + +g:Tex_SmartKeyBS *ls_11_4_1* *ls_a_dn* + *Tex_SmartKeyBS* + + +Type Boolean +Default Value 1 + +Whether or not <Backspace> deletes diacritics. + + +g:Tex_SmartKeyQuote *ls_11_4_2* *ls_a_do* + *Tex_SmartKeyQuote* + + +Type Boolean +Default Value 1 + +Whether or not the smart quotes [|ls_a_bz|] functionality is available. + +If enabled, the quote characters can be customized by setting the following +variables: + +Setting Value~ +g:Tex_SmartQuoteOpen "``" +g:Tex_SmartQuoteClose "''" + +Non-English users will want to change these settings to their locale. These +global variables will be ignored if there are buffer-local variables (with the +same name), which may be set in the language specific package files, such as +$VIM/ftplugin/latex-suite/packages/german. + +-------------------------------------------------------------------------------- +Latex Completion Customization *ls_11_5* *ls_a_dp* + *customizing-latex-completion* + +The following settings affect the completion [|ls_a_bR|] functionality in +Latex-Suite. + + + +Window size settings *ls_11_5_1* *ls_a_dq* + *completion-window-preferences* + +These three settings affect the aesthetics of the completion functionality. + + *Tex_ViewerCwindowHeight* *ls_a_ey* + *Tex_ViewerPreviewHeight* *ls_a_ez* + *Tex_ExplorerHeight* *ls_a_eA* + *Tex_ImageDir* *ls_a_eB* +Setting Explanation Default Value~ +g:Tex_ViewerCwindowHeight The height of the cwindow which 5 + displays the list of \labels + etc. +g:Tex_ViewerPreviewHeight The height of the preview window 10 + which shows the context of a + \label etc. +g:Tex_ExplorerHeight The height of the explorer 10 + window which lists the files + from which to choose an image + file. +g:Tex_ImageDir The directory to scan for images '' + + +g:Tex_BIBINPUTS *ls_11_5_2* *ls_a_dr* + *Tex_BIBINPUTS* + + +Type string +Default Value '' + +This string describes the directories which are scanned while trying to search +for .bib and .bbl files. See the cite completion section [|ls_a_bU|] for more +details. + +This string should be set in the syntax accepted by Vim's native 'path' setting. +Do not include the present directory '.'. While searching for bibliography +files, the present directory will be prepended to this variable. + + +Tex_UseSimpleLabelSearch *ls_11_5_3* *ls_a_ds* + *Tex_UseSimpleLabelSearch* + +When set to 1, Latex-Suite searches for \labels in all .tex files in the +directory containing the file being edited when <F9> is pressed. See \ref +completion [|ls_a_bT|] for details. + + +g:Tex_ProjectSourceFiles *ls_11_5_4* *ls_a_dt* + *Tex_ProjectSourceFiles* + + +Type String +Default Value '' + +This setting is meant to be initialized on a per-project basis using the +Latex-Suite master file [|ls_a_ct|] as described in Latex-Suite Project +[|ls_a_cr|] section. It is a list of source files which are used in the project. +If defined, then instead of using the logic described in +Tex_UseSimpleLabelSearch [|ls_a_ds|] to search for files in which to search for +\labels, we simply search for \labels in this list. This significantly reduces +the time it takes to generate the list of possible completions for large +projects. + +The list is specified as a whitespace separated list of filenames relative to +the location of the main file. + + +g:Tex_RememberCiteSearch *ls_11_5_5* *ls_a_du* + *Tex_RememberCiteSearch* + + +Type Boolean +Default Value 0 + +When this variable is non-zero, then Latex-Suite will try to remember results +from the \cite completion as described in this section [|ls_a_bV|]. + +-------------------------------------------------------------------------------- +Compiler Customization *ls_11_6* *ls_a_dv* + *customizing-compiling* + +The following settings affect Latex-Suite's compilation functionality + + + +g:Tex_DefaultTargetFormat *ls_11_6_1* *ls_a_dw* + *Tex_DefaultTargetFormat* + + +Type String +Default Value dvi for windows/*nix and pdf for mac + +Use this setting to choose the default target format. For example, setting this +to pdf makes Latex-Suite compile a pdf file when you press \ll and fire up the +pdf viewer on pressing \lv. Make sure that a rules for compiling and viewing +have been defined for this target format as described here [|ls_a_dx|] and here +[|ls_a_dF|]. + + +g:Tex_CompileRule_<format> *ls_11_6_2* *ls_a_dx* + *Tex_CompileRule_format* + +Here <format> refers to the target format for which this rule is defined. +Latex-Suite supports compiling into dvi, ps and pdf by default. All these rules +are strings defined by default as follows: + + +g:Tex_CompileRule_dvi 'latex -interaction=nonstopmode $*' +g:Tex_CompileRule_ps 'ps2pdf $*' +g:Tex_CompileRule_pdf 'pdflatex -interaction=nonstopmode $*' + +If you desire forward and inverse searching via Latex-Suite, you will need to +change g:Tex_CompileRule_dvi to include -src-specials. However, this has been +known to cause problems with the output file. Therefore, use this with care. + + +g:Tex_FormatDependency_<format> *ls_11_6_3* *ls_a_dy* + +Type string +Default Value '' + +By default, there are no format dependencies defined. Each definition is of the +form above where <format> is a string such as 'dvi' etc. + +The value of each string is a comma separated string such as 'dvi,ps'. See the +Compiler dependency [|ls_a_ca|] section to see how to use/specify this setting + + +g:Tex_MultipleCompileFormats *ls_11_6_4* *ls_a_dz* + *Tex_MultipleCompileFormats* + +Type string +Default Value 'dvi' + +This is a comma separated string of formats for which the compiler needs to be +called multiple times in order to get cross-references, citations etc right. See +the Compiling multiple times [|ls_a_cb|] section for details. + + +g:Tex_IgnoredWarnings *ls_11_6_5* *ls_a_dA* + *Tex_IgnoredWarnings* + + +Type String +Default Value a new-line separated list of patterns as described below + +The default value of this setting is > + \"Underfull\n". + \"Overfull\n". + \"specifier changed to\n". + \"You have requested\n". + \"Missing number, treated as zero.\n". + \"There were undefined references\n" + \"Citation %.%# undefined" +This setting defines a set of patterns which will be filtered out when +displaying the output from the latex compiler. This is to aid in filtering out +very common warnings/errors. + +NOTE: Remember to check the value of g:Tex_IgnoreLevel [|ls_a_dB|] when you + change this setting. For example, if you append a new pattern which you + would like to ignore by default, increase the value of g:Tex_IgnoreLevel. + + + + +g:Tex_IgnoreLevel *ls_11_6_6* *ls_a_dB* + *Tex_IgnoreLevel* + + +Type Integer +Default Value 7 + +This setting defines a "filter level" or an "ignore level". A value of 7 for +instance means that any warning/error matching with any of the first 7 fields of +g:Tex_IgnoredWarnings [|ls_a_dA|] will be ignored. Setting this value to zero +will mean that no error/warning is ignored. However, even with a value of zero, +Latex-Suite will filter out most of the text which a LaTeX compiler typically +produces. Use > + TCLevel strict +from within Vim in order to see all the lines from the compiler's output. + + +Tex_UseMakefile *ls_11_6_7* *ls_a_dC* + *Tex_UseMakefile* + +Type boolean +Default Value 1 + +When set to 1, then if a makefile or Makefile is present in the current +directory, then Latex-Suite sets the makeprg option to just "make <target>", +where <target> is the target format chosen using the TCTarget or TTarget +commands. + +When set to 0, then Latex-Suite will set the makeprg setting to whatever is +defined by the g:Tex_CompileRule_target [|ls_a_dx|] setting. + + +g:Tex_GotoError *ls_11_6_8* *ls_a_dD* + *Tex_GotoError* + + +Type boolean +Default Value 1 + +If set to 1, then pressing \ll will take you to the location of the first +warning/error, otherwise you will remain in the original location but the +errors/warnings will be listed in the preview window. + +-------------------------------------------------------------------------------- +Viewer Customization *ls_11_7* *ls_a_dE* + *customizing-viewing* + +The following settings affect how Latex-Suite will display compiled files. + + + +g:Tex_ViewRule_<format> *ls_11_7_1* *ls_a_dF* + *Tex_ViewRule_format* + +Here <format> refers to a format such as dvi, ps, etc. This variable defines the +program which will be called to display a file of that format. + +By default, Latex-Suite defines viewer programs for viewing DVI, PS and PDF +formats as follows: + + Windows Unix~ +g:Tex_ViewRule_dvi 'yap -1' 'xdvi' +g:Tex_ViewRule_ps 'gsview32' 'ghostview' +g:Tex_ViewRule_pdf 'AcroRd32' 'xpdf' + +For Macintosh systems, these strings are left empty by default. This lets the +system pick the program for each format. If you define these variables for Mac, +the system choice will be over-ridden. + +Latex-Suite appends file.format to the above settings while calling the external +programs. For example, with > + let g:Tex_ViewRule_dvi = 'yap -1' +yap is called as > + !start yap -1 file.dvi +from within Vim. (The initial start is used on Windows platforms is to make yap +start as a separate process.) If you find the way Latex-Suite constructs the +command line too restrictive, you can use the Tex_ViewRuleComplete_format +[|ls_a_dG|] setting for more complete control on how the command line is +constructed while calling the external program for viewing. + +NOTE: For windows, you will need to set the $PATH variable to include the paths + to yap, AcroRd32, gsview32 and any other programs. See your system + documentation for how to do this. + + +NOTE: Default Viewing Format + ---------------------- + To change the default format for viewing files, set the + g:Tex_DefaultTargetFormat [|ls_a_dw|] variable. + + + + +Tex_ViewRuleComplete_<format> *ls_11_7_2* *ls_a_dG* + *Tex_ViewRuleComplete_format* + +Here <format> refers to the extension of a output format such as dvi, html etc. + +Tex_ViewRuleComplete_format takes precedence over Tex_ViewRule_format if both +are specified. By default, Latex-Suite does not define values for +Tex_ViewRuleComplete_format for any format. Unlike in the case of +Tex_ViewRule_format, Latex-Suite does not modify Tex_ViewRuleComplete_format at +all in constructing the command line. The only modification is to substitute +'$*' everywhere in the string with the name of the file being viewed (without +the extension). + +NOTE: IMPORTANT + --------- + Make sure you make the process go into the background otherwise vim will + wait for the viewer to terminate before letting you edit the file again. + + To make a process go into the background on a *nix platform, use a + trailing & in the setting. On Windows, use start at the beginning of the + setting. Example: Suppose you have a latex->html converter which converts + a file say foo.tex to a file foo/index.html. Then you would use: > + " On *nix platform + let g:Tex_ViewRuleComplete_html = 'MozillaFirebird $*/index.html &' + " On windows platform + let g:Tex_ViewRuleComplete_html = 'start MozillaFirebird $*/index.html' +< + + + +-------------------------------------------------------------------------------- +Menu Customization *ls_11_8* *ls_a_dH* + *customizing-menus* + +In addition to using the variables defined in this section to affect the +menu-layout permanently (i.e, the layout Latex-Suite will start with), you can +also use the TeX-Suite > Configure Menu menu to dynamically configure the menu +layout after Latex-Suite has started. + + + +g:Tex_Menus *ls_11_8_1* *ls_a_dI* + *Tex_Menus* + + +Type Boolean +Default Value 1 + +If set to 0, Latex-Suite will suppress showing all menus. Useful if you mostly +work in terminals. + + +g:Tex_MainMenuLocation *ls_11_8_2* *ls_a_dJ* + *Tex_MainMenuLocation* + + +Type number +Default Value 80 + +This setting decides the location of the first top-level Latex-Suite menu. You +can for example shift all the menus created by Latex-Suite to the very end by +setting this value to a large number like 990. + + +g:Tex_MathMenus *ls_11_8_3* *ls_a_dK* + *Tex_MathMenus* + + +Type Boolean +Default Value 1 + +The Tex-Math menu consists of hundreds of mathematical symbols used in LaTeX. +This menu comprises about 75% of the menus. + + +g:Tex_NestElementMenus *ls_11_8_4* *ls_a_dL* + *Tex_NestElementMenus* + + +Type Boolean +Default Value 1 + +This setting controls the "compactness" of the menus. If set to 1, then the +Font, Counter and Dimensioning menus are collected together in a single menu +called Tex-Elements, otherwise, they will each get a separate menu. + + +g:Tex_PackagesMenu *ls_11_8_5* *ls_a_dM* + *Tex_PackagesMenu* + + +Type Boolean +Default Value 1 + +Setting this to zero will stop Latex-Suite from automatically creating the +TeX-Suite > Packages > Supported menu at startup. You can still create the menu +after startup by going to TeX-Suite > Configure Menu. + + +g:Tex_NestPackagesMenu *ls_11_8_6* *ls_a_dN* + *Tex_NestPackagesMenu* + + +Type String +Default Value 'TeX-' + +This string is the prefix added to all the menus created by Latex-Suite. If you +define this variable with a dot ('.') as the last character, then all the menus +created by Latex-Suite will be nested under a single master menu. For example, +set this to '&LaTeX-Suite.' to nest all menus under a menu called &LaTeX-Suite. + + +g:Tex_UseUtfMenus *ls_11_8_7* *ls_a_dO* + *Tex_UseUtfMenus* + + +Type Boolean +Default Value 0 + +This setting controls whether Latex-Suite uses utf-8 symbols to display some of +the mathematical symbols in the TeX-Math menu. It is necessary for your +system/GUI to support utf-8. Setting this to 1 has the side-effect of setting +the 'encoding' option of Vim to 'utf-8'. + +-------------------------------------------------------------------------------- +Folding Customization *ls_11_9* *ls_a_dP* + *customizing-folding* + +The following settings control the folding [|ls_a_ci|] functionality of +Latex-Suite. + + + +g:Tex_Folding *ls_11_9_1* *ls_a_dQ* + *Tex_Folding* + + +Type Boolean +Default Value 1 + +Setting this to zero completely disables Latex-Suite's folding functionality. +However, the TexFoldTextFunction() is still available in case you want to use +another folding scheme but still want to continue using the fold text function. + + +g:Tex_AutoFolding *ls_11_9_2* *ls_a_dR* + *Tex_AutoFolding* + + +Type Boolean +Default Value 1 + +This setting controls whether Latex-Suite automatically creates manual folds for +a file when it is opened. You can still use the \rf mapping to refresh/create +folds even when this variable is set to zero. + +-------------------------------------------------------------------------------- +Package Handling Customization *ls_11_10* *ls_a_dS* + *customizing-packages* + +These settings affect the custom packages [|ls_a_bN|] functionality in +Latex-Suite + + + +g:Tex_TEXINPUTS *ls_11_10_1* *ls_a_dT* + *Tex_TEXINPUTS* + + +Type string +Default Value '' + +This setting describes the directories scanned by Latex-Suite while searching +for custom user packages as described in the custom packages [|ls_a_bN|] +section. Do not include the present directory in this setting. The present +directory is always scanned for custom packages. + +This string should be set in the syntax accepted by Vim's native 'path' setting. + +================================================================================ +Credits *ls_12* *ls_a_dU* + *latex-suite-credits* + + + +And finally, the credits: + + +Artur R. Czechowski maintains the BSD package of Latex-Suite. Lots of valuable + feedback. +Lubomir Host provided the diacritics and also helped in development. +Alexander Wagner valuable suggestions during development. +Luc Hermitte his variation of Stephen Riehm's bracketing system is used + in Latex-Suite. +Gergely Kontra the clever little JumpFunc() in imaps.vim is due to him. + The implementation of the templates also borrows from + mu-template.vim by him. +Dimitri Antoniou author of ltags and also provided the nice tip about + forward / reverse search on DVI documents. +Stephen Riehm the extremely helpful bracketing system is from him. +Alan Schmitt provided macros/folding elements. Continued feedback, + bug-reports/fixes. +Hari Krishna Dara for ExecMap(), the clever little function which makes + typing visual mode mappings so much easier and error-free. +Alan G Isac for the comprehensive BibT() function for entering bibtex + entries. +Gontran Baerts for libList.vim +Peter Heslin useful discussion and also a lot of bug fixes. the + %%fakesection in folding.vim. +Zhang Lin-bo lots of very useful additions to folding. The code for + customizing the folding scheme is due to him. + +A large number of functions in Latex-Suite come from various other people. Some +of those people might have been missed here. Each function should however have +the author's name/e-mail above it. Thats the more authoritative place to check +out who has done what. + + *latex-suite-maintainer* *ls_a_eC* +The current maintainer(s) of Latex-Suite is(are) + + +Srinath Avadhanula <srinath@fastmail.fm> + +Mikolaj Machowski <mikmach@wp.pl> + +Benji Fisher <benji@member.AMS.org> + +================================================================================ +URLs used in this file + +*ls_u_1* : http://vim-latex.sourceforge.net +*ls_u_10* : http://developer.kde.org/~kdvi/ +*ls_u_11* : http://okular.kde.org/ +*ls_u_12* : http://math.berkeley.edu/~vojta/xdvi.html +*ls_u_13* : http://xdvi.sourceforge.net/ +*ls_u_14* : http://itexmac.sourceforge.net/pdfsync.html +*ls_u_2* : http://vim-latex.sourceforge.net/index.php?subject=download +*ls_u_3* : http://www.cygwin.com +*ls_u_4* : http://www.google.com/search?q=windows%20gnu%20grep +*ls_u_5* : http://skim-app.sourceforge.net/ +*ls_u_6* : http://pdfview.sourceforge.net/ +*ls_u_7* : http://www2.ing.unipi.it/~d9615/homepage/texniscope.html +*ls_u_8* : http://www.miktex.org/ +*ls_u_9* : http://blog.kowalczyk.info/software/sumatrapdf/ + +================================================================================ +About this file + +This file was created automatically from its XML variant using db2vim. db2vim is +a python script which understands a very limited subset of the Docbook XML 4.2 +DTD and outputs a plain text file in vim help format. + +db2vim can be obtained via anonymous CVS from sourceforge.net. Use + +cvs -d:pserver:anonymous@cvs.vim-latex.sf.net:/cvsroot/vim-latex co db2vim + +Or you can visit the web-interface to sourceforge CVS at: +http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/vim-latex/db2vim/ + +The following modelines should nicely fold up this help manual. + +vim:ft=help:fdm=expr:nowrap +vim:foldexpr=getline(v\:lnum-1)=~'-\\{80}'?'>2'\:getline(v\:lnum-1)=~'=\\{80}'?'>1'\:getline(v\:lnum)=~'=\\{80}'?'0'\:getline(v\:lnum)=~'-\\{80}'?'1'\:'=' +vim:foldtext=substitute(v\:folddashes.substitute(getline(v\:foldstart),'\\s*\\*.*',"",""),'^--','\ \ \ \ \ \ ','') +================================================================================ diff --git a/.vim/doc/latex-suite.xml b/.vim/doc/latex-suite.xml @@ -0,0 +1,4665 @@ +<?xml version='1.0' encoding='ISO-8859-1'?> + +<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" + "docbook-xml/docbookx.dtd" +[<!ENTITY dummy "dummy"> + <!ENTITY date "$Date: 2010-01-29 00:30:56 +0100 (Fr, 29. Jan 2010) $"> + <!ENTITY ls "Latex-Suite"> + <!ENTITY latex "LaTeX"> + <!ENTITY vim "Vim"> + <!ENTITY ph "&lt;++&gt;"> +]> +<article lang="en"> + <articleinfo id="articleinfo"> + + <title id="articleinfo-title">&ls; Reference</title> + + <author> + <firstname>Srinath</firstname> + <surname>Avadhanula</surname> + <affiliation> + <address><email>srinath AT fastmail DOT fm</email></address> + </affiliation> + </author> + <author> + <firstname>Mikolaj</firstname> + <surname>Machowski</surname> + <affiliation> + <address><email>mikmach AT wp DOT pl</email></address> + </affiliation> + </author> + + <date>&date;</date> + <abstract> + <para> + &ls; attempts to provide a comprehensive set of tools to + view, edit and compile LaTeX documents in Vim. Together, they + provide tools starting from macros to speed up editing LaTeX + documents to functions for forward searching .dvi documents. + &ls; has been possible because of the contributions of many + people. Please see <link + linkend="latex-suite-credits">latex-suite-credits</link> for a list of + people who have helped. + </para> + <para> + &ls; is released under the Vim charityware license. For + license and conditions of use look at |copyright|. Replace all + occurrences of ``Vim'' with ``Latex-Suite''. The current copyright + holders of &ls; are Srinath Avadhanula and Mikolaj Machowski. + </para> + <para> + Homepage: <ulink url="http://vim-latex.sourceforge.net">http://vim-latex.sourceforge.net</ulink> + </para> + </abstract> + </articleinfo> + <section id="recommended-settings"> + <title>Installation and recommended Settings</title> + <para> + If you are reading this, it most probably means that you have already + installed &ls; and the help files. If this is not the case, follow the + detailed instructions on <ulink + url="http://vim-latex.sourceforge.net/index.php?subject=download">&ls;'s + download page</ulink>. + </para> + <para> + Make sure that you create a few necessary settings in your + <literal>~/.vimrc.</literal> + <programlisting> +" REQUIRED. This makes vim invoke &ls; when you open a tex file. +filetype plugin on + +" IMPORTANT: win32 users will need to have 'shellslash' set so that latex +" can be called correctly. +set shellslash + +" IMPORTANT: grep will sometimes skip displaying the file name if you +" search in a singe file. This will confuse &ls;. Set your grep +" program to always generate a file-name. +set grepprg=grep\ -nH\ $* + +" OPTIONAL: This enables automatic indentation as you type. +filetype indent on + +" OPTIONAL: Starting with Vim 7, the filetype of empty .tex files defaults to +" 'plaintex' instead of 'tex', which results in vim-latex not being loaded. +" The following changes the default filetype back to 'tex': +let g:tex_flavor='latex' +</programlisting> + </para> + <para> + In addition, the following settings could go in your ~/.vim/ftplugin/tex.vim + file: + <programlisting>" this is mostly a matter of taste. but LaTeX looks good with just a bit +" of indentation. +set sw=2 +" TIP: if you write your \label's as \label{fig:something}, then if you +" type in \ref{fig: and press &lt;C-n&gt; you will automatically cycle through +" all the figure labels. Very useful! +set iskeyword+=: +</programlisting> + </para> + </section> + <section id="latex-suite-templates"> + <title>Inserting Templates</title> + <para> + This functionality is available via the <literal>TeX-Suite &gt; + Templates</literal> menu. + This module provides a way to insert custom templates at the beginning of the + current file. + </para> + <para> + When &ls; first starts up, it scans the + <literal>$VIM/ftplugin/latex-suite/templates/</literal> + directory and creates menu items based on the files found there. When + you select a template from this menu, the file will be read in above + the first line of the current file. + </para> + <para> + A template file can utilize placeholders for initializing the cursor + position when the template is read in and subsequent movement. In + addition, template files can contain dynamic elements such as the + time of creation of a file etc, by using vim expressions. + </para> + <para> + You can place your own templates in the + <literal>$VIM/ftplugin/latex-suite/templates/</literal> directory in + order for them to be available via the menu. Unless &ls; releases a + template with the same name, these files should not get over-written + when you install a new release over an existing one. + </para> + <note> + <para> + Templates are also accessible for non-gui users with the command + |<literal>:TTemplate</literal>|. The argument should be name of + the corresponding template file. If the command is called + without arguments (preferred usage), then a list of available + templates is displayed and the user is asked to choose one of + them. + </para> + </note> + </section> + <section id="latex-macros"> + <title>&ls; Macros</title> + <para> + &ls; ships with a very comprehensive set of insert mode and + |visual-mode| mappings and menu items to typeset most of the LaTeX + elements. + </para> + <note> + <para> + These mappings are are not standard mappings in the sense that + only the last character is mapped. See plugin/imaps.vim for + further documentation. For example, in the case of the mapping + <literal>EFI</literal> provided by &ls; you can press the characters + '<literal>E</literal>', '<literal>F</literal>' and '<literal>I</literal>' + as slowly as you wish (unlike the normal <literal>imap</literal> command + where <literal>timeout</literal> issues are involved). The characters are + visible as you type them (unlike normal <literal>imap</literal>s) and you + can use the movement or backspace key to correct yourself unlike normal + mappings. + </para> + </note> + <anchor id="place-holder" /> + <note id="place-holders"> + <title>Place Holders</title> + <para> + Almost all macros provided in &ls; implement Stephen Riem's bracketing + system and Gergely Kontra's <literal>JumpFunc()</literal> for handling + place-holders. This consists of using "place-holders" to mark off + locations where the next relevant editing has to be done. As an example, + when you type <literal>EFI</literal> in |insert-mode|, you will get the + following: + <programlisting>\begin{figure}[h] + \centerline{\psfig{figure=&lt;+eps file+&gt;}} + \caption{&lt;+caption text+&gt;} + \label{fig:&lt;+label+&gt;} +\end{figure}&lt;++&gt;</programlisting> + The text <literal>&lt;+eps file+&gt;</literal> will be selected and + you will be left in |select-mode| so that you can continue typing + straight away. After having typed in the file name, you can press + <literal>&lt;Ctrl-J&gt;</literal> (while still in insert-mode). This will + take you directly to the next "place-holder". i.e, <literal>&lt;+caption + text+&gt;</literal> will be visually selected with Vim in select mode + again for typing in the caption. This saves on a lot of key presses. + </para> + </note> + <note id="overriding-macros"> + <title>Over-riding &ls; Macros</title> + <para> + If you wish to change these macros from their default values, for + example, if you wish to change <literal>`w</literal> to expand to + <literal>\omega</literal> instead of its default expansion to + <literal>\wedge</literal>, you should use the <literal>IMAP</literal> + function as described in the <link linkend="ls-new-macros">Using + IMAP()</link> section. + </para> + <para> + An important thing to note is that if you wish to over-ride macros + created by &ls; rather than merely create new macros, you should place + the <literal>IMAP()</literal> calls in a script which gets sourced + after the files in &ls;. A good place typically is as a file-type + plugin file in the + <literal>~/.vim/after/ftplugin/</literal> directory. (Use + <literal>~/vimfiles</literal> if you are using + <literal>WINDOWS</literal>). For example to over-ride + <literal>`w</literal> to <literal>\omega</literal> instead of + <literal>\wedge</literal>, place the following line in (say) + <literal>~/.vim/after/ftplugin/tex_macros.vim</literal>: + <programlisting>call IMAP('`w', '\omega', 'tex')</programlisting> + </para> + <note> + <para> + It is important to use a file-name which will get sourced on a + <literal>FileType</literal> event. Therefore you must use a file-name + which conforms to the standards as described in + <literal>|ftplugin-name|</literal>. + </para> + </note> + </note> + <note id="pausing-imaps"> + <title>Pausing Macro expansion</title> + <para> + If you wish to temporarily suspend the imaps functionality, then you + can set the <literal>Imap_FreezeImap</literal> to 1. If you set + <literal>g:Imap_FreezeImap</literal> to 1, then it will be a + system-wide setting. Setting <literal>b:Imap_FreezeImap</literal> will + affect only the current buffer. + </para> + </note> + <para> + The following sections describe the various editing macros provided + by &ls;. + </para> + <section id="environment-mappings"> + <title>Environment Mappings</title> + &ls; provides a rich set of mappings to insert, enclose and modify + &latex; environments, i.e, <literal>\begin{...} ... \end{...}</literal> + pairs. + <section id="inserting-environments"> + <title>Inserting Environments</title> + <para> + &ls; provides the following ways to insert environments + </para> + <section id="inserting-env-f5"> + <title>Method 1: Pressing <literal>&lt;F5&gt;</literal></title> + <para> + If you press <literal>&lt;F5&gt;</literal> in the insert or normal + mode while on an empty line, &ls; prompts you with a list of + environments you might want to insert. You can either choose one + from the list or type in a new environment name. If you press + <literal>&lt;F5&gt;</literal> on a line which already has a word, + then that word is used instead of prompting. + </para> + <para> + See <link linkend="Tex_Env_name">Tex_Env_name</link> for a + description of how &ls; uses the word to form the expansion and how + to modify &ls;'s behavior. + </para> + <para> + The list of environments which &ls; prompts you with (when + <literal>&lt;F5&gt;</literal> is pressed on an empty line) is formed + from the <link + linkend="Tex_PromptedEnvironments">Tex_PromptedEnvironments</link> + setting. + </para> + <para> + In addition to this setting, &ls; also lists environments found in + custom packages as described in the section <link + linkend="package-actions">Package actions.</link> + </para> + </section> + <section id="inserting-env-shift-f1"> + <title>Method 2: Using <literal>&lt;S-F1&gt;</literal>-<literal>&lt;S-F4&gt;</literal></title> + <para> + The shifted function keys, <literal>&lt;S-F1&gt;</literal> to + <literal>&lt;S-F4&gt;</literal> can be mapped to insert very commonly + used environments. The environments mapped to each key can be + customized via the <link + linkend="Tex_HotKeyMappings">g:Tex_HotKeyMappings</link> setting. + </para> + </section> + <section id="inserting-env-threeletter"> + <title>Method 3: Using three letter sequences</title> + <para> + Environments can also be inserted by pressing a 3 capital letter + sequence starting with an <literal>E</literal>. The sequence of 3 + letters generally tries to follow the following rules: + </para> + <orderedlist> + <listitem> + All environment mappings begin with <literal>E</literal> + </listitem> + <listitem> + If the environment can be broken up into 2 distinct words, + such as flushright (flush + right), then the next 2 letters + are the first letters of the 2 words. Example: + <programlisting>flushleft (_f_lush + _l_eft) ---&gt; EFL +flushright (_f_lush + _r_ight) ---&gt; EFR +eqnarray (_e_qn + _a_rray) ---&gt; EEA</programlisting> + If on the other hand, the environment name cannot be broken + up into 2 distinct words, then the next 2 letters are the + first 2 letters of the name of the environment. + Example: + <programlisting>equation (_eq_uation) ---&gt; EEQ</programlisting> + </listitem> + </orderedlist> + <para> + Unfortunately there are some environments that cannot be + split in two words and first two letters in name are + identical. In this case shortcut is created from E, first and + last letter. Example: + <programlisting>quote (_q_uot_e_) ---&gt; EQE +quotation (_q_uotatio_n_) ---&gt; EQN</programlisting> + Of course, not every last one of the environments can follow + this rule because of ambiguities. In case of doubt, pull down + the Tex-Environments menu. The menu item should give the hint + for the map. + </para> + </section> + </section> + <section id="enclosing-environments"> + <title>Enclosing in Environments</title> + <para> + &ls; provides visual-mode mappings which enclose visually + selected portions of text in environments. There are two ways provided + to do this. + </para> + <section id="enclosing-env-f5"> + <title>Method 1: Pressing <literal>&lt;F5&gt;</literal></title> + <para> + You can also select a portion of text visually and press + <literal>&lt;F5&gt;</literal> while still in visual mode. This will + prompt you with a list of environments. (This list can be customized + via the <link + linkend="Tex_PromptedEnvironments">g:Tex_PromptedEnvironments</link> + setting). You can either choose from this list or type in a new + environment name. Once the selection is done, &ls; encloses the + visually selected portion in the chosen environment. + </para> + </section> + <section id="enclosing-env-threeletter"> + <title>Method 2: Using three letter mappings</title> + <para> + You can also select text visually and press a sequence of three + characters beginning with <literal>,</literal> (the single comma + character) and the selected text will be enclosed in the chosen + environment. The three letter sequence follows directly from the + three letter sequence used to insert environments as described <link + linkend="inserting-env-threeletter">here</link>. The following + example describes the rule used: + </para> + <para> + If <literal>ECE</literal> inserts a + <literal>\begin{center}...\end{center}</literal> environment, then to + enclose a block of selected text in + <literal>\begin{center}...\end{center}</literal>, simply select the + text and press <literal>,ce</literal>. The rule simply says that the + leading <literal>E</literal> is converted to <literal>,</literal> and + the next 2 letters are small case. + </para> + </section> + <para> + Some of the visual mode mappings are sensitive to whether you + choose line-wise or character-wise. For example, if you choose a + word and press <literal>,ce</literal>, then you get + <literal>\centerline{word}</literal>, whereas if you press + <literal>,ce</literal> on a line-wise selection, you get: + <programlisting>\begin{center} + line +\end{center}</programlisting> + </para> + </section> + <section id="changing-environments"> + <title>Changing Environments</title> + <para> + Pressing <literal>&lt;S-F5&gt;</literal> in normal mode detects which + environment the cursor is presently located in and prompts you to + replace it with a new one. The innermost environment is detected. For + example, in the following source: + <programlisting>\begin{eqnarray} + \begin{array}{ccc} + 2 &amp; 3 &amp; 4 + \end{array} +\end{eqnarray}</programlisting> + if you are located in the middle "2 &amp; 3 &amp; 4" line, then pressing + <literal>&lt;S-F5&gt;</literal> will prompt you to change the array + environment, not the eqnarray environment. In addition, &ls; will also + try to change lines within the environment to be consistent with the + new environment. For example, if the original environment was an + <literal>eqnarray</literal> environment with a + <literal>\label</literal> command, then changing it to an + <literal>eqnarray*</literal> environment will delete the + <literal>\label</literal>. + </para> + <para> + Pressing <literal>&lt;F5&gt;</literal> in normal mode has the same + effect as pressing <literal>&lt;F5&gt;</literal> in insert-mode, + namely you will be prompted to choose an environment to insert. + </para> + </section> + </section> + <section id="latex-command-maps"> + <title>Command Mappings</title> + &ls; provides a rich set of mappings to insert, enclose and modify + &latex; commands. + <section id="inserting-commands"> + <title>Inserting &latex; commands</title> + <anchor id="ls-imap-f7" /> + <anchor id="ls-imap-s-f7" /> + <para> + Pressing <literal>&lt;F7&gt;</literal> in insert or normal mode while + the cursor is touching a word will insert a command formed from the + word touching the cursor. + </para> + <para> + For certain common commands, &ls; will expand them to include + additional arguments as needed. For example, <literal>frac</literal> + becomes <literal>\frac{&ph;}{&ph;}&ph;</literal>. Otherwise, it will + simply change the word under the cursor as follows + <programlisting>word --> \word{&ph;}&ph;</programlisting> + You can define custom expansions + of commands using the <literal>Tex_Com_{name}</literal> setting as + described in <link linkend="Tex_Com_name">here</link>. + </para> + <para> + If <literal>&lt;F7&gt;</literal> is pressed when the cursor is on + white-space, then &ls; will prompt you to choose a command and insert + that instead.The list of commands is constructed from the <link + linkend="Tex_PromptedCommands"><literal>g:Tex_PromptedCommands</literal></link> + setting and also from commands which &ls; finds while scanning custom + packages which &ls; finds. See the <link + linkend="package-actions">Package actions</link> section for details + on which files are scanned etc. + </para> + </section> + <section id="enclosing-commands"> + <title>Enclosing in a command</title> + <para> + You can select a portion of text visually and press + <literal>&lt;F7&gt;</literal> while still in visual mode. This will + prompt you with a list of commands. (This list can be customized + via the <link + linkend="Tex_PromptedCommands">g:Tex_PromptedCommands</link> + setting). You can either choose from this list or type in a new + command name. Once the selection is done, &ls; encloses the + visually selected portion in the chosen command. + </para> + </section> + <section id="changing-commands"> + <title>Changing commands</title> + <anchor id="ls-vmap-f7" /> + <para> + In both insert and normal mode <literal>&lt;S-F7&gt;</literal> will + find out if you are presently within an environment and then prompt you + with a list of commands to change it to. + </para> + </section> + </section> + <section id="font-maps"> + <title>Font Mappings</title> + <para> + These mappings insert font descriptions such as: + <literal>\textsf{&ph;}&ph;</literal> + with the cursor left in place of the first <link + linkend="place-holders">placeholder</link> (the &ph; characters). + </para> + <para> + Mnemonic: + <orderedlist> + <listitem>first letter is always F (F for font)</listitem> + <listitem>next 2 letters are the 2 letters describing the font.</listitem> + </orderedlist> + </para> + <para> + Example: Typing <literal>FEM</literal> in insert-mode expands to + <literal>\emph{&ph;}&ph;</literal>. + </para> + <para> + Just like environment mappings, you can visually select an area and press + <literal>`sf</literal> to have it enclosed in: + <literal>\textsf{word}</literal> + or + <programlisting>{\sffamily +line +}</programlisting> + depending on character-wise or line-wise selection. + </para> + </section> + <section id="section-mappings"> + <title>Section Mappings</title> + <para> + These maps insert &latex; sections such as: + <programlisting>\section{&ph;}&ph;</programlisting> + etc. Just as in the case of environments and fonts, can be enclosed with a + visual selection. The enclosing is not sensitive to character or line-wise + selection. + </para> + <para> + Mnemonic: (make your own!) + <programlisting>SPA for part +SCH for chapter +SSE for section +SSS for subsection +SS2 for subsubsection +SPG for paragraph +SSP for subparagraph</programlisting> + </para> + <para> + Example: + SSE in insert mode inserts + <programlisting>\section{&lt;++&gt;}&lt;++&gt;</programlisting> + If you select a word or line and press <literal>,se</literal>, then you + get + <programlisting>\section{section name}</programlisting> + The menu item in Tex-Environments.Sections have a sub-menu called + 'Advanced'. Choosing an item from this sub-menu asks a couple of questions + (whether you want to include the section in the table of contents, whether + there is a shorter name for the table of contents) and then creates a more + intelligent template. + </para> + </section> + <section id="greek-letter-mappings"> + <title>Greek Letter Mappings</title> + <para> + Lower case + </para> + <literal>`a</literal> through <literal>`z</literal> expand to + <literal>\alpha</literal> through <literal>\zeta</literal>. + <para> + Upper case: + </para> + <programlisting>`D = \Delta +`F = \Phi +`G = \Gamma +`Q = \Theta +`L = \Lambda +`X = \Xi +`Y = \Psi +`S = \Sigma +`U = \Upsilon +`W = \Omega</programlisting> + <note><para>LaTeX does not support upper case for all greek alphabets.</para></note> + <para>Just like other &ls; mappings, these mappings are not created using + the standard <literal>imap</literal> command. Thus you can type slowly, + correct using <literal>&lt;BS&gt;</literal> etc.</para> + </section> + <section id="auc-tex-mappings"> + <title>Auc-Tex Key Bindings</title> + <para> + These are simple 2 key expansions for some very commonly used LaTeX + elements: + </para> + <programlisting>`^ Expands To \Hat{&ph;}&ph; +`_ expands to \bar{&ph;}&ph; +`6 expands to \partial +`8 expands to \infty +`/ expands to \frac{&ph;}{&ph;}&ph; +`% expands to \frac{&ph;}{&ph;}&ph; +`@ expands to \circ +`0 expands to ^\circ +`= expands to \equiv +`\ expands to \setminus +`. expands to \cdot +`* expands to \times +`&amp; expands to \wedge +`- expands to \bigcap +`+ expands to \bigcup +`( expands to \subset +`) expands to \supset +`&lt; expands to \le +`&gt; expands to \ge +`, expands to \nonumber +`~ expands to \tilde{&ph;}&ph; +`; expands to \dot{&ph;}&ph; +`: expands to \ddot{&ph;}&ph; +`2 expands to \sqrt{&ph;}&ph; +`| expands to \Big| +`I expands to \int_{&ph;}^{&ph;}&ph;</programlisting> + <para> + (again, notice the convenient place-holders) + </para> + <para> + In addition the visual mode macros are provided: + </para> + <programlisting>`( encloses selection in \left( and \right) +`[ encloses selection in \left[ and \right] +`{ encloses selection in \left\{ and \right\} +`$ encloses selection in $$ or \[ \] depending on characterwise or + linewise selection</programlisting> + </section> + <section id="diacritic-mappings"> + <title>Diacritics</title> + <para> + These mappings speed up typing European languages which contain diacritic + characters such as a-umlaut etc. + <programlisting>+&lt;l&gt; expands to \v{&lt;l&gt;} +=&lt;l&gt; expands to \'{&lt;l&gt;}</programlisting> + where <literal>&lt;l&gt;</literal> is an alphabet. + </para> + <programlisting>+} expands to \"{a} ++: expands to \^{o}</programlisting> + <para> + &ls; also ships with <link linkend="smart-backspace">smart + backspacing</link> functionality which provides another convenience while + editing languages with diacritics. + </para> + <note> + <para>Diacritics are disabled by default in &ls; because they can + sometimes be a little too intrusive. Moreover, most European users can + nowadays use font encodings which display diacritic characters directly + instead of having to rely on &ls;'s method of displaying diacritics.</para> + <para>Set the <link linkend="Tex_Diacritics">g:Tex_Diacritics</link> + variable to enable diacritics.</para> + </note> + </section> + <section id="bibtex-bindings"> + <title>BibTeX Shortcuts</title> + <para> + &ls; provides an easy way of entering bibliographic entries. Four + insert-mode mappings: <literal>BBB</literal>, <literal>BBL</literal>, + <literal>BBH</literal> and <literal>BBX</literal> are provided, all of + which essentially act in the same manner. When you type any of these in + insert-mode, you will get a prompt asking you to choose a entry type + for the bibliographic entry. + </para> + <para> + When you choose an entry type, a bibliographic entry template will be + inserted. For example, if you choose the option + <literal>'book'</literal> via the map <literal>BBB</literal>, then + the following template will be inserted: + <programlisting>@BOOK{&lt;+key+&gt;, + author = {&ph;}, + editor = {&ph;}, + title = {&ph;}, + publisher = {&ph;}, + year = {&ph;}, + otherinfo = {&ph;} +}&ph;</programlisting> + </para> + <para> + <literal>&lt;+key+&gt;</literal> will be highlighted in select-mode and + you can type in the bib-key. After that you can use + <literal>&lt;Ctrl-J&gt;</literal> to navigate to successive locations + in the template and enter new values. + </para> + <para> + <literal>BBB</literal> inserts a template with only the fields + mandatorily required for a given entry type. <literal>BBL</literal> + inserts a template with commonly used extra options. + <literal>BBH</literal> inserts a template with more options which are + not as commonly used. <literal>BBX</literal> inserts a template with + all the fields which the entry type supports. + </para> + <note> + <title>Mnemonic</title> + <para> + <literal>B</literal> for Bibliographic entry, <literal>L</literal> + for Large entry, <literal>H</literal> for Huge entry, and + <literal>X</literal> stands for all eXtras. + </para> + </note> + <section id="adding-bib-options"> + <title>Customizing Bib-TeX fields</title> + <para> + If you wish the <literal>BBB</literal> command to insert a few + additional fields in addition to the fields it creates, then you will + need to define global variables of the form + <programlisting>g:Bib_{type}_options</programlisting> + in you <literal>$VIM/ftplugin/bib.vim</literal> file, where + <literal>{type}</literal> is a string like + <literal>'article'</literal>, <literal>'book'</literal> etc. This + variable should contain one of the letters defined in the following + table + </para> + <informaltable frame="all"> + <tgroup cols="2"> + <thead> + <row> + <entry>Character</entry> + <entry>Field Type</entry> + </row> + </thead> + <tbody> + <row><entry>w</entry><entry>address</entry></row> + <row><entry>a</entry><entry>author</entry></row> + <row><entry>b</entry><entry>booktitle</entry></row> + <row><entry>c</entry><entry>chapter</entry></row> + <row><entry>d</entry><entry>edition</entry></row> + <row><entry>e</entry><entry>editor</entry></row> + <row><entry>h</entry><entry>howpublished</entry></row> + <row><entry>i</entry><entry>institution</entry></row> + <row><entry>k</entry><entry>isbn</entry></row> + <row><entry>j</entry><entry>journal</entry></row> + <row><entry>m</entry><entry>month</entry></row> + <row><entry>z</entry><entry>note</entry></row> + <row><entry>n</entry><entry>number</entry></row> + <row><entry>o</entry><entry>organization</entry></row> + <row><entry>p</entry><entry>pages</entry></row> + <row><entry>q</entry><entry>publisher</entry></row> + <row><entry>r</entry><entry>school</entry></row> + <row><entry>s</entry><entry>series</entry></row> + <row><entry>t</entry><entry>title</entry></row> + <row><entry>u</entry><entry>type</entry></row> + <row><entry>v</entry><entry>volume</entry></row> + <row><entry>y</entry><entry>year</entry></row> + </tbody> + </tgroup> + </informaltable> + <para> + For example, by default, choosing <literal>'article'</literal> via + <literal>BBB</literal> inserts the following template by default + <programlisting>@ARTICLE{&lt;+key+&gt;, + author = {&ph;}, + title = {&ph;}, + journal = {&ph;}, + year = {&ph;}, + otherinfo = {&ph;} +}&ph;</programlisting> + However, if <literal>g:Bib_article_options</literal> is defined as + <literal>'mnp'</literal>, then <literal>'article'</literal> will + insert the following template + <programlisting>@ARTICLE{&lt;+key+&gt;, + author = {&ph;}, + title = {&ph;}, + journal = {&ph;}, + year = {&ph;}, + month = {&ph;}, + number = {&ph;}, + pages = {&ph;}, + otherinfo = {&ph;} +}&ph;</programlisting> + </para> + <para> + If you have some other fields you wish to associate with an article + which are not listed above, then you will have to use the + <literal>Bib_{type}_extrafields</literal> option. This is a newline + separated string of complete field names which will be included in the + template. For example, if you define + <programlisting>let g:Bib_article_extrafields = "crossref\nabstract"</programlisting> + then the article template will include the lines + <programlisting>crossref = {&ph;}, +abstract = {&ph;},</programlisting> + </para> + <note> + <para> + You will need to define <literal>Bib_*</literal> settings in your + <literal>$VIMRUNTIME/ftplugin/bib.vim</literal> file. + </para> + </note> + </section> + </section> + <section id="smart-keys"> + <title>Smart Key Mappings</title> + <para> + &ls; ships with the following smart keys: + </para> + <formalpara> + <anchor id="smart-backspace" /> + <title>Smart Backspace</title> + Pressing <literal>&lt;BS&gt;</literal> in insert mode checks to see + whether we are just after something like <literal>\'{a}</literal> and + if so, deletes all of it. i.e, diacritics are treated as single + characters for backspacing. + </formalpara> + <formalpara> + <title>Smart Quotes</title> + Pressing <literal>"</literal> (English double quote) will insert + <literal>``</literal> or <literal>''</literal> by making an + intelligent guess about whether we intended to open or close a quote. + </formalpara> + <formalpara> + <title>Smart Space</title> + &ls; maps the <literal>&lt;space&gt;</literal> key in such a + way that $ characters are not broken across lines. It does this by + first setting <literal>tw=0</literal> so that Vim will not + automatically break lines and then maps the + <literal>&lt;space&gt;</literal> key to insert newlines keeping + <literal>$$</literal>'s on the same line. + </formalpara> + <formalpara> + <title>Smart Dots</title> + Pressing <literal>...</literal> (3 dots) results in + <literal>\ldots</literal> outside math mode and + <literal>\cdots</literal> in math mode. + </formalpara> + </section> + <section id="altkey-mappings"> + <title>Alt Key Macros</title> + <para> + &ls; utilizes a set of macros originally created by Carl Mueller in + auctex.vim to make inserting all the <literal>\left ... \right</literal> + stuff very easy and to also make some use of the heavily under-utilized + <literal>&lt;Alt&gt;</literal> key. + </para> + <note> + <para> + By default, typing <literal>Alt-&lt;key&gt;</literal> in &vim; takes + focus to the menu bar if a menu with the hotkey + <literal>&lt;key&gt;</literal> exists. If in your case, there are + conflicts due to this behavior, you will need to set + <programlisting>set winaltkeys=no</programlisting> + in your <literal>$VIM/ftplugin/tex.vim</literal> in order to use these + maps. + </para> + </note> + <note> + <title>Customizing the maps</title> + <para> + If for some reason, you wish to not map the + <literal>&lt;Alt&gt;</literal> keys, (some European users need to use + the <literal>&lt;Alt&gt;</literal> key to enter diacritics), you can + change these maps to other keys as described in the section <link + linkend="customize-alt-key-maps">Customizing Alt-key maps</link>. + </para> + </note> + <section id="Alt-L"> + <title><literal>&lt;Alt-L&gt;</literal></title> + <para> + This is a polymorphic insert-mode mapping which expands to one of the + following depending on the character just before the cursor location. + </para> + <informaltable frame="all"> + <tgroup cols="2"> + <colspec colwidth="0.5in" align="cener" /> + <colspec colwidth="0.5in" /> + <thead> + <row> + <entry>Character before cursor</entry> + <entry>Expansion</entry> + </row> + </thead> + <tbody> + <row><entry>(</entry> <entry><literal>\left( &ph; \right)</literal></entry></row> + <row><entry>[</entry> <entry><literal>\left[ &ph; \right]</literal></entry></row> + <row><entry>|</entry> <entry><literal>\left| &ph; \right|</literal></entry></row> + <row><entry>{</entry> <entry><literal>\left\{ &ph; \right\}</literal></entry></row> + <row><entry>&lt;</entry> <entry><literal>\langle &ph; \rangle</literal></entry></row> + <row><entry>q</entry> <entry><literal>\lefteqn{&ph;}&ph;</literal></entry></row> + </tbody> + </tgroup> + </informaltable> + <para> + If the character before the cursor is none of the above, then it will + simply insert a <literal>\label{&ph;}&ph;</literal>. + </para> + </section> + <section id="Alt-B"> + <title><literal>&lt;Alt-B&gt;</literal></title> + <para> + This insert-mode mapping encloses the previous character in + <literal>\mathbf{}</literal>. + </para> + </section> + <section id="Alt-C"> + <title><literal>&lt;Alt-C&gt;</literal></title> + <para> + In insert mode, this key is polymorphic as follows: + </para> + <orderedlist> + <listitem> + If the previous character is a letter or number, then capitalize it and + enclose it in <literal>\mathcal{}</literal>. + </listitem> + <listitem> + otherwise insert <literal>\cite{}</literal>. + </listitem> + </orderedlist> + <para> + In visual mode, it will simply enclose the selection in + <literal>\mathcal{}</literal> + </para> + </section> + <section id="Alt-I"> + <title><literal>&lt;Alt-I&gt;</literal></title> + <para> + This mapping inserts an <literal>\item</literal> command at the + current cursor location depending on which environment the cursor is + enclosed in. The style of the <literal>\item</literal> command is + dependent on the enclosing environment. By default, + <literal>&lt;Alt-I&gt;</literal> has styles defined forthe following + environments: + </para> + <informaltable frame="all"> + <tgroup cols="2"> + <thead> + <row> + <entry>Environment</entry> + <entry>Style</entry> + </row> + </thead> + <tbody> + <row><entry>itemize</entry><entry>\item </entry></row> + <row><entry>enumerate</entry><entry>\item </entry></row> + <row><entry>theindex</entry><entry>\item </entry></row> + <row><entry>thebibliography</entry><entry>\item[&lt;+biblabel+&gt;]{&lt;+bibkey+&gt;} &lt;++&gt;</entry></row> + <row><entry>description</entry><entry>\item[&lt;+label+&gt;] &lt;++&gt;</entry></row> + </tbody> + </tgroup> + </informaltable> + <para> + <literal>&lt;Alt-I&gt;</literal> is intelligent enough to + account for nested environments. For example, + <programlisting>\begin{itemize} + \item first item + \item second item + \begin{description} + \item[label1] first desc + \item[label2] second + % &lt;Alt-I&gt; will insert "\item[&lt;+label+&gt;] &lt;++&gt;" if + % used here + \end{description} + \item third item + % &lt;Alt-I&gt; will insert "\item " when if used here. +\end{itemize} +% &lt;Alt-I&gt; will insert nothing ("") if used here</programlisting> + </para> + <para> + The style used by <literal>&lt;Alt-I&gt;</literal> can be customized + using the <link + linkend="Tex_ItemStyle_environment"><literal>g:Tex_ItemStyle_environment</literal></link> + variable. + </para> + </section> + </section> + <section id="custom-macros-menu"> + <title>Custom Macros</title> + <para> + This functionality available via the TeX-Suite.Macros menu, provides + a way of inserting customized macros into the current file via the + menu. + </para> + <para> + When &ls; starts up, it scans the + <literal>$VIM/ftplugin/latex-suite/macros/</literal> directory and + creates a menu from the files found there. Each file is considered as + a single macro. You can place your own macros in this directory, + using <link linkend="place-holders">placeholders</link> if wanted. + </para> + <para> + When you choose a macro from the menu, the corresponding file is read + into the current buffer after the current cursor position. In non-gui + mode, you can use the |TMacro| command instead of choosing from the + menu. This command takes the macro file name as an argument. When + called without arguments (preferred usage), then a list of available + macro files is displayed and the user is prompted to choose one of + them). + </para> + <para> + There are some other tools provided in this menu, namely: + </para> + <informaltable frame="none"> + <tgroup cols="2"> + <colspec colwidth="0.5in" /> + <colspec colwidth="0.5in" /> + <tbody> + <row><entry>{New}</entry> + <entry> + Creates a new (unnamed) buffer in the + latex-suite/macros/ directory. Use the command + :TexMacroNew in non-gui mode. + </entry> + </row> + <row> + <entry>{Edit}</entry> + <entry> + Opens up the corresponding macro file for editing. Use + |:TexMacroEdit| in non-gui mode. When you try to edit {macro} + not from local directory &ls; will copy it to your local + directory with suffix "-local". If local copy already exists + &ls; prompt for overwriting it. + </entry> + </row> + <row> + <entry>{Delete}</entry> + <entry> + Deletes the corresponding macro. Use the prefixed numbers for + fast navigation of menus. Use |:TexMacroDelete| in non-gui mode. + When you choose to delete {macro} which is not in your local + directory &ls; will refuse to delete it. + </entry> + </row> + <row> + <entry>{Redraw}</entry> + <entry> + Rescans the macros/ directories and refreshes the macros list. + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + </section> + <section id="ls-new-macros"> + <title>Making your own Macros via <literal>IMAP()</literal></title> + <para> + If you find the need to create your own macros, then you can use the + <literal>IMAP()</literal> function provided with &ls;. See <link + linkend="why-IMAP" endterm="why-IMAP.title"></link> for a short + explanation of why you might prefer <literal>IMAP()</literal> over + &vim;'s standard <literal>:imap</literal> command. An example best + explains the usage: + <programlisting>:call IMAP('NOM', '\nomenclature{&ph;}&ph;', 'tex')</programlisting> + This will create a &ls;-style mapping, where if you type + <literal>NOM</literal> in insert mode, you will get + <literal>\nomenclature{&ph;}&ph;</literal> with the cursor left in + place of the first <literal>&ph;</literal> characters. See <link + linkend="ls-imaps-syntax" endterm="ls-imaps-syntax.title"></link> for + a detailed explanation of the <literal>IMAP()</literal> command. + </para> + <para> + For maps which are triggered for a given filetype, the + <literal>IMAP()</literal> command above should be put in the filetype + plugin script for that file. For example, for tex-specific mappings, + the <literal>IMAP()</literal> calls should go in + <literal>$VIM/ftplugin/tex.vim</literal>. For globally visible maps, + you will need to use the following in either your + <literal>~/.vimrc</literal> or a file in your + <literal>$VIM/plugin</literal> directory. + <programlisting>augroup MyIMAPs + au! + au VimEnter * call IMAP('Foo', 'foo', '') +augroup END</programlisting> + </para> + <section id="why-IMAP"> + <title id="why-IMAP.title">Why use <literal>IMAP()</literal></title> + <para> + Using <literal>IMAP</literal> instead of &vim;'s built-in + <literal>:imap</literal> command has a couple of advantages: + <orderedlist> + <listitem> + The 'ttimeout' option will generally limit how easily you can type + the left hand side for a normal <literal>:imap</literal>. if you type + the left hand side too slowly, then the mapping will not be + activated. + </listitem> + <listitem> + If you mistype one of the letters of the lhs, then the mapping is + deactivated as soon as you backspace to correct the mistake. + </listitem> + <listitem> + The characters in lhs are shown on top of each other. This is fairly + distracting. This becomes a real annoyance when a lot of characters + initiate mappings. + </listitem> + </orderedlist> + </para> + </section> + <section id="ls-imaps-syntax"> + <title id="ls-imaps-syntax.title">IMAP() syntax</title> + <para> + Formally, the syntax which is used for the <literal>IMAP</literal> + function is: + <programlisting>call IMAP (lhs, rhs, ft [, phs, phe])</programlisting> + </para> + <para> + <informaltable frame="all"> + <tgroup cols="2"> + <thead> + <row> + <entry>Argument</entry> + <entry>Explanation</entry> + </row> + </thead> + <tbody> + <row> + <entry>lhs</entry> + <entry> + <para> + This is the "left-hand-side" of the mapping. When you use + <literal>IMAP</literal>, only the last character of this word is + actually mapped, although the effect is that the whole word is + mapped. + </para> + <para> + If you have two mappings which end in a common + <literal>lhs</literal>, then the mapping with the longer + <literal>lhs</literal> is used. For example, if you do + <programlisting>call IMAP('BarFoo', 'something', 'tex') +call IMAP('Foo', 'something else', 'tex')</programlisting> + Then typing <literal>BarFoo</literal> inserts + <literal>"something"</literal>, whereas <literal>Foo</literal> by + itself inserts <literal>"something else"</literal>. + </para> + <para> + Also, the nature of <literal>IMAP()</literal> makes creating + certain combination of mappings impossible. For example if you + have + <programlisting>call IMAP('foo', 'something', 'tex') +call IMAP('foobar', 'something else', 'tex')</programlisting> + Then you will never be able to trigger <literal>"foobar"</literal> + because typing <literal>"foo"</literal> will immediately insert + <literal>"something"</literal>. This is the "cost" which you incur + over the normal <literal>:imap</literal> command for the + convenience of no 'timeout' problems, the ability to correct + <literal>lhs</literal> etc. + </para> + </entry> + </row> + <row> + <entry>rhs</entry> + <entry> + <para> + The "right-hand-side" of the mapping. This is the expansion you + will get when you type <literal>lhs</literal>. + </para> + <para> + This string can also contain special characters such as + <literal>&lt;enter&gt;</literal> etc. To do this, you will need + to specify the second argument in double-quotes as follows: + <programlisting>:call IMAP('EFE', "\\begin{figure}\&lt;CR&gt;&ph;\\end{figure}&ph;", 'tex')</programlisting> + With this, typing <literal>EFE</literal> is equivalent to typing + in the right-hand side with all the special characters in + insert-mode. This has the advantage that if you have filetype + indentation set up, then the right hand side will also be + indented just as if you had typed it in normally. + </para> + <anchor id="IMAP_PutTextWithMovement" /> + <para> + You can also set up a &ls; style mapping which calls a custom function + as follows: + <programlisting>:call IMAP('FOO', "\&lt;C-r&gt;=MyFoonction()\&lt;CR&gt;", 'tex')</programlisting> + where <literal>MyFoonction</literal> is a custom function you have + written. If <literal>MyFoonction</literal> also has to return a string + containing <literal>&ph;</literal> characters, then you will need to + use the function <literal>IMAP_PutTextWithMovement()</literal>. An + example best explains the usage: + </para> + <programlisting>call IMAP('FOO', "\&lt;C-r&gt;=AskVimFunc()\&lt;CR&gt;", 'vim') +" Askvimfunc: Asks For Function Name And Sets Up Template +" Description: +function! AskVimFunc() + let name = input('Name of the function : ') + if name == '' + let name = "&lt;+Function Name+&gt;" + end + let islocal = input('Is this function scriptlocal ? [y]/n : ', 'y') + if islocal == 'y' + let sidstr = '&lt;SID&gt;' + else + let sidstr = '' + endif + return IMAP_PutTextWithMovement( + \ "\" ".name.": &lt;+short description+&gt; \&lt;cr&gt;" . + \ "Description: &lt;+long description+&gt;\&lt;cr&gt;" . + \ "\&lt;C-u&gt;function! ".name."(&lt;+arguments+&gt;)&ph;\&lt;cr&gt;" . + \ "&lt;+function body+&gt;\&lt;cr&gt;" . + \ "endfunction \" " + \ ) +endfunction</programlisting> + <para> + </para> + </entry> + </row> + <row> + <entry>ft</entry> + <entry> + <para> + The file type for which this mapping is active. When this string + is left empty, the mapping applies for all file-types. A filetype + specific mapping will always take precedence. + </para> + </entry> + </row> + <row> + <entry>phs, phe</entry> + <entry> + <para> + If you prefer to write the <literal>rhs</literal> with characters + other than <literal>&lt;+</literal> and <literal>+&gt;</literal> + to denote place-holders, you can use the last 2 arguments to + specify which characters in the <literal>rhs</literal> specify + place-holders. By default, these are <literal>&lt;+</literal> and + <literal>+&gt;</literal> respectively. + </para> + <para> + Note that the <literal>phs</literal> and <literal>phe</literal> + arguments do not control what characters will be displayed for + the placeholders when the mapping is actually triggered. What + characters are used to display place-holders when you trigger an + <literal>IMAP</literal> are controlled by the <link + linkend="Imap_PlaceHolderStart"><literal>Imap_PlaceHolderStart</literal></link> + and <link + linkend="Imap_PlaceHolderEnd"><literal>Imap_PlaceHolderEnd</literal></link> + settings. + </para> + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + </para> + </section> + </section> + </section> + <section id="latex-packages"> + <title>Package Handling</title> + <para> + &ls; has a lot of functionality written to ease working with packages. + Packages here refers to files which you include into the &latex; + document using the <literal>\usepackage</literal> command. + </para> + <section id="inserting-packages"> + <title>Inserting package commands</title> + <para> + When you first invoke &ls;, it scans the + <literal>$VIM/ftplugin/latex-suite/packages</literal> directory for + package script files and creates a menu from all the files found there. + This menu is created under <literal>TeX-Suite > Packages > + Supported</literal>. This menu contains a list of packages "supported" + by &ls;. When you choose one of the packages from this menu (for example + the <literal>amsmath</literal> package), then a line of + the form + <programlisting>\usepackage[&ph;]{amsmath}&ph;</programlisting> + will be inserted into the current file. + </para> + <para> + The <literal>\usepackage</literal> line can also be inserted in an easy + manner in the current file by pressing <literal>&lt;F5&gt;</literal> + while in the preamble of the current document. This will set up a prompt + from the supported packages and ask you to choose from one of them. If + you do not find the package you want to insert in the list, you can type + in a package-name and it will use that. Pressing + <literal>&lt;F5&gt;</literal> in the preamble on a line containing a + single word will construct a <literal>\usepackage</literal> line from + that word. + </para> + <para> + You can also use the <link + linkend="TPackage"><literal>TPackage</literal></link> to insert the + <literal>\usepackage</literal> line. + </para> + <para> + Once you have inserted a <literal>\usepackage</literal> line, for + supported packages, you can use the Options and Commands menus + described in the <link linkend="package-actions">next section</link>. + </para> + </section> + <section id="package-actions"> + <title>Actions taken for supported packages</title> + <para> + &ls; takes the following actions for packages detected when a file is + loaded, or a new <literal>\usepackage</literal> line is inserted using + one of the methods described in the <link + linkend="inserting-packages">previous section</link>. + </para> + <para> + If you are using the GUI and you have <link + linkend="Tex_Menus">g:Tex_Menus</link> set to 1, &ls; will create the + following sub-menus + <simplelist> + <member><literal>TeX-Suite > Packages > &lt;package&gt; Options</literal></member> + <member><literal>TeX-Suite > Packages > &lt;package&gt; Commands</literal></member> + </simplelist> + </para> + <para> + where <literal>&lt;package&gt;</literal> is the package you just + inserted (or was detected). You can use these menus to insert commands, + environments and options which &ls; recognizes as belonging to this + package. + </para> + <note> + <para> + While inserting an option, you need to position yourself in the + appropriate place in the document, most commonly inside the square + braces in the <literal>\usepackage[]{packname}</literal> command. &ls; + will not navigate to that location. + </para> + </note> + <para> + In addition to creating these sub-menus, &ls; will also scan the + <literal>$VIM/ftplugin/latex-suite/dictionaries</literal> directory and + if a dictionary file corresponding to the package file is found, then + it will add the file to the <literal>'dict'</literal> setting in &vim; + so you can use the <literal>&lt;C-X&gt;&lt;C-K&gt;</literal> command to + complete words from that file. + </para> + <para> + For example, the <literal>SIUnits</literal> package has a custom + dictionary. + </para> + <anchor id="latex-package-scanning" /> + <para> + If a package detected at startup is found by &ls; in the current + directory or in a location specified by the <link + linkend="Tex_TEXINPUTS">g:Tex_TEXINPUTS</link> variable, &ls; will + scan the package for <literal>\newenvironment</literal> and + <literal>newcommand</literal> lines and also append any commands and + environments found to the list of commands and environments which you + are prompted with when you press <link + linkend="inserting-env-f5"><literal>&lt;F5&gt;</literal></link> or <link + linkend="ls-imap-f7"><literal>&lt;F7&gt;</literal></link> in insert + mode. + </para> + </section> + <para> + In addition, the <literal>TeX-Suite > Packages</literal> menu also + contains the following submenus + </para> + <formalpara> + <title>Update</title> + This command is to be invoked with the cursor placed on the package + name. If the corresponding package is found, then a sub-menu with the + supported commands and options is created. + </formalpara> + <formalpara> + <title>Update All</title> + This function reads the preamble of the document for + <literal>\usepackage</literal> lines and if &ls; supports the detected + packages, then sub-menus containing the package options and commands + are created. + </formalpara> + <section id="automatic-package-detection"> + <title>Automatic Package detection</title> + <para> + Whenever &ls; begins editing a new &latex; file, it scans it for + <literal>\usepackage{name}</literal> lines, and if a supported package + is found, then it will create sub-menus and add to the + <literal>'dict'</literal> setting as described above. + </para> + <para> + If a <link linkend="latex-master-file">master-file</link> has been specified, + then it will scan that file instead of the current file. See the section + <link linkend="custom-packages">Custom Packages</link> + to see which files &ls; will scan in more detail. + </para> + <para> + For all the packages detected in this manner, &ls; will take certain + actions as described in the section <link + linkend="package-actions">package support.</link>. + </para> + <section id="custom-packages"> + <title>Custom Packages</title> + <para> + Often times, the preamble can become too long, and some people prefer + to put most of their personalization in a custom package and include + that using a <literal>\usepackage</literal> line. &ls; tries to search + such customs package for other <literal>\usepackage</literal> lines, so + that supported packages included in this indirect manner can also be + used to create sub-menus, extend the <literal>'dict'</literal> setting + etc. The most obvious place to place such custom packages is in the + same directory as the edited file. In addition, &latex; also supports + placing custom packages in places pointed to by the + <literal>$TEXINPUTS</literal> environment variable. + </para> + <para> + If you use the <literal>$TEXINPUTS</literal> variable in &latex;, and + you wish &ls; to search these custom packages for + <literal>\usepackage</literal> lines, then you need to initialize the + <link linkend="Tex_TEXINPUTS"><literal>g:Tex_TEXINPUTS</literal></link> + variable. + </para> + <para> + The <literal>g:Tex_TEXINPUTS</literal> variable needs to be set in the + same format which &vim; uses for the <literal>'path'</literal> setting. + This format is explained in detail if you do + <programlisting>:help file-searching</programlisting> + from within &vim;. + </para> + <para> + Therefore the value of <literal>g:Tex_TEXINPUTS</literal> will most + probably be different from <literal>$TEXINPUTS</literal> which your + native &latex; distribution uses. + </para> + <para> + Example: + <programlisting>let g:Tex_TEXINPUTS = '~/texmf/mypackages/**,./**'</programlisting> + The <literal>**</literal> indicates that all directories below the + directory <literal>~/texmf/mypackages</literal> and + <literal>./</literal> are to be scanned for custom packages. + </para> + <note> + <para> + The present directory <literal>'.'</literal> is always searched. You + need not include that in <literal>g:Tex_TEXINPUTS</literal>. + </para> + </note> + </section> + </section> + <section id="supporting-packages"> + <title>Writing supporting for a package</title> + <para> + Supporting a package is easy and consists of writing a vim script with + the same name as the package and placing it in the + <literal>$VIM/ftplugin/latex-suite/packages</literal> directory. A + package script should define two variables as described in the next two + sections. In addition to these two variables, you can also define any + functions, environment definitions etc. in this file. + </para> + <section> + <title><literal>g:Tex_package_option_&lt;package&gt;</literal></title> + <para> + This setting is a string containing a comma separated list of options + supported by this package. + </para> + <para> + Example: + <programlisting>g:Tex_package_option_mypack = 'opt1,opt2=,sbr:group1,opt3,opt4'</programlisting> + The <literal>=</literal> suffix means that the option takes a value. + Use <literal>sbr:group name</literal> to separate options into + sub-menus. All successive options will be clubbed into the + <literal>group1</literal> sub-menu till the next + <literal>sbr:</literal> option is encountered. + </para> + </section> + <section> + <title><literal>g:Tex_package_&lt;package&gt;</literal></title> + <programlisting> + g:TeX_package_&lt;package&gt; = "pre:Command,pre:Command1" +More detailed example is in latex-suite/packages/exmpl file (slightly +outdated). +Here is short summary of prefixes which can be used in package files: +(x - place with cursor, &ph; - |placeholder|) + +{env:command} Environment: creates simple environment template + \begin{command} + x + \end{command}&ph; +{eno:command} Environment with option: + \begin[x]{command} + &ph; + \end{command}&ph; +{ens:command[&lt;&lt;option&gt;&gt;]...} Environment special: + \begin[&lt;&lt;option&gt;&gt;]...{command} + &ph; + \end{command}&ph; +{bra:command} Brackets: + \command{x}&ph; +{brd:command} Brackets double: + \command{x}{&ph;}&ph; +{brs:command[&lt;&lt;option&gt;&gt;]...} Brackets special (as environment special: + \command[&lt;+x+&gt;]{&ph;}{&ph;}&ph; +{nor:command} Normal: + \command&lt;Space +{noo:command} Normal with option: + \command[x]&ph; +{nob:command} Normal with option and brackets: + \command[x]{&ph;}&ph; +{pla:command} Plain: + command&lt;Space +{spe:command} Special: + command &lt;-literal insertion of command +{sep:command} creates separator. Good for aesthetics and usability :) +{sbr:command} Breaks menu into submenus. &lt;command&gt; will be title of submenu. + Can be used also in package variable. + +Command can be also given without prefix:. The result is + \command + </programlisting> + </section> + </section> + </section> + <section id="latex-completion"> + <title>Latex Completion</title> + <para> + &ls; provides an easy way to insert references to labels and + bibliographic entries and also provide filename arguments to commands + such as <literal>\includegraphics</literal>. Although the completion + capabilities are very diverse, &ls; only uses a single key + (<literal>&lt;F9&gt;</literal> by default) to do all of it. Pressing the + <literal>&lt;F9&gt;</literal> key does different things based on where + you are located. &ls; tries to guess what you might be trying to + complete at the location where you pressed + <literal>&lt;F9&gt;</literal>. For example, pressing + <literal>&lt;F9&gt;</literal> when you are within a + <literal>\ref</literal> command will try to list the + <literal>\label</literal>'s in the present directory. Pressing it when + you are in a <literal>\cite</literal> command will list bibliography + keys. &ls; also recognizes commands which need a file name argument and + will put up an explorer window for you to choose a filename. + </para> + <note id="ls-set-grepprg"> + <title>Before you start with &ls;'s completion function...</title> + <para> + All of &ls;'s completion capabilities depend on a external program + being available on your system which can search through a number of + files for a reg-exp pattern. On *nix systems, the pre-installed + <literal>grep</literal> utility is more than adequate. Most windows + systems come with a utility <literal>findstr</literal>, but that has + proven to be very inadequate (for one, it does not have an option to + force the file name to be displayed when searching through a single + file). Your best bet is to install <ulink + url="http://www.cygwin.com">cygwin</ulink>, but if you think that's + overkill, you can <ulink + url="http://www.google.com/search?q=windows%20gnu%20grep">search + for</ulink> a windows implementation of GNU grep. (&ls; testing on + windows has been done with cygwin's port of GNU grep). + </para> + <para> + Once you have a <literal>grep</literal> program installed, you need to + set the <literal>'grepprg'</literal> option for vim. Make sure you use a + setting which forces the program to display file names even when you are + searching through a single file. For GNU grep, the syntax is + <programlisting>set grepprg=grep\ -nH\ $*</programlisting> + </para> + </note> + <section id="ls-completion-usage"> + <title id="ls-completion-usage.title">&ls; completion example</title> + <para> + Consider the situation where you are editing a file with two equations + labelled <literal>eqn:euler</literal> and <literal>eqn:einstein</literal>. + Now you want to insert a reference to one of these equations. To do this, + you type the <literal>\ref{eqn:}</literal> command and with the cursor + placed after <literal>eqn:</literal>, press <literal>&lt;F9&gt;</literal>. + This will bring up two new windows beneath the main window you were working + in as shown in the figure below. + <programlisting> + 8 These are a couple of equations: + 9 +-- 4 lines: eqnarray (eqn:euler) : e^{j\pi} + 1 &amp;=&amp; 0--------------- + 13 +-- 4 lines: equation (eqn:einstein) : E = m c^2--------------------- + 17 + 18 These are a couple of figures: + 19 +-- 7 lines: figure (fig:monkeys) : Monkeys can Type------------------- + 26 +-- 7 lines: figure (fig:shakespeare) : Shakespeare could not type----- + 33 + 34 This is a reference to \ref{eqn:}&ph; + 35 + 36 + 37 \end{document} + 38 +~ +~ +~ +newfile.tex 34,32 Bot +newfile.tex|11| \label{eqn:euler} +newfile.tex|15| \label{eqn:einstein} +~ +[Error List] 1,1 All + 7 + 8 These are a couple of equations: + 9 \begin{eqnarray} + 10 e^{j\pi} + 1 &amp;=&amp; 0 + 11 \label{eqn:euler} + 12 \end{eqnarray} + 13 \begin{equation} + 14 E = m c^2 + 15 \label{eqn:einstein} + 16 \end{equation} +newfile.tex [Preview] 11,3 21% + </programlisting> + </para> + <para> + The first window (shown as <literal>[Error&nbsp;List]</literal> above) is a + <literal>|cwindow|</literal> containing a list of possible matches for the + reference. The cursor will be located in the first line of this window. The + bottom window is a <literal>preview-window</literal> showing the context of + the <literal>\label</literal>. Moving around in the + <literal>[Error&nbsp;List]</literal> window automatically scrolls the + preview window so as to always keep showing the context of the + <literal>\label</literal> being viewed in the + <literal>[Error&nbsp;List]</literal> window. You can also press + <literal>J</literal> and <literal>K</literal> in the + <literal>[ErrorList]</literal> window to scroll the preview window up and + down. + </para> + <para> + To insert one of the labels, simply position the cursor in the correct line + in the <literal>[Error&nbsp;List]</literal> window and press + <literal>&lt;enter&gt;</literal>. This will immediately close the two newly + opened windows, get back to the correct location in the original file being + edited and insert the label into the <literal>\ref</literal> command. + </para> + <para> + If you notice carefully in the example above, the + <literal>[Error&nbsp;List]</literal> window only showed the matches for the + equations and did not list any of the figure labels. This is because we + pressed <literal>&lt;F9&gt;</literal> after <literal>\ref{eqn:</literal> + instead of simply after <literal>\ref{</literal>. This caused &ls; to + search only for those labels which started with the string + <literal>eqn:</literal>. If you had pressed + <literal>&lt;F9&gt;</literal> after a <literal>\ref{</literal>, you would + have been shown matches from <emphasis>all</emphasis> labels, not just + those starting with <literal>eqn:</literal>. + </para> + <para> + Thus prefixing all your labels with <literal>eqn:</literal>, + <literal>fig:</literal>, <literal>tab:</literal> etc. depending on what you + are labelling will lead to an easier time completing references. + </para> + </section> + <section id="ls-completion-ref"> + <title>&ls; \ref completion</title> + <para> + Pressing <literal>&lt;F9&gt;</literal> when you are within a partially + completed <literal>\ref</literal> command will split open a window + (named <literal>__OUTLINE__</literal>) which contains a nicely + formatted list of all the <literal>\label</literal>s found in the + present project. The <literal>\label</literal>s are heirarchically + arranged according to which <literal>\section</literal>, + <literal>\subsection</literal> etc of the overall document structure + they are present in. For example, when you first press + <literal>&lt;F9&gt;</literal> after typing <literal>\ref{</literal>, + you should see something like: + <programlisting> ++-- 54 lines: 2. Kinematics-------------------------------- ++-- 98 lines: 3. Aerodynamics of the MFI thorax------------ ++-- 40 lines: 4. Jump Resonance in Fourbar Mechanisms------ ++-- 28 lines: 5. Design and Fabrication Issues------------- + </programlisting> + Each chapter is |fold|ed away so that you can quickly jump to the + correct section/subsection in which the relevant equation is defined. + This makes inserting references significantly faster for large projects + with hundreds of equations. You can then open some of the folds to see + for example: + <programlisting> ++-- 54 lines: 2. Kinematics-------------------------------- +3. Aerodynamics of the MFI thorax + 3.1. Aerodynamic modeling of the MFI wing forces + 3.1.1. Geometric Specification + eqn:wingnormal-pos + \nhat = T_z(\theta_2) T_y(\theta_y)T_x(\theta_x)\nhat_0, + eqn:T-1 + T_1(\theta_2) &amp;=&amp; T_z(\theta_2) + </programlisting> + The <literal>&lt;Tab&gt;</literal> key is mapped in this window to + toggle folds so that you can quickly open/close folds in order to + navigate the heirarchy faster. Once you are positioned on a + label, press <literal>&lt;Enter&gt;</literal>. This closes the + <literal>__OUTLINE__</literal> window, returns to the window in which + you pressed <literal>&lt;F9&gt;</literal> and inserts the reference + at the current cursor position. + </para> + <note> + <title>Filtering labels by prefix</title> + <para> + You can press <literal>&lt;F9&gt;</literal> after typing part of the + <literal>\label</literal>. In this case, &ls; only presents + <literal>\label</literal>s which begin with the already filled + characters. You can use this to choose between equations, figures, + tables etc. if you consistently label equations to begin with + <literal>eqn:</literal>, figures to begin with <literal>fig:</literal> + etc. For example, with this scheme, pressing + <literal>&lt;F9&gt;</literal> after typing + <literal>\ref{eqn:</literal> will only list equations. + </para> + </note> + <note> + <para> + &ls; works the same way if you press <literal>&lt;F9&gt;</literal> + after any command which contains the letters <literal>ref</literal>. + Thus you can complete <literal>\eqref</literal> in exactly the same + manner. + </para> + </note> + <note> + <title>Requirements</title> + <para> + This method of preseting the <literal>\label</literal>s depends on Vim + being compiled with python support. To check if you have this, see the + output of the <literal>:ver</literal> command. If you see something + like <literal>+python</literal>, you are all set. Failing this, you + will need to have <literal>python</literal> somewhere in your + <literal>$PATH</literal>. + </para> + </note> + </section> + <section id="latex-completion-cite"> + <title>&ls; <literal>\cite</literal> completion</title> + <para> + &ls; provides an easy way to insert references to bibliographic + entries. Pressing <literal>&lt;F9&gt;</literal> when the cursor is + placed inside a partially completed <literal>\cite</literal> command + will split open a new window (named <literal>__OUTLINE__</literal>) + which contains a formatted and syntax highlighted list of all bibtex + entries found. For example, pressing <literal>&lt;F9&gt;</literal> + after typing <literal>\ref{</literal> should present you with a window + which looks something like this: + <programlisting> +Article [dickinson:science:99] + "Wing rotation and aerodynamic basis of insect flight" + M. H. Dickinson and F-O. Lehman and S. P. Sane + In Science, 1999 + +Article [ellington:84:part1] + "The Aerodynamics of Hovering Insect Flight. I. The Quasi-Steady Analysis" + Ellington, C P + In Philosophical Transactions of the Royal Society of London. Series B, Biological Sciences, 1984 + +Article [ellington:84:part2] + "The Aerodynamics of Hovering Insect Flight. II. Morphological Parameters" + Ellington, C P + In Philosophical Transactions of the Royal Society of London. Series B, Biological Sciences, 1984 + </programlisting> + </para> + <para> + You can easily jump from one entry to another using the + <literal>'n'</literal> and <literal>'p'</literal> keys (to go to the + next / previous entry respectively). + </para> + <para> + You can also filter out a subset of the bibtex entries by pressing + <literal>'f'</literal> while in this window. Doing this presents the + following prompt: + <programlisting> +Field acronyms: (`:let g:Tex_EchoBibFields = 0` to avoid this message) + [t] title [a] author [b] booktitle + [j] journal [y] year [p] bibtype + (you can also enter the complete field name) +Enter filter criterion [field&lt;space&gt;value]: + </programlisting> + At the prompt, type + <programlisting>a ellington</programlisting> + Notice that the letter a is an acronym for <literal>author</literal> + according to the prompt above. Therefore this filter only shows those + bibtex entries whose author field contains the text + <literal>ellington</literal>. You can keep narrowing your selection by + repeatedly filtering the results. If you would like to remove all the + filters and see all entries again, press 'a', which removes + all the filters. + </para> + <para> + You can also sort the bibtex entries based on a field. To do this, + press 's'. This will present you with a prompt like in the case of the + filter and you are asked to choose a field. In this case, you would + type in a single character. This sorts the entries according to that + field. + </para> + <note> + <para> + <literal>&lt;F9&gt;</literal> will also work in a similar way after any + command which contains the word <literal>cite</literal> in it. For + example, pressing <literal>&lt;F9&gt;</literal> will also work with + <literal>\citenum</literal> etc. + </para> + </note> + <para> + The following logic is applied to find out which bibliographic entries + are included in the completion. + </para> + <orderedlist> + <listitem> + <para> + Firstly, if the present file has a <link + linkend="latex-master-file">master-file</link> defined for it, then &ls; + will perform the following steps on that file instead of on the + current file. + </para> + </listitem> + <listitem> + <para> + First, the file is scanned for a <literal>\bibliography</literal> + command. To explain better, assume that a command + <programlisting>\bibliography{file1,file2}</programlisting> is found + in the present file. For each bibliography file, say + <literal>file1</literal>, &ls; first tries to see if a + <literal>.bib</literal> file, <literal>file1.bib</literal> can be + found. If so, it will scan it for bib-keys of the form + <literal>@BOOK{</literal> etc., and add these searches to the + completion list. If a <literal>.bib</literal> file cannot be found, + then it will try to see if <literal>file1.bbl</literal> can be found. + If so, &ls; will search it for bib-keys of the form + <literal>\bibitem</literal> and add these to the completion list. + </para> + <para> + You can set the location where &ls; will search for + <literal>.bib</literal> and <literal>.bbl</literal> files using the + <link + linkend="Tex_BIBINPUTS"><literal>|Tex_BIBINPUTS|</literal></link> + variable. + </para> + </listitem> + <listitem> + <para> + If a <literal>\bibliography</literal> command is not found, then &ls; + tries to scan the present file for a + <literal>\begin{thebibliography}</literal> environment. If found, + &ls; searches the present file for bib-keys of the form + <literal>\bibitem</literal>. + </para> + </listitem> + <listitem> + <para> + Finally, it will try to see if this file includes other files + via the <literal>\input</literal> command. For each such file found, + &ls; will repeat the previous two steps stopping at the first file + which has either a <literal>\bibliography</literal> command or a + <literal>thebibliography</literal> environment. + </para> + </listitem> + </orderedlist> + <section id="cite-search-caching"> + <title>Caching the <literal>\cite</literal> completion results</title> + <anchor id="TClearCiteHist"></anchor> + <para> + Often times, the editing cycle proceeds by first laying out a + comprehensive bibliography and then completing all the + <literal>\cite</literal> commands in one session. In such situations, + it is inefficient to scan the whole list of bibliography files for + bib-keys each time. &ls; provides a way to cache the results of the + cite completion search using the <link + linkend="Tex_RememberCiteSearch"><literal>Tex_RememberCiteSearch</literal></link> + variable. If set, &ls; will perform the search only the first time + <literal>&lt;F9&gt;</literal> is used. Next time on, it will reuse the + search results. If you wish to redo the search results, issue the + command + <programlisting>TClearCiteHist</programlisting> + This will redo the completion list next time you use + <literal>&lt;F9&gt;</literal>. + </para> + </section> + </section> + <section id="ls-filename-completion"> + <title>&ls; filename completion</title> + <para> + When you press <literal>&lt;F9&gt;</literal> at a location where &ls; + guesses a filename needs to be typed, then a new explorer window will + open up with the list of files. You can use this window to change + directories etc. Pressing <literal>&lt;enter&gt;</literal> on a filename + in the explorer window will automatically close the explorer window, + return to the location where you pressed <literal>&lt;F9&gt;</literal> + from and insert the filename into that position. + </para> + <para> + &ls; also tries to guess what kinds of files you might not want to + insert and hides those accordingly. For example, if you press + <literal>&lt;F9&gt;</literal> when you are located at + <literal>\includegraphics{</literal>, then &ls; knows that you will not + want to insert <literal>.tex</literal> files. Therefore, the explorer + window will automatically hide these files. + </para> + <para> + As of now, &ls; recognizes the following commands for filename + completion. Along with the commands, this table also lists the + files which &ls; will not show for completing each command. + </para> + <informaltable frame="all"> + <tgroup cols="2"> + <thead> + <row> + <entry>command</entry> + <entry>hide pattern</entry> + </row> + </thead> + <tbody> + <row> + <entry><literal>\bibliography</literal></entry> + <entry><literal>'^\.,\.[^b]..$'</literal></entry> + </row> + <row> + <entry><literal>\include</literal> <literal>\includeonly</literal></entry> + <entry><literal>'^\.,\.[^t]..$'</literal></entry> + </row> + <row> + <entry><literal>\includegraphics</literal> <literal>\psfig</literal></entry> + <entry><literal>'^\.,\.tex$,\.bib$,\.bbl$,\.zip$,\.gz$'</literal></entry> + </row> + <row> + <entry><literal>\input</literal></entry> + <entry><literal>''</literal></entry> + </row> + </tbody> + </tgroup> + </informaltable> + </section> + <section id="ls-completion-custom"> + <title>Custom command completion</title> + <para> + &ls; also recognizes certain commonly used &latex; commands for the + <literal>&lt;F9&gt;</literal> key. At the moment, the + <literal>\bibliographystyle</literal>, <literal>\addtocontents</literal> + and the <literal>\addcontentsline</literal> commands are recognized, + although more will be added in the future. When you press the + <literal>&lt;F9&gt;</literal> after such a command, &ls; will prompt + you with a list of arguments which make sense for the command. + </para> + <para> + This functionality is available for commands for which a global + variable of the form + <literal>g:Tex_completion_{&lt;command&gt;}</literal> is defined where + <literal>&lt;command&gt;</literal> is the command name. This variable + is a comma separated list of values which this command takes. For + example, the argument to the <literal>\bibliographystyle</literal> + command is commonly one of <literal>abbr,alpha,plain,unsrt</literal>. + Therefore, &ls; defines + <programlisting>let g:Tex_completion_bibliographystyle = 'abbr,alpha,plain,unsrt'</programlisting> + You can define your own completion variables in a similar manner for + commands which you might use. + </para> + </section> + </section> + <section id="latex-compiling"> + <title>&latex; Compiling</title> + <para> + This functionality, available via the TeX-Suite menu, provides various tools + to compile and debug &latex; files from within &vim;. + </para> + <para> + If you are using commonly used LaTeX tools, then you should be all set + as soon as you download and install &ls;. In order to compile a + LaTeX file, simply press <literal>\ll</literal> while editing the file. + This runs latex on the current file and displays the errors in a + |quickfix-window| below the file being edited. You can then scroll + through the errors and press <literal>&lt;enter&gt;</literal> to be + taken to the location of the corresponding error. Along with the errors + being listed in the quickfix window, the corresponding log file is also + opened in |preview| mode beneath the quickfix window. It is scrolled + automatically to keep in sync with the error being viewed in the + quickfix window. You will be automatically taken to the location of the + first error/warning unless you set the <link + linkend="Tex_GotoError">g:Tex_GotoError</link> variable to 0. + </para> + <para> + &ls; also supports compiling &latex; into formats other than DVI. By + default, &ls; supports PDF and PS formats. In order to choose a format + other than DVI, use the <literal>TTarget</literal> command or the + <literal>TeX-Suite > Target Format</literal> menu item. This will ask you + to type in the name of the target format you want to compile to. If a rule + has been defined for the format (as described in the next + <link linkend="compiler-rules">section</link>), then &ls; will switch to + that format. + </para> + <para>Trying to choose a format for which no rule has been defined will + result in &ls; displaying a warning message without taking any action. + </para> + <para> + If you are using a multiple file project and need to compile a master + file while editing other files, then &ls; provides a way to specify the + file to be compiled as described in <link + linkend="latex-master-file">latex-master-file</link>. + </para> + <section id="compiler-rules"> + <title>Setting Compilation rules</title> + <para> + In order to compile &latex; files into various formats, &ls; needs to know + which external programs to call and in which way they need to be called. + This information is provided to &ls; via a number of "rules". For each + format you want to compile to, you need to specify a rule. A rule is + specified by defining a variable of the form: + <programlisting>g:Tex_CompileRule_&lt;format&gt;</programlisting> + where <literal>&lt;format&gt;</literal> is a string like + <literal>"pdf"</literal>, <literal>"dvi"</literal> etc. + </para> + <para> + Example: By default, &ls; uses the following rule for compiling &latex; + documents into DVI. + <programlisting>g:Tex_CompileRule_dvi = 'latex --interaction=nonstopmode $*'</programlisting> + </para> + <para> + Default values are also provided for ps and pdf formats. You might want to + change these rules in texrc according to your local tex environment. + </para> + <note> + <para> + For win32 users user MikTeX, sometimes the latex compiler's output has a + bug where a single number is split across different lines. In this case, + put the included <literal>vim-latex</literal> file distributed with &ls;. + </para> + </note> + </section> + <section id="compiler-dependency"> + <title>Handling dependencies in compilation</title> + <para> + &ls; also handles compiling dependencies automatically via certain + rules which specify the "dependency chain" for each target format. + For example, if in your case, you use + <programlisting>.tex -&gt; .dvi -&gt; .ps -&gt; .pdf</programlisting> + to generate <literal>pdf</literal> files from <literal>dvi</literal> + files, then you will need to specify the following setting in your + &ls; configuration (see <link + linkend="customizing-latex-suite">customizing &ls;</link> for where + these settings should go): + <programlisting> +let g:Tex_FormatDependency_pdf = 'dvi,ps,pdf' +</programlisting> + This is a comma separated string of formats specifying the order in + which the formats to be compiled into should be chosen. With this + setting, if you set the target format to <literal>pdf</literal>, then + the next time you compile via the <literal>\ll</literal> shortcut, &ls; + will first generate a <literal>dvi</literal> file, then use that to + generate the <literal>ps</literal> file and finally create the + <literal>pdf</literal> file from that. + </para> + <note> + <para> + If any of the intermediate formats is listed in the + <literal>g:Tex_MultipleCompileFormats</literal> setting as described + in the section <link linkend="compiling-multiple">Compiling multiple + times</link>, then &ls; might make multiple calls to the compiler to + generate the output file of that format. + </para> + </note> + <para> + Along with the <literal>g:Tex_FormatDependency_{format}</literal> + setting, you should ofcourse specify the rule for compiling to each of + the formats as described in the <link linkend="compiler-rules">previous + section</link>. For example, with the setting above, you could use: + <programlisting> +let g:Tex_CompileRule_dvi = 'latex --interaction=nonstopmode $*' +let g:Tex_CompileRule_ps = 'dvips -Ppdf -o $*.ps $*.dvi' +let g:Tex_CompileRule_pdf = 'ps2pdf $*.ps'</programlisting> + </para> + <note> + <para> + By default, &ls; does not specify any compiler dependencies. Each + target format for which a rule has been derived will be compiled + independently. + </para> + </note> + </section> + <section id="compiling-multiple"> + <title>Compiling multiple times</title> + <para> + Most &latex; compilers need to be re-run several times in several + commonly occurring situations in order to get a final camera ready copy. + For example, when <literal>\label</literal>'s change, when new + <literal>\cite</literal> commands are added etc. If the target format + you are compiling to requires multiple compilations, then you will + need to include the format in the + <literal>g:Tex_MultipleCompileFormats</literal> setting. This is a + comma separated string of formats which need multiple compilations to + be generated correctly. + </para> + <para> + By default, this setting contains just the <literal>dvi</literal> + format. If you use the <literal>pdflatex</literal> compiler to generate + <literal>pdf</literal> files, then you might want to also include + <literal>pdf</literal> into the above setting. + </para> + <para> + For every format included in the + <literal>g:Tex_MultipleCompileFormats</literal> setting described + above, &ls; will use the following logic to generate the file. Note + that although the following description uses <literal>latex</literal> + to refer to the compiler, it could be some other compiler such as + <literal>pdflatex</literal> for generating <literal>pdf</literal> + output. + </para> + <para> + <orderedlist> + <listitem>If there was a <literal>.idx</literal> file, then remember + its contents.</listitem> + <listitem>Run <literal>latex</literal>.</listitem> + <listitem>If the <literal>.idx</literal> file changed due to the latex + compiler, then run <literal>makeindex</literal> to redo the + <literal>.ind</literal> file and then remember to rerun latex. + </listitem> + <listitem> + <para> + If the <literal>.aux</literal> file generated by the latex + compiler contains a <literal>\bibdata</literal> line, then it + means that we are using a <literal>.bib</literal> file. Therefore, + run <literal>bibtex</literal>. + </para> + <note> + <para> + This means that we will always run <literal>bibtex</literal> + whenever we use the <literal>\bibliography</literal> command + whether or not we actually need to. At this time, &ls; does not + parse the <literal>.aux</literal> file before and after the latex + compiler to see if we are required to rerun + <literal>bibtex</literal>. + </para> + </note> + </listitem> + <listitem> + If the <literal>.bbl</literal> file changes because of this, then + remember to rerun latex again. + </listitem> + <listitem>Also, we check to see if the &latex; compiler gives certain + standard warnings which notify that we need to compile once again. In + this case also, remember to rerun &latex;.</listitem> + <listitem>If we found we had to rerun latex, then we repeat + the steps above but not running <literal>makeindex</literal> or + <literal>bibtex</literal> again.</listitem> + </orderedlist> + </para> + <para> + The &latex; file is compiled atmost 5 times using this logic. These + steps will ensure that on most platforms/environments, you will get a + clean output with all the cross-references, citations etc correctly + labelled and ordered. + </para> + </section> + <section id="compiler-output-customization"> + <title>Customizing the compiler output</title> + <para> + Most &latex; compilers produce a very large amount of output during + compilation, most of which is not relevant to debugging type-setting + errors. The compiler plugin provided with &ls; (which is an enhanced + version of the standard compiler plugin maintained by Artem Chuprina), + provides a way to filter the compiler output so that the actual + errors/warnings can be presented much more concisely. + </para> + <para> + The compiler plugin is set up by default to function in a "non-verbose", + "ignore-common-warnings" mode, which means that irrelevant lines from the + compiler output will be ignored and some very common warnings are also + ignored. + &ls; does this via the global variable <link + linkend="Tex_IgnoredWarnings"><literal>g:Tex_IgnoredWarnings</literal></link>. + This is a list of patterns, which can be used to filter out (or ignore) + some or the warnings and errors reported by the compiler. See the link + above for its default value. + </para> + <para> + &ls; uses the <link + linkend="Tex_IgnoreLevel"><literal>g:Tex_IgnoreLevel</literal></link> + setting to set a default ignore level. For example, for the default + value of 4, &ls; ignores warnings and errors matching the first 4 + patterns in <literal>g:Tex_IgnoredWarnings</literal>. + </para> + <para> + In addition to setting a default value of the ignore level, &ls; + provides the ability to set the level dynamically, using the + <literal>TCLevel</literal> command. For example, if you issue the + command: + <programlisting>TCLevel 3</programlisting> + from within &vim;, then the next time you compile the document, &ls; will + ignore warnings and errors which match the first three patterns in + <literal>g:Tex_IgnoredWarnings</literal>. + </para> + <para> + When TCLevel is called with the unquoted string strict as follows: + <programlisting>TClevel strict</programlisting> + then &ls; switches to a "verbose", "no-lines-ignored" mode which is useful + when you want to make final checks of your document and want to be careful + not to let things slip by. + </para> + <para> + See the explanation of the settings <link + linkend="Tex_IgnoredWarnings">g:Tex_IgnoredWarnings</link> and <link + linkend="Tex_IgnoreLevel">g:Tex_IgnoreLevel</link> to find out how to + customize the filtering done by &ls; + </para> + + </section> + <section id="part-compiling"> + <title>Compiling parts of a file</title> + <para> + &ls; also provides a way to compile a fragment of a document. This can be + very useful while debugging a complex equation or one chapter in a book, + etc. + </para> + <para> + To do this, visually select a portion of the text and press + <literal>\ll</literal> while in visual mode. The visually selected portion + will be saved to a temporary file with the preamble from the current + document prepended. &ls; will then switch focus to this temporary file and + compile it. Continue to debug this file as required and then replace the + portion of the original file with this one. + </para> + <para> + Pressing <literal>\lv</literal> while viewing the temporary file will + view the output file generated from the temporary file, not the original + file + </para> + <para> + Two commands |TPartComp| and |TPartView| are provided to be able to get + this functionality via the command line. + </para> + <para> + From release 1.6 onwards of &ls;, the temporary file created + for part compilation will reside in the same directory as the file from + which the fragment is being created. This ensures that any relative + path-names defined in the fragment will still work. &ls; will + attempt to clean the temporary file(s) created when Vim exits. + </para> + </section> + </section> + <section id="latex-viewing"> + <title>Latex Viewing and Searching</title> + <section id="latex-viewing-rules"> + <title>Setting Viewing rules</title> + <para> + In order to view the output files created by compiling the source + files, you need to specify which external program &ls; should call. You + can specify the external program using one of two settings + <link linkend="Tex_ViewRule_format">Tex_ViewRule_format</link> or <link + linkend="Tex_ViewRuleComplete_format">Tex_ViewRuleComplete_format</link>. + By default, &ls; has default settings for viewing various common output + formats via the <literal>Tex_ViewRule_format</literal> settings, so + that if you are using commonly used programs, you should be all set to + view compiled files from within &vim; by simply pressing + <literal>\lv</literal>. + </para> + <note> + <para> + The viewing function also takes the <link + linkend="latex-master-file"><literal>*.latexmain</literal></link> file + into account to decide which file to show. + </para> + </note> + <para> + If pressing <literal>\lv</literal> does not work, then it most probably + has to do with incorrect settings of the <link + linkend="Tex_ViewRule_format"><literal>g:Tex_ViewRule_&lt;format&gt;</literal></link> + where <literal>&lt;format&gt;</literal> is the format you are + attempting to view. See the link above for how to set this according to + your system. + </para> + <note> + <para> + On Windows and OS/X, you can leave the view rule empty to open the document + with the default viewer on your system. On Linux/UNIX systems, you can use + the <literal>xdg-open</literal> command to open the document with the default + viewer. + </para> + </note> + <para> + In addition to viewing the files, &ls; also supports forward and inverse + searching for certain common tools for viewing documents. + See the next few sections for details on forward and inverse searching, + including an overview of viewers. + </para> + </section> + <section id="forward-searching"> + <title>Forward Searching documents</title> + <para> + Forward searching refers to making a viewer display a given document at + a given location from within &vim;. At present, these viewers are known to support + forward searching, but viewers that are not listed here may work, too: + <informaltable frame="all"> + <tgroup cols="3"> + <thead> + <row> + <entry>Viewer</entry> + <entry>OS</entry> + <entry>Supported documents</entry> + <entry>Comment</entry> + </row> + </thead> + <tbody> + <row> + <entry><ulink url="http://skim-app.sourceforge.net/">Skim</ulink></entry> + <entry>Apple / OS X Tiger</entry> + <entry>PDF</entry> + <entry>Supports also inverse searching</entry> + </row> + <row> + <entry><ulink url="http://pdfview.sourceforge.net/">PDFView</ulink></entry> + <entry>Apple / OS X</entry> + <entry>PDF</entry> + <entry>No longer in development, supports also inverse searching</entry> + </row> + <row> + <entry><ulink url="http://www2.ing.unipi.it/~d9615/homepage/texniscope.html">TeXniscope</ulink></entry> + <entry>Apple</entry> + <entry>PDF, DVI</entry> + <entry></entry> + </row> + <row> + <entry><ulink url="http://www.miktex.org/">YAP</ulink></entry> + <entry>Windows</entry> + <entry>DVI, PS</entry> + <entry>ships with MikTex</entry> + </row> + <row> + <entry><ulink url="http://blog.kowalczyk.info/software/sumatrapdf/">Sumatra PDF</ulink></entry> + <entry>Windows</entry> + <entry>PDF</entry> + <entry></entry> + </row> + <row> + <entry><ulink url="http://developer.kde.org/~kdvi/">kdvi</ulink></entry> + <entry>Linux/UNIX</entry> + <entry>DVI</entry> + <entry></entry> + </row> + <row> + <entry><ulink url="http://okular.kde.org/">okular</ulink></entry> + <entry>Linux/UNIX</entry> + <entry>DVI, PDF, PS and many more</entry> + <entry>Included in KDE 4</entry> + </row> + <row> + <entry><ulink url="http://math.berkeley.edu/~vojta/xdvi.html">xdvi</ulink></entry> + <entry>Linux/UNIX</entry> + <entry>DVI</entry> + <entry></entry> + </row> + <row> + <entry><ulink url="http://xdvi.sourceforge.net/">xdvik</ulink></entry> + <entry>Linux/UNIX</entry> + <entry>DVI</entry> + <entry></entry> + </row> + </tbody> + </tgroup> + </informaltable> + + Pressing <literal>\ls</literal> from within &vim; + should make the viewer display the portion of the document where your + cursor is placed. + <note> + <para> + OS/X users need to set the <literal>g:TreatMacViewerAsUNIX</literal> flag + to <literal>1</literal> and provide a UNIX-like viewrule, that expects as + arguments the document, the linenumber and the sourcefile in this order. + </para> + </note> + </para> + <anchor id="enabling-searching" /> + <note> + <title>Enabling Forward and Inverse Searching</title> + <para> + Most DVI viewers need "source-special" information in order to do + forward (and inverse) searching. This information is embedded in the + <literal>dvi</literal> file if the &latex; source is compiled with the + <literal>--src-specials</literal> option. By default, &ls; does not + supply this argument to the compiler. See the section on + <literal><link + linkend="Tex_CompileRule_format">g:Tex_CompileRule_dvi</link></literal> + to find out how this option can be set. + + For pdf viewers you need to use the <ulink url="http://itexmac.sourceforge.net/pdfsync.html">pdfsync</ulink> + package in your LaTeX document. + </para> + </note> + </section> + <section id="inverse-searching"> + <title>Inverse Searching</title> + <para> + Inverse searching refers to the viewer telling &vim; to display the + &latex; source file at a given location when you double-click in the + viewer window. + </para> + <para> + You will need to <link linkend="enabling-searching">enable + searching</link> in order to use this functionality. + </para> + <para> + You will also need to specify certain settings to the DVI viewer + conveying the syntax which it needs to use to tell &vim; how to display + the source file. In <literal>YAP</literal>, you can set this option in + <literal>View > Options > Inverse Search</literal>. The + <literal>Command Line</literal> field needs to be set as follows: + <programlisting>"C:\Program Files\vim\vim61\gvim" -c ":RemoteOpen +%l %f"</programlisting> + The command <literal>:RemoteOpen</literal> is supplied when you install + &ls;. + </para> + <para> + On *nix machines, &ls; attempts to call the DVI viewer in such a way + that it already knows how to communicate with &vim;. If this does not + seem to be working, you can use the <literal>RemoteOpen</literal> + command described above. + </para> + </section> + </section> + <section id="latex-folding"> + <title>Latex Folding</title> + <para> + &ls; ships with the plugin SyntaxFolds.vim which is a plugin for + creating "fake" syntax folds on the fly. The fold method is actually manual + but the folding is based on &latex; syntax. This offers a speed increase over + regular syntax folding. Ofcourse it has the disadvantage that the folds are + not dynamic, i.e newly created syntax items are not automatically folded up. + (This is a compromise between speed and convenience). + </para> + <para> + When you open up a LaTeX file, all the portions will be automatically folded + up. However, no new folds will be created until you press + <literal>&lt;F6&gt;</literal> or <literal>\rf</literal>. (rf + stands for "refresh folds"). + </para> + <para> + The fold-text is set to the first line of the folded text unless the fold is a + table, figure etc. (an environment). In this case, if a \caption and/or a + label is found in the folded region, then those are used to make a more + meaningful fold-text, otherwise the second line of the environment is displayed + along with the name of the environment. In other words, the following + <programlisting>\begin{figure}[h] + \centerline{\psfig{figure=slidercrank.eps,height=6cm}} + \caption{The Slider Crank Mechanism.} + \label{fig:slidercrank} +\end{figure} +% a LaTeX comment. +\begin{eqnarray} + \sin(\pi) = 0 +\end{eqnarray}</programlisting> + </para> + <para> + will be shown as: + <programlisting>+--- 5 lines: figure (fig:slidercrank) : The Slider Crank Mechanism. ----- +% a LaTeX comment. ++--- 3 lines: eqnarray () : \sin(\pi) = 0 --------------------------------</programlisting> + </para> + <section id="default-folding"> + <title>Default Folding Scheme in &ls;</title> + <para> + By default &ls; creates folds in the following manner: + </para> + <programlisting>\chapter +\section +%%fakesection + \subsection + \subsubsection + \item + \equation + \eqnarray + \figure + \table + \footnote</programlisting> + <para> + The indentation shows the "nestedness" of the folding scheme. + See the <link linkend="customizing-what-to-fold">next section</link> to + see how you can change this scheme. + </para> + </section> + <section id="customizing-what-to-fold"> + <title>Customizing what to fold</title> + <para> + From version 1.6 onwards, the folding in &ls; can be controlled + to a large extent via a number of global variables. + </para> + <section id="Tex_FoldedSections"> + <title>Tex_FoldedSections</title> + <para> + This entry defines which sections will be folded. This + setting is a comma separated list of section names. + The default value is: + <programlisting>part,chapter,section,%%fakesection, +subsection,subsubsection,paragraph</programlisting> + Each of the entries in the list will fold up a section of the + corresponding name. The <literal>%%fakesection</literal> section is + provided as a means for the user to group lines into "fake" sections. + A <literal>%%fakesection</literal> is assumed to start on a line which + begins with the string <literal>%%fakesection</literal> and continue + till the start of the next <literal>\section</literal>, + <literal>\subsection</literal> or any other section. + </para> + <para> + See also <link linkend="fold-setting-advanced">advanced fold + settings</link>. + </para> + </section> + <section id="Tex_FoldedEnvironments"> + <title>Tex_FoldedEnvironments</title> + <para> + This entry defines which environments will be folded. It is a + comma separated string of words each of which defines a single + environment. The default setting is + <programlisting>verbatim,comment,eq,gather, +align,figure,table,thebibliography, +keywords,abstract,titlepage</programlisting> + The words need not be standard Latex environments. You can + add any word you like. Also, each word will fold up all + environments whose name begins with that word. For example, in + the setting above, the word <literal>"eq"</literal> folds up the + <literal>\begin{equation}</literal>, + <literal>\begin{eqnarray}</literal>, + <literal>\begin{eqnarray*}</literal> environments. To avoid + this, you can replace the word <literal>"eq"</literal> with + <literal>"eq}"</literal>. + </para> + <para> + See also <link linkend="fold-setting-advanced">advanced fold + settings</link>. + </para> + </section> + <section id="Tex_FoldedCommands"> + <title>Tex_FoldedCommands</title> + <para> + This entry defines which commands will be folded. It is a comma + separated string of words each of which defines a single command. + The default setting is empty, i.e no commands are folded. + The words need not be standard Latex commands. You can use whatever + words you like. Each word will fold all commands whose name begins + with that word as in the case of the <link + linkend="Tex_FoldedEnvironments">Tex_FoldedEnvironments</link> + variable. + </para> + <note> + <para> + It is very difficult to fold commands reliably because it is very + difficult to create a regexp which will match a line containing + unmatched parentheses (or curly brackets), but will not match a line + containing matched parentheses. + </para> + <para> + Just to make things safer, only lines which start a command but do + not contain additional curly braces after the command has started are + folded. In other words, if you wanted to fold the the command + <literal>"mycommand"</literal>, then the lines + <programlisting>\mycommand{This is a line +and some more text on the next line +}</programlisting> + will be folded, but the lines + <programlisting>\mycommand{This is a \textbf{line} +and some more text +}</programlisting> + will not be folded. This is a bug which is very difficult to fix. + </para> + </note> + <para> + See also <link linkend="fold-setting-advanced">advanced fold + settings</link>. + </para> + </section> + <section id="Tex_FoldedMisc"> + <title>Tex_FoldedMisc</title> + <para> + This entry defines fold syntax for certain items which do not + naturally fit into the section, environment of command lists. It is a + comma separated list of words. The default value is: + <programlisting>item,preamble,&lt;&lt;&lt;</programlisting> + <note> + <para> + Unlike the other Tex_FoldedXXXX variables, the words in this setting + are limited to take values from the following list: + </para> + <para> + <informaltable frame="all"> + <tgroup cols="2"> + <thead> + <row> + <entry>Value</entry> + <entry>Meaning</entry> + </row> + </thead> + <tbody> + <row> + <entry>comments</entry> + <entry>Folds up contiguous blocks of comments</entry> + </row> + <row> + <entry>item</entry> + <entry>Folds up the <literal>\item</literal>s within list + environments</entry> + </row> + <row> + <entry>preamble</entry> + <entry>Folds up the preamble of a document. (The part between + the <literal>\documentclass</literal> command and the + <literal>\begin{document}</literal> environment)</entry> + </row> + <row> + <entry><literal>&lt;&lt;&lt;</literal></entry> + <entry>Folds defined manually by the user using the + <literal>&lt;&lt;&lt;</literal> and + <literal>&gt;&gt;&gt;</literal> strings as fold-markers.</entry> + </row> + </tbody> + </tgroup> + </informaltable> + Any other words in the <literal>Tex_FoldedMisc</literal> setting + are silently ignored. + </para> + </note> + </para> + <para> + See also <link linkend="fold-setting-advanced">advanced fold + settings</link>. + </para> + </section> + <section id="fold-setting-advanced"> + <title>Advanced Fold setting details</title> + <para> + The order of the words in the <literal>Tex_FoldedXXXX</literal> + variables is <emphasis>important</emphasis>. The order defines the + order in which the folds are nested. For example, the value + <literal>"subsection,section"</literal> for the + <literal>Tex_FoldedSections</literal> variable will not fold any + subsections at all. This is because the folds are created in the + <emphasis>reverse</emphasis> order in which they occur in the + <literal>Tex_FoldedSections</literal> setting and also, once a fold is + created, the interior of the fold is not examined for creating + additional folds. In the above case, this means that a + <literal>\section</literal> is folded first and then its interior is + not examined further. The correct value should have been + <literal>"section,subsection"</literal> + </para> + <anchor id="fold-setting-adding" /> + <para> + Each of the fold setting variables + <literal>Tex_FoldedSections</literal>, + <literal>Tex_FoldedEnvironments</literal> etc., as explained previously + is a comma separated string of variables. However, to make it easier + to <emphasis>add</emphasis> to the default settings without having to + repeat the whole default setting again, &ls; uses the following logic + in forming the complete setting string from the + <literal>Tex_FoldedXXXX</literal> variables. If the variable starts with + a comma, then <literal>Tex_FoldedXXXX</literal> is added to the end of + the default string rather than replacing it. Similarly, if it ends + with a comma, then it will be prepended to the beginning of the + default setting rather than replacing it. + </para> + <para> + For example, if <literal>Tex_FoldedEnvironments</literal> is set to the + string <literal>"myenv"</literal>, then only an environment of the + form <literal>\begin{myenv}</literal> will be folded. However, if the + <literal>Tex_FoldedEnvironments</literal> setting is + <literal>",myenv"</literal>, then the <literal>\begin{myenv}</literal> + environment will be folded after all other environments in the default + setting have been folded. On the other hand if + <literal>Tex_FoldedEnvironments</literal> is of the form + <literal>"myenv,"</literal>, the <literal>\begin{myenv}</literal> + environment will be folded before the rest of the environments in the + default setting. + </para> + </section> + </section> + <section id="editing-folding"> + <title>Editing the folding.vim file directly</title> + <para> + If you are using version 1.5 of &ls; or older, you will need to + directly edit the + <literal>$VIM/ftplugin/latex-suite/folding.vim</literal> file if you + wish to modify the folding scheme. You will need to modify the + function <literal>MakeTexFolds()</literal> defined in that file to + modify the fold syntax. <literal>MakeTexFolds</literal> makes a number + of calls to <literal>AddSyntaxFoldItem</literal>. Each such call + defines a new "fold item". The order in which these calls are made + defines how the folds are nested. For example, if you desire an + <literal>figure</literal> environment to be nested within a + <literal>section</literal>, then you should define the fold for the + <literal>figure</literal> first. The syntax of + <literal>AddSyntaxFoldItem</literal> is as follows: + <programlisting>AddSyntaxFoldItem(startpat, endpat, startoff, endoff [, startskip, endskip])</programlisting> + If the last two arguments are omitted, then they are assumed to default + to the empty strings <literal>''</literal>. + The explanation for each argument is as follows: + </para> + <informaltable frame="all"> + <tgroup cols="2"> + <thead> + <row> + <entry>Argument</entry> + <entry>Explanation</entry> + </row> + </thead> + <tbody> + <row> + <entry><literal>startpat</literal></entry> + <entry>a line matching this pattern defines + the beginning of a fold. + </entry> + </row> + <row> + <entry> + <literal>endpat</literal> + </entry> + <entry> + a line matching this pattern defines the end of a fold. + </entry> + </row> + <row> + <entry><literal>startoff</literal></entry> + <entry> + this is the offset from the starting line at which folding will + actually start + </entry> + </row> + <row> + <entry><literal>endoff</literal></entry> + <entry> + like <literal>startoff</literal>, but gives the offset of the + actual fold end from the line satisfying <literal>endpat</literal>. + <literal>startoff</literal> and <literal>endoff</literal> are + necessary when the folding region does not have a specific end + pattern corresponding to a start pattern. for example in &latex;, + <literal>\section{Section Name}</literal> defines the beginning of + a section, but there is no command which specifically ends a + section. Thus a <literal>\section</literal> is assumed to end 1 + line <emphasis>before</emphasis> another section starts. + </entry> + </row> + <row> + <entry> + <literal>startskip</literal> + </entry> + <entry> + A Pattern Which Defines The Beginning Of A "Skipped" Region. + + For example, suppose we define a \itemize fold as follows: + <programlisting><literal>startpat</literal> = '^\s*\\item', +<literal>endpat</literal> = '^\s*\\item\|^\s*\\end{\(enumerate\|itemize\|description\)}', +<literal>startoff</literal> = 0, +<literal>endoff</literal> = -1</programlisting> + + This defines a fold which starts with a line beginning with an + <literal>\item</literal> and ending one line before a line beginning with an + <literal>\item</literal> or <literal>\end{enumerate}</literal> etc. + + Then, as long as <literal>\item</literal>'s are not nested things are fine. + However, once items begin to nest, the fold started by one + <literal>\item</literal> can end because of an + <literal>\item</literal> in an <literal>\itemize</literal> + environment within this <literal>\item</literal>. i.e, the following can happen: + + <programlisting>\begin{itemize} +\item Some text &lt;------- fold will start here +This item will contain a nested item +\begin{itemize} &lt;----- fold will end here because next line contains \item... +\item Hello +\end{itemize} &lt;----- ... instead of here. +\item Next item of the parent itemize +\end{itemize}</programlisting> + + Therefore, in order to completely define a folding item which + allows nesting, we need to also define a "skip" pattern. + <literal>startskip</literal> and end skip do that. + Leave '' when there is no nesting. + </entry> + </row> + <row> + <entry> + <literal>endskip</literal> + </entry> + <entry> + the pattern which defines the end of the "skip" pattern for + nested folds. + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + <note> + <title>Example 1</title> + <para> + A syntax fold region for the latex section is defined with the + following arguments to <literal>AddSyntaxFoldItem</literal>: + <programlisting>startpat = "\\section{" +endpat = "\\section{" +startoff = 0 +endoff = -1 +startskip = '' +endskip = ''</programlisting> + Note that the start and end patterns are thus the same and + <literal>endoff</literal> has a negative value to capture the effect + of a section ending one line before the next starts. + </para> + </note> + <note> + <title>Example 2</title> + <para> + A syntax fold region for the \itemize environment is: + <programlisting>startpat = '^\s*\\item', +endpat = '^\s*\\item\|^\s*\\end{\(enumerate\|itemize\|description\)}', +startoff = 0, +endoff = -1, +startskip = '^\s*\\begin{\(enumerate\|itemize\|description\)}', +endskip = '^\s*\\end{\(enumerate\|itemize\|description\)}'</programlisting> + Note the use of <literal>startskip</literal> and + <literal>endskip</literal> to allow nesting. + </para> + </note> + </section> + </section> + <section id="latex-project"> + <title>Multiple file &latex; projects</title> + <anchor id="latex-project-example" /> + <para> + Many &latex; projects contain multiple source files which are + <literal>\include</literal>d from a master file. A typical example of + this situation is a directory layout such as the following + </para> + <para> + <programlisting>thesis/ + main.tex + abstract.tex + intro/ + intro.tex + figures/ + fig1.eps + fig2.eps + chapter1/ + chap1.tex + figures/ + fig1.eps + conclusion/ + conclusion.tex + figures/</programlisting> + </para> + <para> + In the above case, <literal>main.tex</literal> will typically look like + </para> + <para> + <programlisting>% file: main.tex +\documentclass{report} +\begin{document} + +\input{abstract.tex} +\input{intro/intro.tex} +\input{chapter1/chap1.tex} +\input{conclusion/conclusion.tex} + +\end{document}</programlisting> + </para> + <para> + <anchor id="latex-master-file-specification" /> In such situations, you will + need to convey to &ls; that <literal>main.tex</literal> is the main file + which <literal>\input</literal>s the other files. This is done by creating + an empty file called <literal>main.tex.latexmain</literal> in the same + directory in which <literal>main.tex</literal> resides. This file is called + the <emphasis>master file</emphasis> in this manual. See <link + linkend="Tex_MainFileExpression">Tex_MainFileExpression</link> for an + alternative way of specifying the master file. + </para> + <note> + <para> + Here <literal>main.tex.latexmain</literal> is (obviously) a different + file from <literal>main.tex</literal> itself. + <literal>main.tex</literal> need not be renamed. This ofcourse + restricts each directory to have a single master file. + </para> + </note> + <para> + Each time &ls; opens a new &latex; file, it will try to see if it is + part of a multiple file project by searching upwards (to the root of + the file-system) from the current file's directory to see if it finds a + file of the form <literal>*.latexmain</literal>. If such a file is + found, then it is considered that the current file is part of a larger + project. The name of the &latex; master file is inferred directly from + the first part of the <literal>*.latexmain</literal> file as described + in the example above. + </para> + <section id="latex-project-settings"> + <title>&ls; project settings</title> + <para> + If a <link linkend="latex-master-file">master file</link> is found, + then &ls; <literal>:source</literal>s the file. Thus this file needs to + contain valid &vim; commands. This file is typically used to store + project specific settings. + </para> + <para> + Some typical per-project settings which are best put in the master file + are + <simplelist> + <member><link + linkend="Tex_ProjectSourceFiles">Tex_ProjectSourceFiles</link></member> + </simplelist> + </para> + </section> + <section id="latex-master-file"> + <title>Specifying which file to compile</title> + <para> + In the example described <link + linkend="latex-project-example">previously</link>, if you are editing + <literal>intro/intro.tex</literal> and press <literal>\ll</literal>, + then you still want &ls; to compile <literal>main.tex</literal>, + because <literal>intro/intro.tex</literal> is merely a fragment which + is <literal>\input</literal>'ed into <literal>main.tex</literal>. If + the master file is already specified using the + <literal>*.latexmain</literal> convention described <link + linkend="latex-project-example">previously</link>, then &ls; will automatically + compile the master file when you are editing any of its + <literal>\input</literal>'ed fragments. Thus pressing + <literal>\ll</literal> while editing <literal>intro/intro.tex</literal> + will compile <literal>main.tex</literal>. + </para> + <anchor id="Tex_MainFileExpression" /> + <para> + If you wish to use some different logic to specify the main file name, + you can specify a custom expression via the + <literal>Tex_MainFileExpression</literal> variable. This is a string + containing a valid vim expression. In addition, you can use a variable + <literal>modifier</literal> which is in the format used for + <literal>|filename-modifiers|</literal>, for example, + <literal>':p:h'</literal>. You should utilize this variable to modify + the filename of the main file. + <programlisting>let g:Tex_MainFileExpression = 'MainFile(modifier)' +function! MainFile(fmod) + if glob('*.latexmain') != '' + return fnamemodify(glob('*.latexmain'), a:fmod) + else + return '' + endif +endif</programlisting> + </para> + </section> + </section> + <section id="latex-suite-commands-maps"> + <title>&ls; Commands and Maps</title> + <para> + This section describes the maps and commands used in &ls;. It also + describes a way to change the map sequences according to your + preference. + </para> + <section id="latex-suite-maps"> + <title>&ls; Maps</title> + <anchor id="remapping-latex-suite-keys" /> + <para> + Most of the mappings used in &ls; can be mapped to a different key + combination to suit your particular needs. An example best explains the + procedure for doing this. Suppose you want to remap the + <literal>&lt;C-j&gt;</literal> key which &ls; (actually imaps.vim) uses + to jump to the next placeholder. To do this, you first need to find out + which <literal>&lt;Plug&gt;</literal> mapping + <literal>&lt;C-j&gt;</literal> is derived from. You will need to look + at the relevant section of this manual to do this. For example, the + section <link linkend="customize-imap-maps">IMAP mappings</link> has + the information that the <literal>&lt;C-j&gt;</literal> key is derived + from <literal>&lt;Plug&gt;IMAP_JumpForward</literal>. Therefore to + remap the <literal>&lt;C-j&gt;</literal> key to say + <literal>&lt;C-space&gt;</literal>, you will need to put a + statement like the following in your <literal>~/.vimrc</literal>. + <programlisting>imap &lt;C-space&gt; &lt;Plug&gt;IMAP_JumpForward</programlisting> + </para> + <note> + <para> + To change the <literal>IMAP</literal> mappings which affect jumping + between placeholders, the <literal>map</literal> statement above has + to be placed in your <literal>~/.vimrc</literal>. For other mappings + you can place the <literal>map</literal> statement in your + <literal>$VIM/ftplugin/tex.vim</literal> file. The reason for this is + that the <literal>&lt;C-j&gt;</literal> maps are created in + <literal>plugin/imaps.vim</literal>, which is sourced as soon as &vim; + starts before sourcing any ftplugin files. + </para> + </note> + <section id="customize-imap-maps"> + <title>IMAP mappings</title> + <para> + These mappings are utilized for jumping between placeholders as + described <link linkend="place-holders">here</link>. See the <link + linkend="latex-suite-maps">parent section</link> to find out how to + use this information to change the default maps. + </para> + <anchor id="Plug_IMAP_JumpForward" /> + <anchor id="Plug_IMAP_JumpBack" /> + <anchor id="Plug_IMAP_DeleteAndJumpForward" /> + <anchor id="Plug_IMAP_DeleteAndJumBack" /> + <informaltable frame="all"> + <tgroup cols="2"> + <thead> + <row> + <entry>Plug map</entry> + <entry>Default Key</entry> + </row> + </thead> + <tbody> + <row> + <entry><literal>&lt;Plug&gt;IMAP_JumpForward</literal></entry> + <entry><literal>&lt;C-j&gt;</literal></entry> + </row> + <row> + <entry><literal>&lt;Plug&gt;IMAP_JumpBack</literal></entry> + <entry>(none)</entry> + </row> + <row> + <entry><literal>&lt;Plug&gt;IMAP_DeleteAndJumpForward</literal></entry> + <entry>(none)</entry> + </row> + <row> + <entry><literal>&lt;Plug&gt;IMAP_DeleteAndJumpBack</literal></entry> + <entry>(none)</entry> + </row> + </tbody> + </tgroup> + </informaltable> + <para> + <literal>&lt;Plug&gt;IMAP_JumpForward</literal> takes you to the + location of the next <link + linkend="place-holders">place-holder</link>. + </para> + <para> + <literal>&lt;Plug&gt;IMAP_JumpBack</literal> takes you to the previous + <link linkend="place-holders">place-holder</link>. + </para> + <para> + <literal>&lt;Plug&gt;IMAP_DeleteAndJumpForward</literal> deletes the + presently selected place-holder and jumps to the next place-holder + irrespective of whether the present placeholder is empty or not and + ignoring the value of place-holder settings like <link + linkend="Imap_DeleteEmptyPlaceHolders"><literal>g:Imap_DeleteEmptyPlaceHolders</literal></link> + and <link + linkend="Imap_StickyPlaceHolders"><literal>g:Imap_StickyPlaceHolders</literal></link> + </para> + <para> + <literal>&lt;Plug&gt;IMAP_DeleteAndJumpBack</literal> deletes the + presently selected place-holder and jumps to the previous place-holder + irrespective of whether the present placeholder is empty or not and + ignoring the value of place-holder settings like <link + linkend="Imap_DeleteEmptyPlaceHolders"><literal>g:Imap_DeleteEmptyPlaceHolders</literal></link> + and <link + linkend="Imap_StickyPlaceHolders"><literal>g:Imap_StickyPlaceHolders</literal></link> + </para> + </section> + <section id="customize-alt-key-maps"> + <title>Alt-Key mappings</title> + <para> + These mappings are are described in the section <link + linkend="altkey-mappings">Alt key macros</link>. See <link + linkend="remapping-latex-suite-keys">the parent section</link> to see + how to use the following information to remap keys. + </para> + <anchor id="Plug_Tex_MathBF" /> + <anchor id="Plug_Tex_MathCal" /> + <anchor id="Plug_Tex_LeftRight" /> + <anchor id="Plug_Tex_InsertItemOnThisLine" /> + <informaltable frame="all"> + <tgroup cols="2"> + <thead> + <row> + <entry>Plug Mapping</entry> + <entry>Default Key</entry> + </row> + </thead> + <tbody> + <row> + <entry><literal>&lt;Plug&gt;Tex_MathBF</literal></entry> + <entry><literal>&lt;Alt-B&gt;</literal></entry> + </row> + <row> + <entry><literal>&lt;Plug&gt;Tex_MathCal</literal></entry> + <entry><literal>&lt;Alt-C&gt;</literal></entry> + </row> + <row> + <entry><literal>&lt;Plug&gt;Tex_LeftRight</literal></entry> + <entry><literal>&lt;Alt-L&gt;</literal></entry> + </row> + <row> + <entry><literal>&lt;Plug&gt;Tex_InsertItemOnThisLine</literal></entry> + <entry><literal>&lt;Alt-I&gt;</literal></entry> + </row> + </tbody> + </tgroup> + </informaltable> + </section> + </section> + <section id="latex-suite-commands"> + <title>Latex Suite Commands</title> + <section id="TMacro"> + <title>:TMacro [{macro}]</title> + <para> + When used without any arguments lists all available macros defined + in runtime ftplugin/latex-suite/macros/ directories and prompts you + to choose one of them. With one argument |:read| this macro under + cursor position. With more than one argument it will not work :) In + Vim >= 6.2 works completion of names of macros (see 'wildmenu', + 'wildmode' for more about command-line completion). + </para> + </section> + <section id="TMacroEdit"> + <title>:TMacroEdit [{macro}]</title> + <para> + Splits window for editing {macro}. When used without any arguments + lists all available macros defined in runtime + ftplugin/latex-suite/macros/ directories and prompt you to choose + one of them. When you try to edit {macro} not from local directory + &ls; will copy it to your local directory with suffix + "-local". If local copy already exists &ls; prompt for + overwriting it. In Vim >= 6.2 works completion of names of macros + (see 'wildmenu', 'wildmode' for more about command-line completion). + </para> + </section> + <section id="TMacroNew"> + <title>:TMacroNew</title> + <para> + Splits window to write new macro. Directory in new buffer is + locally changed to &ls;/macros/. + </para> + </section> + <section id="TMacroDelete"> + <title>:TMacroDelete [{macro}]</title> + <para> + Delets {macro} from your local ftplugin/latex-suite/macros/ + directory. When used without any arguments lists all available + macros defined in &ls;/macros/ directory and prompt you to + choose one of them. When you choose to delete {macro} which is not + in your local directory &ls; will refuse to delete it. In + Vim >= 6.2 works completion of names of macros (see 'wildmenu', + 'wildmode' for more about command-line completion) + </para> + </section> + <section id="TPackage"> + <title>:TPackage [{package, ...}]</title> + <para> + When used without any arguments lists name of the packages for + which support is available. If you are using &vim; GUI and have + <literal>Tex_Menus</literal> set to 1, then it will list all files + found in the <literal>$VIM/ftplugin/latex-suite/packages</literal> + directory. Otherwise, &ls; will list files found in the + <literal>$VIM/ftplugin/latex-suite/dictionaries</literal> directory. + Choosing a file from the list will insert a + <programlisting>\usepackage[&ph;]{&lt;packname&gt;}</programlisting> line into the + buffer at the current cursor location. For &vim; 6.2 and above, you + can use command-line completion to choose a package file. You can also + call <literal>TPackage</literal> with one or more package names + separated with spaces in which case, &ls; will insert + <literal>\usepackage</literal> lines for each of them in turn. + </para> + <para> + After inserting the <literal>\usepackage</literal> line(s), &ls; will + support it (them) in various ways as described in the section <link + linkend="package-actions">Actions taken for supported + packages</link>. + </para> + </section> + <section id="TPackageUpdate"> + <title>:TPackageUpdate</title> + <para> + This command `reads' name of package under cursor and turns on + possible support. + </para> + </section> + <section id="TPackageUpdateAll"> + <title>:TPackageUpdateAll</title> + <para> + After issuing this command latexSuite scans the file in + looking for not declared packages, removing not needed entries + from Packages menu and turning off not necessary packages' + dictionaries. + </para> + </section> + <section id="TTemplate"> + <title>:TTemplate [{template}]</title> + <para> + When used without any arguments lists all available templates + from latex-suite/templates/ directory and prompts to choose + one of them. + With one argument :0|read| {template} file. + With more than one argument it will not work :) + In Vim >= 6.2 works completion of names of macros (see 'wildmenu', + 'wildmode' for more about command-line completion) + </para> + </section> + <section id="TSection"> + <title>:TSection [{argument}]</title> + <para> + Used without any arguments inserts last section type + (|latex-sectioning|). + Accepts arguments: + n&gt; inserts section name in &lt;n&gt; logical level. + Levels are: + <informaltable> + <tgroup cols="2"> + <tbody> + <row><entry>0</entry><entry>part</entry></row> + <row><entry>1</entry><entry>chapter</entry></row> + <row><entry>2</entry><entry>section</entry></row> + <row><entry>3</entry><entry>subsection</entry></row> + <row><entry>4</entry><entry>subsubsection</entry></row> + <row><entry>5</entry><entry>paragraph</entry></row> + <row><entry>6</entry><entry>subparagraph</entry></row> + </tbody> + </tgroup> + </informaltable> + + <informaltable> + <tgroup cols="2"> + <tbody> + <row> + <entry> + +&lt;n&gt; + </entry> + <entry> + inserts section name &lt;n&gt; logical levels above the last + used comand + </entry> + </row><row> + <entry> + -&lt;n&gt; + </entry> + <entry> + inserts section name &lt;n&gt; logical levels below the last + used comand + </entry> + </row><row> + <entry> + + + </entry> + <entry> + inserts section name one logical level below the last + used command (equal to +1). + </entry> + </row><row> + <entry> + ++ + </entry> + <entry> + inserts section name two logical levels below the last + used command (equal to +2). + </entry> + </row><row> + <entry> + - + </entry> + <entry> + inserts section name one logical level over the last + used command (equal to -1). + </entry> + </row><row> + <entry> + -- + </entry> + <entry> + inserts section name two logical levels over the last + used command (equal to -2). + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + + Command accepts also latexSuite mappings (|latex-macros|) + without preceding S and in lowercase: + <programlisting>:TSection pa</programlisting> + will result in <literal>\part{}</literal>. It is possible to use full names of + sections: <literal>:TSection part</literal> + </para> + </section> + <section id="TSectionAdvanced"> + <title>:TSectionAdvanced</title> + <para> + Accepts the same arguments as |TSection| but leads to a couple + of questions (whether you want to include the section in the + table of contents, whether there is a shorter name for the + table of contents) and then creates a more intelligent + template. + </para> + </section> + <section id="TLook"> + <title>:TLook</title> + <para> + Accepts one argument. Will look through .tex files in + directory of edited file for argument. It can be regexp. You + don't have to enclose argument in "". &lt;cr&gt; takes you to + location. Other keys work as described in |latex-viewer|. + Note: TLook uses :grep command and is using 'grepprg'. Its + regular expressions can be different from those of Vim. + </para> + </section> + <section id="TLookBib"> + <title>:TLookBib</title> + <para> + Accepts one argument. Will look through .bib files in + directory of edited file for argument. It can be regexp. You + don't have to enclose argument in "". &lt;cr&gt; takes you to + location. Other keys work as described in |latex-viewer|. + </para> + <note> + <para> + TLookBib uses :grep command and is using 'grepprg'. Its + regular expressions can be different from those of Vim. + </para> + </note> + </section> + <section id="TLookAll"> + <title>:TLookAll</title> + <para> + Accepts one argument. Will look through all files in directory + of edited file for argument. It can be regexp. You don't have + to enclose argument in "". &lt;cr&gt; takes you to location. Other + keys work as described in |latex-viewer|. + Note: TLook uses :grep command and is using 'grepprg'. Its + regular expressions can be different from those of Vim. + </para> + </section> + <section id="TPartComp"> + <title>:TPartComp</title> + <para> + No argument allowed but accepts range in all formats. Define + fragment of interest with :'a,'b, :/a/,/b/, :'&lt;,'&gt; or :20,30. + All other rules of compilation apply. + </para> + </section> + <section id="TPartView"> + <title>:TPartView</title> + <para> + Show last compiled fragment. All rules of viewing apply but + |latex-searching|. + </para> + </section> + <section id="Tshortcuts"> + <title>:Tshortcuts [{arg}]</title> + <para> + Show shortcuts in terminal (not using menu). Without {arg} + you will see simple menu prompting for one of them. Possible + arguments: + <informaltable frame="none"> + <tgroup cols="2"> + <tbody> + <row><entry>g</entry><entry>General shortcuts</entry></row> + <row><entry>e</entry><entry>Environment shortcuts</entry></row> + <row><entry>f</entry><entry>Font shortcuts</entry></row> + <row><entry>s</entry><entry>Section shortcuts</entry></row> + <row><entry>m</entry><entry>Math shortcuts</entry></row> + <row><entry>a</entry><entry>All shortcuts</entry></row> + </tbody> + </tgroup> + </informaltable> + </para> + </section> + </section> + </section> + <section id="customizing-latex-suite"> + <title>Customizing &ls;</title> + <para> + Customizing &ls; is done by defining certain global variables in + <literal>$VIM/ftplugin/tex.vim</literal>, where + <literal>$VIM</literal> corresponds to <literal>~/.vim</literal> for *nix + machines and <literal>~/vimfiles</literal> for windows machines. This file + is not part of the &ls; distribution. You will need to create this file + yourself (or modify it if it exists) if + you need to change any default settings. Since this file is not + included as part of the &ls; distribution, it will not be over-written in + subsequent updates. + </para> + <para> + The default settings in &ls; are defined in + <literal>$VIM/ftplugin/latex-suite/texrc</literal>. Please take a look at + this file if you find this documentation incomplete or confusing. That file + is also well documented. + </para> + <para> + This chapter describes the various settings which effect &ls; and their + default values. The settings are broken up into sections according to the + behavior which they influence. + </para> + <section id="ls-general-purpose-settings"> + <title>General Settings</title> + <section id="Tex_Debug"> + <title>Tex_Debug</title> + <para> + <informaltable frame="all"> + <tgroup cols="2"> + <tbody> + <row><entry>Type</entry><entry>boolean</entry></row> + <row><entry>Default Value</entry> + <entry><literal>0</literal></entry></row> + </tbody> + </tgroup> + </informaltable> + <para> + If set to 1, then &ls; will create certain global debug + statements which can be printed by doing + <programlisting>:call Tex_PrintDebug()</programlisting> + </para> + </para> + </section> + <section id="Tex_UsePython"> + <title>Tex_UsePython</title> + <para> + <informaltable frame="all"> + <tgroup cols="2"> + <tbody> + <row><entry>Type</entry><entry>boolean</entry></row> + <row><entry>Default Value</entry> + <entry><literal>1</literal></entry></row> + </tbody> + </tgroup> + </informaltable> + <para> + If &ls; detects that your vim is python enabled (using + <literal>has('python')</literal>), then it tries to use python in + certain places to speed things up. If this misbehaves, you can set + this to zero, in which case, &ls; will use vimscript to accomplish + the same. + </para> + </para> + </section> + </section> + <section id="customizing-place-holders"> + <title>Place-Holder Customization</title> + <para> + &ls; uses <link linkend="place-holders">place-holders</link> to minimize + using the movement keys while typing. The following settings affect how + place-holders are used. + </para> + <note> + <para> + These setting need to be set in your <literal>~/.vimrc</literal>, not + <literal>$VIM/ftplugin/tex.vim</literal> because these settings affect + the behavior of <literal>imaps.vim</literal>, which is a global plugin, + not a file-type plugin. + </para> + </note> + <section id="Imap_UsePlaceHolders"> + <title>g:Imap_UsePlaceHolders</title> + <informaltable frame="all"> + <tgroup cols="2"> + <tbody> + <row><entry>Type</entry><entry>Boolean</entry></row> + <row><entry>Default Value</entry> + <entry><literal>1</literal></entry></row> + </tbody> + </tgroup> + </informaltable> + <para> + Setting this to zero completely disables using place-holders. + </para> + </section> + <section id="Imap_PlaceHolderStart"> + <anchor id="Imap_PlaceHolderEnd"></anchor> + <title>g:Imap_PlaceHolderStart &amp; g:Imap_PlaceHolderEnd</title> + <informaltable frame="all"> + <tgroup cols="3"> + <thead> + <row> + <entry>Setting</entry> + <entry>Type</entry> + <entry>Value</entry> + </row> + </thead> + <tbody> + <row> + <entry><literal>Imap_PlaceHolderStart</literal></entry> + <entry>String</entry> + <entry><literal>'&lt;+'</literal></entry> + </row> + <row> + <entry><literal>Imap_PlaceHolderEnd</literal></entry> + <entry>String</entry> + <entry><literal>'+&gt;'</literal></entry> + </row> + </tbody> + </tgroup> + </informaltable> + <para> + These settings affect the strings displayed at the beginning and end of + the place-holder string. Set these strings to a value different than a + commonly occurring sequence of characters. + </para> + <note> + <title>TIP</title> + <para> + If you use the <literal>latin1</literal> encoding and do not type in + french, then you can set these strings to the <literal>\xab</literal> + and <literal>\xbb</literal> characters (the french quotation marks). + </para> + </note> + </section> + <section id="Imap_DeleteEmptyPlaceHolders"> + <title>g:Imap_DeleteEmptyPlaceHolders</title> + <informaltable frame="all"> + <tgroup cols="2"> + <tbody> + <row><entry>Type</entry><entry>Boolean</entry></row> + <row><entry>Default Value</entry> + <entry><literal>1</literal></entry></row> + </tbody> + </tgroup> + </informaltable> + <para> + When set to one, non-descriptive or empty place-holders are deleted on + pressing <literal>&lt;Ctrl-J&gt;</literal>. + </para> + </section> + <section id="Imap_StickyPlaceHolders"> + <title>g:Imap_StickyPlaceHolders</title> + <informaltable frame="all"> + <tgroup cols="2"> + <tbody> + <row><entry>Type</entry><entry>Boolean</entry></row> + <row><entry>Default Value</entry> + <entry><literal>1</literal></entry></row> + </tbody> + </tgroup> + </informaltable> + <para> + When set to 1, in visual mode, <literal>&lt;Ctrl-J&gt;</literal> takes + you to the next placeholder without deleting the current placeholder. + </para> + </section> + </section> + <section id="customizing-macros"> + <title>Macro Customization</title> + <section id="Tex_Env_name"> + <title>Tex_Env_name</title> + <para> + If you wish to wish to expand certain environments differently from + the way &ls; does it, you can define custom expansions using global + variables of the form <literal>Tex_Env_{name}</literal> where + <literal>name</literal> corresponds to the environment. + </para> + <para> + For example, if you press <literal>&lt;F5&gt;</literal> after typing + <literal>theorem</literal>, &ls; will by default expand it to + <programlisting>\begin{theorem} + \label{&ph;}&ph; +\end{theorem}&ph;</programlisting> + However, if you wish change this to + <programlisting>\begin{theorem} + &ph; +\end{theorem}&ph;</programlisting> + then define the following variable + <programlisting>let g:Tex_Env_theorem = "\\begin{theorem}\&lt;CR&gt;&ph;\&lt;CR&gt;\\end{theorem}"</programlisting> + </para> + <para> + If the expansion uses special keys such as carriage return etc, then + use double-quotes and use the <literal>"\&lt;key&gt;"</literal> + notation for special keys. Backslashes have to be doubled. + </para> + <para> + You could even use strings returned by functions as the expansion by + using the <link + linkend="IMAP_PutTextWithMovement">IMAP_PutTextWithMovement()</link> + function. + </para> + <para> + If the name of the environment contains special characters (for + example, the <literal>eqnarray*</literal> environment), then use the + following form: + <programlisting>let g:Tex_Env_{'eqnarray*'} = + \ "\\begin{eqnarray*}\&lt;CR&gt;&ph; &amp;=&amp; &ph;\&lt;CR&gt;\\end{eqnarray*}&ph;"</programlisting> + This will make pressing <literal>&lt;F5&gt;</literal> after + <literal>eqnarray*</literal> expand to + <programlisting>\begin{eqnarray*} + &ph; &amp;=&amp; &ph; +\end{eqnarray*}&ph;</programlisting> + </para> + </section> + <section id="Tex_Com_name"> + <title>Tex_Com_name</title> + <para> + If you wish to define new expansions for fast command insertion as + described <link linkend="latex-command-maps">here</link>, or redefine + expansions from the default values in &ls;, you will need to define + variables of the form <literal>g:Tex_Com_{name}</literal> where + <literal>name</literal> is a command name. For example, with the + setting + <programlisting>let g:Tex_Com_frac = "\\frac{&ph;}{&ph;}&ph;"</programlisting> + pressing <literal>&lt;F7&gt;</literal> after typing + <literal>frac</literal> will change it to <literal>\frac{&ph;}{&ph;}&ph;</literal> + </para> + <para> + See <link linkend="Tex_Env_name">Tex_Env_name</link> for additional + details on how to create this setting in various special + circumstances. + </para> + </section> + <section id="macro-enabling"> + <title>Enabling / disabling macros</title> + <para> + The following variables disable various parts of the macro functionality + of &ls;. See the links to the relevant sections to see what functionality + setting each of the variables to zero will take away. + </para> + <anchor id="Tex_EnvironmentMaps" /> + <anchor id="Tex_EnvironmentMenus" /> + <anchor id="Tex_FontMaps" /> + <anchor id="Tex_FontMenus" /> + <anchor id="Tex_SectionMaps" /> + <anchor id="Tex_SectionMenus" /> + <informaltable frame="all"> + <tgroup cols="3"> + <thead> + <row><entry>Setting</entry><entry>Link to relevant section</entry><entry>Default Value</entry></row> + </thead> + <tbody> + <row><entry><literal>g:Tex_EnvironmentMaps + </literal></entry><entry><link linkend="environment-mappings">Environment Mappings</link></entry><entry>1</entry></row> + <row><entry><literal>g:Tex_EnvironmentMenus</literal></entry><entry></entry><entry>1</entry></row> + <row><entry><literal>g:Tex_FontMaps </literal></entry><entry><link linkend="font-maps">Font Mappings</link></entry><entry>1</entry></row> + <row><entry><literal>g:Tex_FontMenus </literal></entry><entry></entry><entry>1</entry></row> + <row><entry><literal>g:Tex_SectionMaps </literal></entry><entry><link linkend="section-mappings">Section Mappings</link></entry><entry>1</entry></row> + <row><entry><literal>g:Tex_SectionMenus </literal></entry><entry></entry><entry>1</entry></row> + </tbody> + </tgroup> + </informaltable> + </section> + <section id="Tex_UseMenuWizard"> + <title>g:Tex_UseMenuWizard</title> + <informaltable frame="all"> + <tgroup cols="2"> + <tbody> + <row><entry>Type</entry><entry>Boolean</entry></row> + <row><entry>Default Value</entry> + <entry><literal>0</literal></entry></row> + </tbody> + </tgroup> + </informaltable> + <para> + If this variable is set to 1, then when an environment is chosen from the + menu then for selected environments, &ls; asks a series of + questions on the command line and inserts a template with the + corresponding fields already filled in. Setting this to zero will insert + a template with <link linkend="place-holders">place-holders</link> + marking off the places where fields need to be filled. + </para> + </section> + <section id="Imap_FreezeImap"> + <title>g:Imap_FreezeImap</title> + <para> + <informaltable frame="all"> + <tgroup cols="2"> + <tbody> + <row><entry>Type</entry><entry>boolean</entry></row> + <row><entry>Default Value</entry> + <entry><literal>0</literal></entry></row> + </tbody> + </tgroup> + </informaltable> + <para> + This option when set to 1, temporarily freezes &ls;'s macro + expansion. It might be useful when you are using some other keymap + which is causing excessive macro expansion. Use a buffer-local + variable of the same name if you wish to affect just the present + buffer. + </para> + </para> + </section> + <section id="Tex_CatchVisMapErrors"> + <title>g:Tex_CatchVisMapErrors</title> + <informaltable frame="all"> + <tgroup cols="2"> + <tbody> + <row><entry>Type</entry><entry>Boolean</entry></row> + <row><entry>Default Value</entry> + <entry><literal>1</literal></entry></row> + </tbody> + </tgroup> + </informaltable> + <para> + With so many visual maps, its helpful to have a way of catching typing + errors made in visual mode. What this does is to prompt you to correct + your visual mode mapping if you start out with <literal><link + linkend="Tex_Leader">g:Tex_Leader</link></literal> and then type some + illegal keys. It basically maps just the <literal>g:Tex_Leader</literal> + character to a function. + </para> + </section> + <section id="Tex_Diacritics"> + <title>g:Tex_Diacritics</title> + <informaltable frame="all"> + <tgroup cols="2"> + <tbody> + <row><entry>Type</entry><entry>Boolean</entry></row> + <row><entry>Default Value</entry> <entry><literal>0</literal></entry></row> + </tbody> + </tgroup> + </informaltable> + <para> + Whether or not you want to use <link + linkend="diacritic-mappings">diacritics</link>. + </para> + </section> + <section id="Tex_Leader"> + <title>g:Tex_Leader</title> + <informaltable frame="all"> + <tgroup cols="2"> + <tbody> + <row><entry>Type</entry><entry>String</entry></row> + <row><entry>Default Value</entry> + <entry><literal>'`'</literal></entry></row> + </tbody> + </tgroup> + </informaltable> + <para> + The mappings in &ls; are by default prefixed with the back-tick + character. For example, <literal>`/</literal> inserts + <literal>\frac{&ph;}{&ph;}&ph;</literal> etc. You can change the + prefix with the following setting. + <literal>','</literal>, <literal>'/'</literal>, + <literal>'`'</literal> are preferred values. <literal>''</literal> or + <literal>'\'</literal> will lead to a <emphasis>lot</emphasis> of + trouble. + </para> + <para> + g:Tex_Leader is also used for visual mode mappings for fonts. + </para> + </section> + <section id="Tex_Leader2"> + <title>g:Tex_Leader2</title> + <informaltable frame="all"> + <tgroup cols="2"> + <tbody> + <row><entry>Type</entry><entry>String</entry></row> + <row><entry>Default Value</entry> + <entry><literal>','</literal></entry></row> + </tbody> + </tgroup> + </informaltable> + <para> + In order to avoid clashes between the large number of visual mode macros + provided, the <link linkend="enclosing-env-threeletter">visual mode + macros for environments</link> and sections start with a character + different from <literal>g:Tex_Leader</literal>. + </para> + </section> + <section id="Tex_PromptedEnvironments"> + <title>g:Tex_PromptedEnvironments</title> + <informaltable frame="all"> + <tgroup cols="2"> + <tbody> + <row><entry>Type</entry><entry>String</entry></row> + <row><entry>Default Value</entry> <entry><literal>'eqnarray*,eqnarray,equation,equation*,\[,$$,align,align*'</literal></entry></row> + </tbody> + </tgroup> + </informaltable> + <para> + This string represents a comma separated list of fields corresponding to + environments. Pressing <literal>&lt;F5&gt;</literal> in insert-mode in + the body of the document asks you to choose from one of these + environments to insert. + </para> + <para> + Leaving this string empty will leave the <literal>&lt;F5&gt;</literal> + key unmapped + </para> + </section> + <section id="Tex_HotKeyMappings"> + <title>g:Tex_HotKeyMappings</title> + <informaltable frame="all"> + <tgroup cols="2"> + <tbody> + <row><entry>Type</entry><entry>String</entry></row> + <row><entry>Default Value</entry> + <entry><literal>'eqnarray*,eqnarray,bmatrix'</literal></entry></row> + </tbody> + </tgroup> + </informaltable> + <para> + This string represents a comma separated list of environments which are + mapped to <literal>&lt;Shift-F-1&gt;</literal> through + <literal>&lt;Shift-F-4&gt;</literal>. For example, pressing + <literal>&lt;Shift-F-2&gt;</literal> with this setting inserts the + <literal>eqnarray</literal> environment. + </para> + <para> + Leaving this string empty will leave <literal>&lt;Shift-F-1&gt;</literal> through + <literal>&lt;Shift-F-4&gt;</literal> unmapped. + </para> + <note> + <para> + Only the first four fields of this list are used. The rest are silently + ignored. + </para> + </note> + </section> + <section id="Tex_PromptedCommands"> + <title>g:Tex_PromptedCommands</title> + <informaltable frame="all"> + <tgroup cols="2"> + <tbody> + <row><entry>Type</entry><entry>String</entry></row> + <row><entry>Default Value</entry> + <entry> + <literal>'footnote,cite,pageref,label'</literal> + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + <para> + This string represents a comma separated list of &latex; commands + which &ls; uses for the <literal>&lt;F7&gt;</literal> and + <literal>&lt;S-F7&gt;</literal> maps as described <link + linkend="latex-command-maps">here</link>. + </para> + <para> + Leaving this string empty will leave the <literal>&lt;F7&gt;</literal> + key unmapped. + </para> + </section> + <section id="Tex_ItemStyle_environment"> + <title>Tex_ItemStyle_environment</title> + <para> + This setting affects the style which &ls; uses to insert an + <literal>\item</literal> when <literal>&lt;Alt-I&gt;</literal> is + pressed as described <link linkend="Alt-I">here</link>. By default + &ls; defines styles for the following environments: + </para> + <informaltable frame="all"> + <tgroup cols="2"> + <thead> + <row> + <entry>Environment</entry> + <entry>Style</entry> + </row> + </thead> + <tbody> + <row><entry>itemize</entry><entry>\item </entry></row> + <row><entry>enumerate</entry><entry>\item </entry></row> + <row><entry>theindex</entry><entry>\item </entry></row> + <row><entry>thebibliography</entry><entry>\item[&lt;+biblabel+&gt;]{&lt;+bibkey+&gt;} &lt;++&gt;</entry></row> + <row><entry>description</entry><entry>\item[&lt;+label+&gt;] &lt;++&gt;</entry></row> + </tbody> + </tgroup> + </informaltable> + <para> + Each style is defined by a variable of the form + <literal>g:Tex_ItemStyle_{envname}</literal> where + <literal>envname</literal> is the name of the environment for which + the style is defined. For example, by default + <programlisting>g:Tex_ItemStyle_description = '\item[&lt;+label+&gt;] &lt;++&gt;'</programlisting> + Redefining the style for a particular environment or defining a style + for an entirely new environment is simply a matter of setting the + value of a variable of the corresponding name. + </para> + </section> + </section> + <section id="customizing-smart-keys"> + <title>Smart Key Customization</title> + <para> + These settings affect the smart key functionality as described <link + linkend="smart-keys">here</link>. + </para> + <section id="Tex_SmartKeyBS"> + <title>g:Tex_SmartKeyBS</title> + <informaltable frame="all"> + <tgroup cols="2"> + <tbody> + <row><entry>Type</entry><entry>Boolean</entry></row> + <row><entry>Default Value</entry> + <entry><literal>1</literal></entry></row> + </tbody> + </tgroup> + </informaltable> + <para> + Whether or not <literal>&lt;Backspace&gt;</literal> deletes diacritics. + </para> + </section> + <section id="Tex_SmartKeyQuote"> + <title>g:Tex_SmartKeyQuote</title> + <informaltable frame="all"> + <tgroup cols="2"> + <tbody> + <row><entry>Type</entry><entry>Boolean</entry></row> + <row><entry>Default Value</entry> + <entry><literal>1</literal></entry></row> + </tbody> + </tgroup> + </informaltable> + <para> + Whether or not the <link linkend="smart-keys">smart quotes</link> + functionality is available. + </para> + <para> + If enabled, the quote characters can be customized by setting the + following variables: + </para> + <informaltable frame="all"> + <tgroup cols="2"> + <thead> + <row> + <entry>Setting</entry> + <entry>Value</entry> + </row> + </thead> + <tbody> + <row> + <entry><literal>g:Tex_SmartQuoteOpen</literal></entry> + <entry><literal>"``"</literal></entry> + </row> + <row> + <entry><literal>g:Tex_SmartQuoteClose</literal></entry> + <entry><literal>"''"</literal></entry> + </row> + </tbody> + </tgroup> + </informaltable> + <para> + Non-English users will want to change these settings to their locale. + These global variables will be ignored if there are buffer-local + variables (with the same name), which may be set in the language specific + package files, such as + <literal>$VIM/ftplugin/latex-suite/packages/german</literal>. + </para> + </section> + </section> + <section id="customizing-latex-completion"> + <title>Latex Completion Customization</title> + <para> + The following settings affect the <link linkend="latex-completion"> + completion</link> functionality in &ls;. + </para> + <section id="completion-window-preferences"> + <title>Window size settings</title> + <para> + These three settings affect the aesthetics of the completion + functionality. + </para> + <anchor id="Tex_ViewerCwindowHeight" /> + <anchor id="Tex_ViewerPreviewHeight" /> + <anchor id="Tex_ExplorerHeight" /> + <anchor id="Tex_ImageDir" /> + <informaltable frame="all"> + <tgroup cols="3"> + <thead> + <row> + <entry>Setting</entry> + <entry>Explanation</entry> + <entry>Default Value</entry> + </row> + </thead> + <tbody> + <row> + <entry><literal>g:Tex_ViewerCwindowHeight</literal></entry> + <entry>The height of the <literal>cwindow</literal> which displays the + list of <literal>\label</literal>s etc.</entry> + <entry>5</entry> + </row> + <row> + <entry><literal>g:Tex_ViewerPreviewHeight</literal></entry> + <entry>The height of the preview window which shows the context of a + <literal>\label</literal> etc.</entry> + <entry>10 </entry> + </row> + <row> + <entry><literal>g:Tex_ExplorerHeight</literal></entry> + <entry>The height of the explorer window which lists the files from + which to choose an image file.</entry> + <entry>10</entry> + </row> + <row> + <entry><literal>g:Tex_ImageDir</literal></entry> + <entry>The directory to scan for images</entry> + <entry>''</entry> + </row> + </tbody> + </tgroup> + </informaltable> + </section> + <section id="Tex_BIBINPUTS"> + <title>g:Tex_BIBINPUTS</title> + <informaltable frame="all"> + <tgroup cols="2"> + <tbody> + <row><entry>Type</entry><entry>string</entry></row> + <row><entry>Default Value</entry> + <entry><literal>''</literal></entry></row> + </tbody> + </tgroup> + </informaltable> + <para> + This string describes the directories which are scanned while trying + to search for <literal>.bib</literal> and <literal>.bbl</literal> + files. See the <link linkend="latex-completion-cite">cite completion + section</link> for more details. + </para> + <para> + This string should be set in the syntax accepted by &vim;'s native + <literal>'path'</literal> setting. Do not include the present + directory <literal>'.'</literal>. While searching for + <literal>bibliography</literal> files, the present directory will be + prepended to this variable. + </para> + </section> + <section id="Tex_UseSimpleLabelSearch"> + <title>Tex_UseSimpleLabelSearch</title> + <para> + When set to 1, &ls; searches for <literal>\label</literal>s in all + <literal>.tex</literal> files in the directory containing the file + being edited when &lt;F9&gt; is pressed. See <link + linkend="ls-completion-ref">\ref completion</link> for details. + </para> + </section> + <section id="Tex_ProjectSourceFiles"> + <title>g:Tex_ProjectSourceFiles</title> + <informaltable frame="all"> + <tgroup cols="2"> + <tbody> + <row><entry>Type</entry><entry>String</entry></row> + <row><entry>Default Value</entry> + <entry><literal>''</literal></entry></row> + </tbody> + </tgroup> + </informaltable> + <para> + This setting is meant to be initialized on a per-project basis using + the <link linkend="latex-master-file">&ls; master file</link> as + described in <link linkend="latex-project">&ls; Project</link> + section. It is a list of source files which are used in the project. + If defined, then instead of using the logic described in + <link + linkend="Tex_UseSimpleLabelSearch">Tex_UseSimpleLabelSearch</link> to + search for files in which to search for <literal>\label</literal>s, we + simply search for <literal>\label</literal>s in this list. This + significantly reduces the time it takes to generate the list of + possible completions for large projects. + </para> + <para> + The list is specified as a whitespace separated list of filenames + relative to the location of the main file. + </para> + </section> + <section id="Tex_RememberCiteSearch"> + <title>g:Tex_RememberCiteSearch</title> + <informaltable frame="all"> + <tgroup cols="2"> + <tbody> + <row><entry>Type</entry><entry>Boolean</entry></row> + <row><entry>Default Value</entry> + <entry><literal>0</literal></entry></row> + </tbody> + </tgroup> + </informaltable> + <para> + When this variable is non-zero, then &ls; will try to remember results + from the <literal>\cite</literal> completion as described in <link + linkend="cite-search-caching">this section</link>. + </para> + </section> + </section> + <section id="customizing-compiling"> + <title>Compiler Customization</title> + <para> + The following settings affect &ls;'s compilation functionality + </para> + <section id="Tex_DefaultTargetFormat"> + <title>g:Tex_DefaultTargetFormat</title> + <informaltable frame="all"> + <tgroup cols="2"> + <tbody> + <row><entry>Type</entry><entry>String</entry></row> + <row><entry>Default Value</entry> + <entry><literal>dvi</literal> for windows/*nix and + <literal>pdf</literal> for mac</entry></row> + </tbody> + </tgroup> + </informaltable> + <para> + Use this setting to choose the default target format. For example, + setting this to <literal>pdf</literal> makes &ls; compile a pdf file + when you press <literal>\ll</literal> and fire up the + <literal>pdf</literal> viewer on pressing <literal>\lv</literal>. Make + sure that a rules for compiling and viewing have been defined for this + target format as described <link + linkend="Tex_CompileRule_format">here</link> and <link + linkend="Tex_ViewRule_format">here</link>. + </para> + </section> + <section id="Tex_CompileRule_format"> + <title>g:Tex_CompileRule_&lt;format&gt;</title> + <para> + Here <literal>&lt;format&gt;</literal> refers to the target format for + which this rule is defined. &ls; supports compiling into + <literal>dvi</literal>, <literal>ps</literal> and <literal>pdf</literal> + by default. All these rules are strings defined by default as follows: + </para> + <informaltable frame="all"> + <tgroup cols="2"> + <tbody> + <row> + <entry><literal>g:Tex_CompileRule_dvi</literal></entry> + <entry><literal>'latex -interaction=nonstopmode $*'</literal></entry> + </row> + <row> + <entry><literal>g:Tex_CompileRule_ps</literal></entry> + <entry><literal>'ps2pdf $*'</literal></entry> + </row> + <row> + <entry><literal>g:Tex_CompileRule_pdf</literal></entry> + <entry><literal>'pdflatex -interaction=nonstopmode $*'</literal></entry> + </row> + </tbody> + </tgroup> + </informaltable> + <para> + If you desire forward and inverse searching via &ls;, you will need to + change <literal>g:Tex_CompileRule_dvi</literal> to include + <literal>-src-specials</literal>. However, this has been known to cause + problems with the output file. Therefore, use this with care. + </para> + </section> + <section fd="Tex_FormatDependency_format"> + <title>g:Tex_FormatDependency_&lt;format&gt;</title> + <para> + <informaltable frame="all"> + <tgroup cols="2"> + <tbody> + <row><entry>Type</entry><entry>string</entry></row> + <row><entry>Default Value</entry> + <entry><literal>''</literal></entry></row> + </tbody> + </tgroup> + </informaltable> + By default, there are no format dependencies defined. Each definition + is of the form above where <literal>&lt;format&gt;</literal> is a + string such as <literal>'dvi'</literal> etc. + </para> + <para> + The value of each string is a comma separated string such as 'dvi,ps'. + See the <link linkend="compiler-dependency">Compiler dependency</link> + section to see how to use/specify this setting + </para> + </section> + <section id="Tex_MultipleCompileFormats"> + <title>g:Tex_MultipleCompileFormats</title> + <para> + <informaltable frame="all"> + <tgroup cols="2"> + <tbody> + <row><entry>Type</entry><entry>string</entry></row> + <row><entry>Default Value</entry> + <entry><literal>'dvi'</literal></entry></row> + </tbody> + </tgroup> + </informaltable> + </para> + <para> + This is a comma separated string of formats for which the compiler + needs to be called multiple times in order to get cross-references, + citations etc right. See the <link + linkend="compiling-multiple">Compiling multiple times</link> section + for details. + </para> + </section> + <section id="Tex_IgnoredWarnings"> + <title>g:Tex_IgnoredWarnings</title> + <informaltable frame="all"> + <tgroup cols="2"> + <tbody> + <row><entry>Type</entry><entry>String</entry></row> + <row><entry>Default Value</entry> + <entry><literal>a new-line separated list of patterns as described + below</literal></entry></row> + </tbody> + </tgroup> + </informaltable> + <para> + The default value of this setting is + <programlisting>\"Underfull\n". +\"Overfull\n". +\"specifier changed to\n". +\"You have requested\n". +\"Missing number, treated as zero.\n". +\"There were undefined references\n" +\"Citation %.%# undefined"</programlisting> + This setting defines a set of patterns which will be filtered out when + displaying the output from the latex compiler. This is to aid in + filtering out very common warnings/errors. + </para> + <note> + <para> + Remember to check the value of <link + linkend="Tex_IgnoreLevel"><literal>g:Tex_IgnoreLevel</literal></link> + when you change this setting. For example, if you append a new pattern + which you would like to ignore by default, increase the value of + <literal>g:Tex_IgnoreLevel</literal>. + </para> + </note> + </section> + <section id="Tex_IgnoreLevel"> + <title>g:Tex_IgnoreLevel</title> + <informaltable frame="all"> + <tgroup cols="2"> + <tbody> + <row><entry>Type</entry><entry>Integer</entry></row> + <row><entry>Default Value</entry> + <entry><literal>7</literal></entry></row> + </tbody> + </tgroup> + </informaltable> + <para> + This setting defines a "filter level" or an "ignore level". A value of 7 + for instance means that any warning/error matching with any of the first + 7 fields of <link + linkend="Tex_IgnoredWarnings"><literal>g:Tex_IgnoredWarnings</literal></link> + will be ignored. Setting this value to zero will mean that no + error/warning is ignored. However, even with a value of zero, &ls; will + filter out most of the text which a &latex; compiler typically produces. + Use + <programlisting>TCLevel strict</programlisting> + from within &vim; in order to see all the lines from the compiler's + output. + </para> + </section> + <section id="Tex_UseMakefile"> + <title>Tex_UseMakefile</title> + <para> + <informaltable frame="all"> + <tgroup cols="2"> + <tbody> + <row><entry>Type</entry><entry>boolean</entry></row> + <row><entry>Default Value</entry> + <entry><literal>1</literal></entry></row> + </tbody> + </tgroup> + </informaltable> + <para> + When set to 1, then if a <literal>makefile</literal> or + <literal>Makefile</literal> is present in the current directory, then + &ls; sets the <literal>makeprg</literal> option to just + <literal>"make &lt;target&gt;"</literal>, where + <literal>&lt;target&gt;</literal> is the target format chosen using + the <literal>TCTarget</literal> or <literal>TTarget</literal> + commands. + </para> + <para> + When set to 0, then &ls; will set the <literal>makeprg</literal> + setting to whatever is defined by the <link + linkend="Tex_CompileRule_format">g:Tex_CompileRule_target</link> + setting. + </para> + </para> + </section> + <section id="Tex_GotoError"> + <title>g:Tex_GotoError</title> + <informaltable frame="all"> + <tgroup cols="2"> + <tbody> + <row><entry>Type</entry><entry>boolean</entry></row> + <row><entry>Default Value</entry> + <entry><literal>1</literal></entry></row> + </tbody> + </tgroup> + </informaltable> + <para> + If set to 1, then pressing <literal>\ll</literal> will take you to + the location of the first warning/error, otherwise you will remain in + the original location but the errors/warnings will be listed in the + preview window. + </para> + </section> + </section> + <section id="customizing-viewing"> + <title>Viewer Customization</title> + <para> + The following settings affect how &ls; will display compiled files. + </para> + <section id="Tex_ViewRule_format"> + <title>g:Tex_ViewRule_&lt;format&gt;</title> + <para> + Here <literal>&lt;format&gt;</literal> refers to a format such as + <literal>dvi</literal>, <literal>ps</literal>, etc. This variable defines + the program which will be called to display a file of that format. + </para> + <para> + By default, &ls; defines viewer programs for viewing DVI, PS and PDF + formats as follows: + </para> + <informaltable frame="all"> + <tgroup cols="3"> + <thead> + <row> + <entry></entry> + <entry>Windows</entry> + <entry>Unix</entry> + </row> + </thead> + <tbody> + <row> + <entry><literal>g:Tex_ViewRule_dvi</literal></entry> + <entry><literal>'yap -1'</literal></entry> + <entry><literal>'xdvi'</literal></entry> + </row> + <row> + <entry><literal>g:Tex_ViewRule_ps</literal></entry> + <entry><literal>'gsview32'</literal></entry> + <entry><literal>'ghostview'</literal></entry> + </row> + <row> + <entry><literal>g:Tex_ViewRule_pdf</literal></entry> + <entry><literal>'AcroRd32'</literal></entry> + <entry><literal>'xpdf'</literal></entry> + </row> + </tbody> + </tgroup> + </informaltable> + <para> + For Macintosh systems, these strings are left empty by default. This lets + the system pick the program for each format. If you define these variables + for Mac, the system choice will be over-ridden. + </para> + <para> + &ls; appends <literal>file.format</literal> to the above settings + while calling the external programs. For example, with + <programlisting>let g:Tex_ViewRule_dvi = 'yap -1'</programlisting> + <literal>yap</literal> is called as + <programlisting>!start yap -1 file.dvi</programlisting> from within + &vim;. (The initial <literal>start</literal> is used on + <literal>Windows</literal> platforms is to make <literal>yap</literal> + start as a separate process.) If you find the way &ls; constructs the + command line too restrictive, you can use the <link + linkend="Tex_ViewRuleComplete_format"><literal>Tex_ViewRuleComplete_format</literal></link> + setting for more complete control on how the command line is + constructed while calling the external program for viewing. + </para> + <note> + <para> + For windows, you will need to set the <literal>$PATH</literal> variable + to include the paths to <literal>yap</literal>, + <literal>AcroRd32</literal>, <literal>gsview32</literal> and any other + programs. See your system documentation for how to do this. + </para> + </note> + <note> + <title>Default Viewing Format</title> + <para> + To change the default format for viewing files, set the <link + linkend="Tex_DefaultTargetFormat">g:Tex_DefaultTargetFormat</link> + variable. + </para> + </note> + </section> + <section id="Tex_ViewRuleComplete_format"> + <title>Tex_ViewRuleComplete_&lt;format&gt;</title> + <para> + Here <literal>&lt;format&gt;</literal> refers to the extension of a + output format such as <literal>dvi</literal>, <literal>html</literal> + etc. + </para> + <para> + <literal>Tex_ViewRuleComplete_format</literal> takes precedence over + <literal>Tex_ViewRule_format</literal> if both are specified. By + default, &ls; does not define values for + <literal>Tex_ViewRuleComplete_format</literal> for any + <literal>format</literal>. Unlike in the case of + <literal>Tex_ViewRule_format</literal>, &ls; does not modify + <literal>Tex_ViewRuleComplete_format</literal> at all in constructing + the command line. The only modification is to substitute + <literal>'$*'</literal> everywhere in the string with the name of the + file being viewed (without the extension). + </para> + <note> + <title>IMPORTANT</title> + <para> + Make sure you make the process go into the background otherwise vim + will wait for the viewer to terminate before letting you edit the file + again. + </para> + <para> + To make a process go into the background on a <literal>*nix</literal> + platform, use a trailing <literal>&amp;</literal> in the setting. On + <literal>Windows</literal>, use <literal>start</literal> at the + beginning of the setting. Example: Suppose you have a latex->html + converter which converts a file say foo.tex to a file foo/index.html. + Then you would use: + <programlisting>" On *nix platform +let g:Tex_ViewRuleComplete_html = 'MozillaFirebird $*/index.html &amp;' +" On windows platform +let g:Tex_ViewRuleComplete_html = 'start MozillaFirebird $*/index.html'</programlisting> + </para> + </note> + </section> + </section> + <section id="customizing-menus"> + <title>Menu Customization</title> + <para> + In addition to using the variables defined in this section to affect + the menu-layout permanently (i.e, the layout &ls; will start with), you + can also use the <literal>TeX-Suite > Configure Menu</literal> menu to + dynamically configure the menu layout after &ls; has started. + </para> + <section id="Tex_Menus"> + <title>g:Tex_Menus</title> + <informaltable frame="all"> + <tgroup cols="2"> + <tbody> + <row><entry>Type</entry><entry>Boolean</entry></row> + <row><entry>Default Value</entry> + <entry><literal>1</literal></entry></row> + </tbody> + </tgroup> + </informaltable> + <para> + If set to 0, &ls; will suppress showing all menus. Useful if you mostly + work in terminals. + </para> + </section> + <section id="Tex_MainMenuLocation"> + <title><literal>g:Tex_MainMenuLocation</literal></title> + <informaltable frame="all"> + <tgroup cols="2"> + <tbody> + <row><entry>Type</entry><entry>number</entry></row> + <row><entry>Default Value</entry> + <entry><literal>80</literal></entry></row> + </tbody> + </tgroup> + </informaltable> + <para> + This setting decides the location of the first top-level &ls; + menu. You can for example shift all the menus created by &ls; + to the very end by setting this value to a large number like 990. + </para> + </section> + <section id="Tex_MathMenus"> + <title>g:Tex_MathMenus</title> + <informaltable frame="all"> + <tgroup cols="2"> + <tbody> + <row><entry>Type</entry><entry>Boolean</entry></row> + <row><entry>Default Value</entry> + <entry><literal>1</literal></entry></row> + </tbody> + </tgroup> + </informaltable> + <para> + The <literal>Tex-Math</literal> menu consists of hundreds of mathematical + symbols used in &latex;. This menu comprises about 75% of the menus. + </para> + </section> + <section id="Tex_NestElementMenus"> + <title>g:Tex_NestElementMenus</title> + <informaltable frame="all"> + <tgroup cols="2"> + <tbody> + <row><entry>Type</entry><entry>Boolean</entry></row> + <row><entry>Default Value</entry> + <entry><literal>1</literal></entry></row> + </tbody> + </tgroup> + </informaltable> + <para> + This setting controls the "compactness" of the menus. If set to 1, then the + Font, Counter and Dimensioning menus are collected together in a single + menu called <literal>Tex-Elements</literal>, otherwise, they will each get + a separate menu. + </para> + </section> + <section id="Tex_PackagesMenu"> + <title>g:Tex_PackagesMenu</title> + <informaltable frame="all"> + <tgroup cols="2"> + <tbody> + <row><entry>Type</entry><entry>Boolean</entry></row> + <row><entry>Default Value</entry> + <entry><literal>1</literal></entry></row> + </tbody> + </tgroup> + </informaltable> + <para> + Setting this to zero will stop &ls; from automatically creating the + <literal>TeX-Suite > Packages > Supported</literal> menu at startup. You + can still create the menu after startup by going to + <literal>TeX-Suite > Configure Menu</literal>. + </para> + </section> + <section id="Tex_NestPackagesMenu"> + <title>g:Tex_NestPackagesMenu</title> + <informaltable frame="all"> + <tgroup cols="2"> + <tbody> + <row><entry>Type</entry><entry>String</entry></row> + <row><entry>Default Value</entry> + <entry><literal>'TeX-'</literal></entry></row> + </tbody> + </tgroup> + </informaltable> + <para> + This string is the prefix added to all the menus created by &ls;. If you + define this variable with a dot (<literal>'.'</literal>) as the last + character, then all the menus created by &ls; will be nested under a + single master menu. For example, set this to + <literal>'&amp;LaTeX-Suite.'</literal> to nest all menus under a menu + called <literal>&amp;LaTeX-Suite</literal>. + </para> + </section> + <section id="Tex_UseUtfMenus"> + <title>g:Tex_UseUtfMenus</title> + <informaltable frame="all"> + <tgroup cols="2"> + <tbody> + <row><entry>Type</entry><entry>Boolean</entry></row> + <row><entry>Default Value</entry> + <entry><literal>0</literal></entry></row> + </tbody> + </tgroup> + </informaltable> + <para> + This setting controls whether &ls; uses utf-8 symbols to display some of + the mathematical symbols in the <literal>TeX-Math</literal> menu. It is + necessary for your system/GUI to support utf-8. Setting this to 1 has the + side-effect of setting the <literal>'encoding'</literal> option of &vim; + to 'utf-8'. + </para> + </section> + </section> + <section id="customizing-folding"> + <title>Folding Customization</title> + <para> + The following settings control the <link + linkend="latex-folding">folding</link> functionality of &ls;. + </para> + <section id="Tex_Folding"> + <title>g:Tex_Folding</title> + <informaltable frame="all"> + <tgroup cols="2"> + <tbody> + <row><entry>Type</entry><entry>Boolean</entry></row> + <row><entry>Default Value</entry> + <entry><literal>1</literal></entry></row> + </tbody> + </tgroup> + </informaltable> + <para> + Setting this to zero completely disables &ls;'s folding functionality. + However, the <literal>TexFoldTextFunction()</literal> is still available + in case you want to use another folding scheme but still want to continue + using the fold text function. + </para> + </section> + <section id="Tex_AutoFolding"> + <title>g:Tex_AutoFolding</title> + <informaltable frame="all"> + <tgroup cols="2"> + <tbody> + <row><entry>Type</entry><entry>Boolean</entry></row> + <row><entry>Default Value</entry> + <entry><literal>1</literal></entry></row> + </tbody> + </tgroup> + </informaltable> + <para> + This setting controls whether &ls; automatically creates manual folds for + a file when it is opened. You can still use the <literal>\rf</literal> + mapping to refresh/create folds even when this variable is set to zero. + </para> + </section> + </section> + <section id="customizing-packages"> + <title>Package Handling Customization</title> + <para> + These settings affect the <link linkend="custom-packages">custom + packages</link> functionality in &ls; + </para> + <section id="Tex_TEXINPUTS"> + <title>g:Tex_TEXINPUTS</title> + <informaltable frame="all"> + <tgroup cols="2"> + <tbody> + <row><entry>Type</entry><entry>string</entry></row> + <row><entry>Default Value</entry> + <entry><literal>''</literal></entry></row> + </tbody> + </tgroup> + </informaltable> + <para> + This setting describes the directories scanned by &ls; while searching + for custom user packages as described in the <link + linkend="custom-packages">custom packages</link> section. Do not + include the present directory in this setting. The present directory + is always scanned for custom packages. + </para> + <para> + This string should be set in the syntax accepted by &vim;'s native + <literal>'path'</literal> setting. + </para> + </section> + </section> + </section> + <section id="latex-suite-credits"> + <title>Credits</title> + <para> + And finally, the credits: + </para> + <informaltable frame="none"> + <tgroup cols="2"> + <tbody> + <row> + <entry>Artur R. Czechowski</entry> + <entry>maintains the BSD package of &ls;. Lots of valuable + feedback.</entry> + </row> + <row> + <entry> + Lubomir Host + </entry> + <entry> + provided the diacritics and also helped in development. + + </entry> + </row> + <row> + <entry> + Alexander Wagner + </entry> + <entry> + valuable suggestions during development. + + </entry> + </row> + <row> + <entry> + Luc Hermitte + </entry> + <entry> + his variation of Stephen Riehm's bracketing system is used + in &ls;. + + </entry> + </row> + <row> + <entry> + Gergely Kontra + </entry> + <entry> + the clever little JumpFunc() in imaps.vim is due to him. + The implementation of the templates also borrows from + mu-template.vim by him. + + </entry> + </row> + <row> + <entry> + Dimitri Antoniou + </entry> + <entry> + author of ltags and also provided the nice tip about + forward / reverse search on DVI documents. + + </entry> + </row> + <row> + <entry> + Stephen Riehm + </entry> + <entry> + the extremely helpful bracketing system is from him. + + </entry> + </row> + <row> + <entry> + Alan Schmitt + </entry> + <entry> + provided macros/folding elements. Continued feedback, + bug-reports/fixes. + + </entry> + </row> + <row> + <entry> + Hari Krishna Dara + </entry> + <entry> + for ExecMap(), the clever little function which makes + typing visual mode mappings so much easier and error-free. + + </entry> + </row> + <row> + <entry> + Alan G Isac + </entry> + <entry> + for the comprehensive BibT() function for entering bibtex + entries. + + </entry> + </row> + <row> + <entry> + Gontran Baerts + </entry> + <entry> + for libList.vim + + </entry> + </row> + <row> + <entry> + Peter Heslin + </entry> + <entry> + useful discussion and also a lot of bug fixes. + the %%fakesection in folding.vim. + + </entry> + </row> + <row> + <entry> + Zhang Lin-bo + </entry> + <entry> + lots of very useful additions to folding. The code for customizing + the folding scheme is due to him. + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + <para> + A large number of functions in &ls; come from various other people. + Some of those people might have been missed here. Each function should however + have the author's name/e-mail above it. Thats the more authoritative place to + check out who has done what. + </para> + <anchor id="latex-suite-maintainer"></anchor> + <para> + The current maintainer(s) of &ls; is(are) + </para> + <simplelist> + <member>Srinath Avadhanula &lt;srinath@fastmail.fm&gt;</member> + <member>Mikolaj Machowski &lt;mikmach@wp.pl&gt;</member> + <member>Benji Fisher &lt;benji@member.AMS.org&gt;</member> + </simplelist> + </section> +</article> + +<!-- +vim: et:sw=1:sts=4 +--> diff --git a/.vim/doc/latex-suite.xsl b/.vim/doc/latex-suite.xsl @@ -0,0 +1,24 @@ +<?xml version="1.0"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version="1.0" + xmlns="http://www.w3.org/TR/xhtml1/transitional" + exclude-result-prefixes="#default"> + + <!-- $Id: latex-suite.xsl 1036 2008-05-31 16:10:30Z tmaas $ --> + + <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"/> + + <!-- import common customizations --> + <xsl:import href="latex-suite-common.xsl"/> + + <xsl:output method="html" + encoding="ISO-8859-1" + indent="no"/> + + <!-- insert customization here --> + + <xsl:param name="section.autolabel" select="1"/> + <xsl:param name="html.stylesheet" select="'latex-suite.css'"/> + + +</xsl:stylesheet> diff --git a/.vim/doc/latex-suite/altkey-mappings.html b/.vim/doc/latex-suite/altkey-mappings.html @@ -0,0 +1,66 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>3.10 Alt Key Macros</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="Latex-Suite Reference"></link><link rel="up" href="latex-macros.html" title="3 Latex-Suite Macros"></link><link rel="prev" href="smart-keys.html" title="3.9 Smart Key Mappings"></link><link rel="next" href="custom-macros-menu.html" title="3.11 Custom Macros"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">3.10 Alt Key Macros</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="smart-keys.html">Prev</a> </td><th width="60%" align="center">3 Latex-Suite Macros</th><td width="20%" align="right"> <a accesskey="n" href="custom-macros-menu.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="3.10 Alt Key Macros"><div class="titlepage"><div><div><h3 class="title"><a id="altkey-mappings"></a>3.10 Alt Key Macros</h3></div></div></div><div class="toc"><dl><dt><span class="section"><a href="altkey-mappings.html#Alt-L">3.10.1 <code class="literal">&lt;Alt-L&gt;</code></a></span></dt><dt><span class="section"><a href="altkey-mappings.html#Alt-B">3.10.2 <code class="literal">&lt;Alt-B&gt;</code></a></span></dt><dt><span class="section"><a href="altkey-mappings.html#Alt-C">3.10.3 <code class="literal">&lt;Alt-C&gt;</code></a></span></dt><dt><span class="section"><a href="altkey-mappings.html#Alt-I">3.10.4 <code class="literal">&lt;Alt-I&gt;</code></a></span></dt></dl></div><p> + Latex-Suite utilizes a set of macros originally created by Carl Mueller in + auctex.vim to make inserting all the <code class="literal">\left ... \right</code> + stuff very easy and to also make some use of the heavily under-utilized + <code class="literal">&lt;Alt&gt;</code> key. + </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> + By default, typing <code class="literal">Alt-&lt;key&gt;</code> in Vim takes + focus to the menu bar if a menu with the hotkey + <code class="literal">&lt;key&gt;</code> exists. If in your case, there are + conflicts due to this behavior, you will need to set + </p><pre class="programlisting">set winaltkeys=no</pre><p> + in your <code class="literal">$VIM/ftplugin/tex.vim</code> in order to use these + maps. + </p></div><div class="note" title="Customizing the maps" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Customizing the maps</h3><p> + If for some reason, you wish to not map the + <code class="literal">&lt;Alt&gt;</code> keys, (some European users need to use + the <code class="literal">&lt;Alt&gt;</code> key to enter diacritics), you can + change these maps to other keys as described in the section <a class="link" href="latex-suite-maps.html#customize-alt-key-maps" title="10.1.2 Alt-Key mappings">Customizing Alt-key maps</a>. + </p></div><div class="section" title="3.10.1 &lt;Alt-L&gt;"><div class="titlepage"><div><div><h4 class="title"><a id="Alt-L"></a>3.10.1 <code class="literal">&lt;Alt-L&gt;</code></h4></div></div></div><p> + This is a polymorphic insert-mode mapping which expands to one of the + following depending on the character just before the cursor location. + </p><div class="informaltable"><table border="1"><colgroup><col width="0.5in" align="cener"></col><col width="0.5in"></col></colgroup><thead><tr><th align="cener">Character before cursor</th><th>Expansion</th></tr></thead><tbody><tr><td align="cener">(</td><td><code class="literal">\left( &lt;++&gt; \right)</code></td></tr><tr><td align="cener">[</td><td><code class="literal">\left[ &lt;++&gt; \right]</code></td></tr><tr><td align="cener">|</td><td><code class="literal">\left| &lt;++&gt; \right|</code></td></tr><tr><td align="cener">{</td><td><code class="literal">\left\{ &lt;++&gt; \right\}</code></td></tr><tr><td align="cener">&lt;</td><td><code class="literal">\langle &lt;++&gt; \rangle</code></td></tr><tr><td align="cener">q</td><td><code class="literal">\lefteqn{&lt;++&gt;}&lt;++&gt;</code></td></tr></tbody></table></div><p> + If the character before the cursor is none of the above, then it will + simply insert a <code class="literal">\label{&lt;++&gt;}&lt;++&gt;</code>. + </p></div><div class="section" title="3.10.2 &lt;Alt-B&gt;"><div class="titlepage"><div><div><h4 class="title"><a id="Alt-B"></a>3.10.2 <code class="literal">&lt;Alt-B&gt;</code></h4></div></div></div><p> + This insert-mode mapping encloses the previous character in + <code class="literal">\mathbf{}</code>. + </p></div><div class="section" title="3.10.3 &lt;Alt-C&gt;"><div class="titlepage"><div><div><h4 class="title"><a id="Alt-C"></a>3.10.3 <code class="literal">&lt;Alt-C&gt;</code></h4></div></div></div><p> + In insert mode, this key is polymorphic as follows: + </p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"> + If the previous character is a letter or number, then capitalize it and + enclose it in <code class="literal">\mathcal{}</code>. + </li><li class="listitem"> + otherwise insert <code class="literal">\cite{}</code>. + </li></ol></div><p> + In visual mode, it will simply enclose the selection in + <code class="literal">\mathcal{}</code> + </p></div><div class="section" title="3.10.4 &lt;Alt-I&gt;"><div class="titlepage"><div><div><h4 class="title"><a id="Alt-I"></a>3.10.4 <code class="literal">&lt;Alt-I&gt;</code></h4></div></div></div><p> + This mapping inserts an <code class="literal">\item</code> command at the + current cursor location depending on which environment the cursor is + enclosed in. The style of the <code class="literal">\item</code> command is + dependent on the enclosing environment. By default, + <code class="literal">&lt;Alt-I&gt;</code> has styles defined forthe following + environments: + </p><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><thead><tr><th>Environment</th><th>Style</th></tr></thead><tbody><tr><td>itemize</td><td>\item </td></tr><tr><td>enumerate</td><td>\item </td></tr><tr><td>theindex</td><td>\item </td></tr><tr><td>thebibliography</td><td>\item[&lt;+biblabel+&gt;]{&lt;+bibkey+&gt;} &lt;++&gt;</td></tr><tr><td>description</td><td>\item[&lt;+label+&gt;] &lt;++&gt;</td></tr></tbody></table></div><p> + <code class="literal">&lt;Alt-I&gt;</code> is intelligent enough to + account for nested environments. For example, + </p><pre class="programlisting">\begin{itemize} + \item first item + \item second item + \begin{description} + \item[label1] first desc + \item[label2] second + % &lt;Alt-I&gt; will insert "\item[&lt;+label+&gt;] &lt;++&gt;" if + % used here + \end{description} + \item third item + % &lt;Alt-I&gt; will insert "\item " when if used here. +\end{itemize} +% &lt;Alt-I&gt; will insert nothing ("") if used here</pre><p> + </p><p> + The style used by <code class="literal">&lt;Alt-I&gt;</code> can be customized + using the <a class="link" href="customizing-macros.html#Tex_ItemStyle_environment" title="11.3.13 Tex_ItemStyle_environment"><code class="literal">g:Tex_ItemStyle_environment</code></a> + variable. + </p></div></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="smart-keys.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="latex-macros.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="custom-macros-menu.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">3.9 Smart Key Mappings </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 3.11 Custom Macros</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite/auc-tex-mappings.html b/.vim/doc/latex-suite/auc-tex-mappings.html @@ -0,0 +1,38 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>3.6 Auc-Tex Key Bindings</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="Latex-Suite Reference"></link><link rel="up" href="latex-macros.html" title="3 Latex-Suite Macros"></link><link rel="prev" href="greek-letter-mappings.html" title="3.5 Greek Letter Mappings"></link><link rel="next" href="diacritic-mappings.html" title="3.7 Diacritics"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">3.6 Auc-Tex Key Bindings</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="greek-letter-mappings.html">Prev</a> </td><th width="60%" align="center">3 Latex-Suite Macros</th><td width="20%" align="right"> <a accesskey="n" href="diacritic-mappings.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="3.6 Auc-Tex Key Bindings"><div class="titlepage"><div><div><h3 class="title"><a id="auc-tex-mappings"></a>3.6 Auc-Tex Key Bindings</h3></div></div></div><p> + These are simple 2 key expansions for some very commonly used LaTeX + elements: + </p><pre class="programlisting">`^ Expands To \Hat{&lt;++&gt;}&lt;++&gt; +`_ expands to \bar{&lt;++&gt;}&lt;++&gt; +`6 expands to \partial +`8 expands to \infty +`/ expands to \frac{&lt;++&gt;}{&lt;++&gt;}&lt;++&gt; +`% expands to \frac{&lt;++&gt;}{&lt;++&gt;}&lt;++&gt; +`@ expands to \circ +`0 expands to ^\circ +`= expands to \equiv +`\ expands to \setminus +`. expands to \cdot +`* expands to \times +`&amp; expands to \wedge +`- expands to \bigcap +`+ expands to \bigcup +`( expands to \subset +`) expands to \supset +`&lt; expands to \le +`&gt; expands to \ge +`, expands to \nonumber +`~ expands to \tilde{&lt;++&gt;}&lt;++&gt; +`; expands to \dot{&lt;++&gt;}&lt;++&gt; +`: expands to \ddot{&lt;++&gt;}&lt;++&gt; +`2 expands to \sqrt{&lt;++&gt;}&lt;++&gt; +`| expands to \Big| +`I expands to \int_{&lt;++&gt;}^{&lt;++&gt;}&lt;++&gt;</pre><p> + (again, notice the convenient place-holders) + </p><p> + In addition the visual mode macros are provided: + </p><pre class="programlisting">`( encloses selection in \left( and \right) +`[ encloses selection in \left[ and \right] +`{ encloses selection in \left\{ and \right\} +`$ encloses selection in $$ or \[ \] depending on characterwise or + linewise selection</pre></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="greek-letter-mappings.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="latex-macros.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="diacritic-mappings.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">3.5 Greek Letter Mappings </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 3.7 Diacritics</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite/automatic-package-detection.html b/.vim/doc/latex-suite/automatic-package-detection.html @@ -0,0 +1,51 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>4.3 Automatic Package detection</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="Latex-Suite Reference"></link><link rel="up" href="latex-packages.html" title="4 Package Handling"></link><link rel="prev" href="package-actions.html" title="4.2 Actions taken for supported packages"></link><link rel="next" href="supporting-packages.html" title="4.4 Writing supporting for a package"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">4.3 Automatic Package detection</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="package-actions.html">Prev</a> </td><th width="60%" align="center">4 Package Handling</th><td width="20%" align="right"> <a accesskey="n" href="supporting-packages.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="4.3 Automatic Package detection"><div class="titlepage"><div><div><h3 class="title"><a id="automatic-package-detection"></a>4.3 Automatic Package detection</h3></div></div></div><div class="toc"><dl><dt><span class="section"><a href="automatic-package-detection.html#custom-packages">4.3.1 Custom Packages</a></span></dt></dl></div><p> + Whenever Latex-Suite begins editing a new LaTeX file, it scans it for + <code class="literal">\usepackage{name}</code> lines, and if a supported package + is found, then it will create sub-menus and add to the + <code class="literal">'dict'</code> setting as described above. + </p><p> + If a <a class="link" href="latex-master-file.html" title="9.2 Specifying which file to compile">master-file</a> has been specified, + then it will scan that file instead of the current file. See the section + <a class="link" href="automatic-package-detection.html#custom-packages" title="4.3.1 Custom Packages">Custom Packages</a> + to see which files Latex-Suite will scan in more detail. + </p><p> + For all the packages detected in this manner, Latex-Suite will take certain + actions as described in the section <a class="link" href="package-actions.html" title="4.2 Actions taken for supported packages">package support.</a>. + </p><div class="section" title="4.3.1 Custom Packages"><div class="titlepage"><div><div><h4 class="title"><a id="custom-packages"></a>4.3.1 Custom Packages</h4></div></div></div><p> + Often times, the preamble can become too long, and some people prefer + to put most of their personalization in a custom package and include + that using a <code class="literal">\usepackage</code> line. Latex-Suite tries to search + such customs package for other <code class="literal">\usepackage</code> lines, so + that supported packages included in this indirect manner can also be + used to create sub-menus, extend the <code class="literal">'dict'</code> setting + etc. The most obvious place to place such custom packages is in the + same directory as the edited file. In addition, LaTeX also supports + placing custom packages in places pointed to by the + <code class="literal">$TEXINPUTS</code> environment variable. + </p><p> + If you use the <code class="literal">$TEXINPUTS</code> variable in LaTeX, and + you wish Latex-Suite to search these custom packages for + <code class="literal">\usepackage</code> lines, then you need to initialize the + <a class="link" href="customizing-packages.html#Tex_TEXINPUTS" title="11.10.1 g:Tex_TEXINPUTS"><code class="literal">g:Tex_TEXINPUTS</code></a> + variable. + </p><p> + The <code class="literal">g:Tex_TEXINPUTS</code> variable needs to be set in the + same format which Vim uses for the <code class="literal">'path'</code> setting. + This format is explained in detail if you do + </p><pre class="programlisting">:help file-searching</pre><p> + from within Vim. + </p><p> + Therefore the value of <code class="literal">g:Tex_TEXINPUTS</code> will most + probably be different from <code class="literal">$TEXINPUTS</code> which your + native LaTeX distribution uses. + </p><p> + Example: + </p><pre class="programlisting">let g:Tex_TEXINPUTS = '~/texmf/mypackages/**,./**'</pre><p> + The <code class="literal">**</code> indicates that all directories below the + directory <code class="literal">~/texmf/mypackages</code> and + <code class="literal">./</code> are to be scanned for custom packages. + </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> + The present directory <code class="literal">'.'</code> is always searched. You + need not include that in <code class="literal">g:Tex_TEXINPUTS</code>. + </p></div></div></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="package-actions.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="latex-packages.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="supporting-packages.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">4.2 Actions taken for supported packages </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 4.4 Writing supporting for a package</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite/bibtex-bindings.html b/.vim/doc/latex-suite/bibtex-bindings.html @@ -0,0 +1,84 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>3.8 BibTeX Shortcuts</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="Latex-Suite Reference"></link><link rel="up" href="latex-macros.html" title="3 Latex-Suite Macros"></link><link rel="prev" href="diacritic-mappings.html" title="3.7 Diacritics"></link><link rel="next" href="smart-keys.html" title="3.9 Smart Key Mappings"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">3.8 BibTeX Shortcuts</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="diacritic-mappings.html">Prev</a> </td><th width="60%" align="center">3 Latex-Suite Macros</th><td width="20%" align="right"> <a accesskey="n" href="smart-keys.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="3.8 BibTeX Shortcuts"><div class="titlepage"><div><div><h3 class="title"><a id="bibtex-bindings"></a>3.8 BibTeX Shortcuts</h3></div></div></div><div class="toc"><dl><dt><span class="section"><a href="bibtex-bindings.html#adding-bib-options">3.8.1 Customizing Bib-TeX fields</a></span></dt></dl></div><p> + Latex-Suite provides an easy way of entering bibliographic entries. Four + insert-mode mappings: <code class="literal">BBB</code>, <code class="literal">BBL</code>, + <code class="literal">BBH</code> and <code class="literal">BBX</code> are provided, all of + which essentially act in the same manner. When you type any of these in + insert-mode, you will get a prompt asking you to choose a entry type + for the bibliographic entry. + </p><p> + When you choose an entry type, a bibliographic entry template will be + inserted. For example, if you choose the option + <code class="literal">'book'</code> via the map <code class="literal">BBB</code>, then + the following template will be inserted: + </p><pre class="programlisting">@BOOK{&lt;+key+&gt;, + author = {&lt;++&gt;}, + editor = {&lt;++&gt;}, + title = {&lt;++&gt;}, + publisher = {&lt;++&gt;}, + year = {&lt;++&gt;}, + otherinfo = {&lt;++&gt;} +}&lt;++&gt;</pre><p> + </p><p> + <code class="literal">&lt;+key+&gt;</code> will be highlighted in select-mode and + you can type in the bib-key. After that you can use + <code class="literal">&lt;Ctrl-J&gt;</code> to navigate to successive locations + in the template and enter new values. + </p><p> + <code class="literal">BBB</code> inserts a template with only the fields + mandatorily required for a given entry type. <code class="literal">BBL</code> + inserts a template with commonly used extra options. + <code class="literal">BBH</code> inserts a template with more options which are + not as commonly used. <code class="literal">BBX</code> inserts a template with + all the fields which the entry type supports. + </p><div class="note" title="Mnemonic" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Mnemonic</h3><p> + <code class="literal">B</code> for Bibliographic entry, <code class="literal">L</code> + for Large entry, <code class="literal">H</code> for Huge entry, and + <code class="literal">X</code> stands for all eXtras. + </p></div><div class="section" title="3.8.1 Customizing Bib-TeX fields"><div class="titlepage"><div><div><h4 class="title"><a id="adding-bib-options"></a>3.8.1 Customizing Bib-TeX fields</h4></div></div></div><p> + If you wish the <code class="literal">BBB</code> command to insert a few + additional fields in addition to the fields it creates, then you will + need to define global variables of the form + </p><pre class="programlisting">g:Bib_{type}_options</pre><p> + in you <code class="literal">$VIM/ftplugin/bib.vim</code> file, where + <code class="literal">{type}</code> is a string like + <code class="literal">'article'</code>, <code class="literal">'book'</code> etc. This + variable should contain one of the letters defined in the following + table + </p><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><thead><tr><th>Character</th><th>Field Type</th></tr></thead><tbody><tr><td>w</td><td>address</td></tr><tr><td>a</td><td>author</td></tr><tr><td>b</td><td>booktitle</td></tr><tr><td>c</td><td>chapter</td></tr><tr><td>d</td><td>edition</td></tr><tr><td>e</td><td>editor</td></tr><tr><td>h</td><td>howpublished</td></tr><tr><td>i</td><td>institution</td></tr><tr><td>k</td><td>isbn</td></tr><tr><td>j</td><td>journal</td></tr><tr><td>m</td><td>month</td></tr><tr><td>z</td><td>note</td></tr><tr><td>n</td><td>number</td></tr><tr><td>o</td><td>organization</td></tr><tr><td>p</td><td>pages</td></tr><tr><td>q</td><td>publisher</td></tr><tr><td>r</td><td>school</td></tr><tr><td>s</td><td>series</td></tr><tr><td>t</td><td>title</td></tr><tr><td>u</td><td>type</td></tr><tr><td>v</td><td>volume</td></tr><tr><td>y</td><td>year</td></tr></tbody></table></div><p> + For example, by default, choosing <code class="literal">'article'</code> via + <code class="literal">BBB</code> inserts the following template by default + </p><pre class="programlisting">@ARTICLE{&lt;+key+&gt;, + author = {&lt;++&gt;}, + title = {&lt;++&gt;}, + journal = {&lt;++&gt;}, + year = {&lt;++&gt;}, + otherinfo = {&lt;++&gt;} +}&lt;++&gt;</pre><p> + However, if <code class="literal">g:Bib_article_options</code> is defined as + <code class="literal">'mnp'</code>, then <code class="literal">'article'</code> will + insert the following template + </p><pre class="programlisting">@ARTICLE{&lt;+key+&gt;, + author = {&lt;++&gt;}, + title = {&lt;++&gt;}, + journal = {&lt;++&gt;}, + year = {&lt;++&gt;}, + month = {&lt;++&gt;}, + number = {&lt;++&gt;}, + pages = {&lt;++&gt;}, + otherinfo = {&lt;++&gt;} +}&lt;++&gt;</pre><p> + </p><p> + If you have some other fields you wish to associate with an article + which are not listed above, then you will have to use the + <code class="literal">Bib_{type}_extrafields</code> option. This is a newline + separated string of complete field names which will be included in the + template. For example, if you define + </p><pre class="programlisting">let g:Bib_article_extrafields = "crossref\nabstract"</pre><p> + then the article template will include the lines + </p><pre class="programlisting">crossref = {&lt;++&gt;}, +abstract = {&lt;++&gt;},</pre><p> + </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> + You will need to define <code class="literal">Bib_*</code> settings in your + <code class="literal">$VIMRUNTIME/ftplugin/bib.vim</code> file. + </p></div></div></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="diacritic-mappings.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="latex-macros.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="smart-keys.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">3.7 Diacritics </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 3.9 Smart Key Mappings</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite/compiler-dependency.html b/.vim/doc/latex-suite/compiler-dependency.html @@ -0,0 +1,40 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>6.2 Handling dependencies in compilation</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="Latex-Suite Reference"></link><link rel="up" href="latex-compiling.html" title="6 LaTeX Compiling"></link><link rel="prev" href="compiler-rules.html" title="6.1 Setting Compilation rules"></link><link rel="next" href="compiling-multiple.html" title="6.3 Compiling multiple times"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">6.2 Handling dependencies in compilation</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="compiler-rules.html">Prev</a> </td><th width="60%" align="center">6 LaTeX Compiling</th><td width="20%" align="right"> <a accesskey="n" href="compiling-multiple.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="6.2 Handling dependencies in compilation"><div class="titlepage"><div><div><h3 class="title"><a id="compiler-dependency"></a>6.2 Handling dependencies in compilation</h3></div></div></div><p> + Latex-Suite also handles compiling dependencies automatically via certain + rules which specify the "dependency chain" for each target format. + For example, if in your case, you use + </p><pre class="programlisting">.tex -&gt; .dvi -&gt; .ps -&gt; .pdf</pre><p> + to generate <code class="literal">pdf</code> files from <code class="literal">dvi</code> + files, then you will need to specify the following setting in your + Latex-Suite configuration (see <a class="link" href="customizing-latex-suite.html" title="11 Customizing Latex-Suite">customizing Latex-Suite</a> for where + these settings should go): + </p><pre class="programlisting"> +let g:Tex_FormatDependency_pdf = 'dvi,ps,pdf' +</pre><p> + This is a comma separated string of formats specifying the order in + which the formats to be compiled into should be chosen. With this + setting, if you set the target format to <code class="literal">pdf</code>, then + the next time you compile via the <code class="literal">\ll</code> shortcut, Latex-Suite + will first generate a <code class="literal">dvi</code> file, then use that to + generate the <code class="literal">ps</code> file and finally create the + <code class="literal">pdf</code> file from that. + </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> + If any of the intermediate formats is listed in the + <code class="literal">g:Tex_MultipleCompileFormats</code> setting as described + in the section <a class="link" href="compiling-multiple.html" title="6.3 Compiling multiple times">Compiling multiple + times</a>, then Latex-Suite might make multiple calls to the compiler to + generate the output file of that format. + </p></div><p> + Along with the <code class="literal">g:Tex_FormatDependency_{format}</code> + setting, you should ofcourse specify the rule for compiling to each of + the formats as described in the <a class="link" href="compiler-rules.html" title="6.1 Setting Compilation rules">previous + section</a>. For example, with the setting above, you could use: + </p><pre class="programlisting"> +let g:Tex_CompileRule_dvi = 'latex --interaction=nonstopmode $*' +let g:Tex_CompileRule_ps = 'dvips -Ppdf -o $*.ps $*.dvi' +let g:Tex_CompileRule_pdf = 'ps2pdf $*.ps'</pre><p> + </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> + By default, Latex-Suite does not specify any compiler dependencies. Each + target format for which a rule has been derived will be compiled + independently. + </p></div></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="compiler-rules.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="latex-compiling.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="compiling-multiple.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">6.1 Setting Compilation rules </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 6.3 Compiling multiple times</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite/compiler-output-customization.html b/.vim/doc/latex-suite/compiler-output-customization.html @@ -0,0 +1,41 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>6.4 Customizing the compiler output</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="Latex-Suite Reference"></link><link rel="up" href="latex-compiling.html" title="6 LaTeX Compiling"></link><link rel="prev" href="compiling-multiple.html" title="6.3 Compiling multiple times"></link><link rel="next" href="part-compiling.html" title="6.5 Compiling parts of a file"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">6.4 Customizing the compiler output</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="compiling-multiple.html">Prev</a> </td><th width="60%" align="center">6 LaTeX Compiling</th><td width="20%" align="right"> <a accesskey="n" href="part-compiling.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="6.4 Customizing the compiler output"><div class="titlepage"><div><div><h3 class="title"><a id="compiler-output-customization"></a>6.4 Customizing the compiler output</h3></div></div></div><p> + Most LaTeX compilers produce a very large amount of output during + compilation, most of which is not relevant to debugging type-setting + errors. The compiler plugin provided with Latex-Suite (which is an enhanced + version of the standard compiler plugin maintained by Artem Chuprina), + provides a way to filter the compiler output so that the actual + errors/warnings can be presented much more concisely. + </p><p> + The compiler plugin is set up by default to function in a "non-verbose", + "ignore-common-warnings" mode, which means that irrelevant lines from the + compiler output will be ignored and some very common warnings are also + ignored. + Latex-Suite does this via the global variable <a class="link" href="customizing-compiling.html#Tex_IgnoredWarnings" title="11.6.5 g:Tex_IgnoredWarnings"><code class="literal">g:Tex_IgnoredWarnings</code></a>. + This is a list of patterns, which can be used to filter out (or ignore) + some or the warnings and errors reported by the compiler. See the link + above for its default value. + </p><p> + Latex-Suite uses the <a class="link" href="customizing-compiling.html#Tex_IgnoreLevel" title="11.6.6 g:Tex_IgnoreLevel"><code class="literal">g:Tex_IgnoreLevel</code></a> + setting to set a default ignore level. For example, for the default + value of 4, Latex-Suite ignores warnings and errors matching the first 4 + patterns in <code class="literal">g:Tex_IgnoredWarnings</code>. + </p><p> + In addition to setting a default value of the ignore level, Latex-Suite + provides the ability to set the level dynamically, using the + <code class="literal">TCLevel</code> command. For example, if you issue the + command: + </p><pre class="programlisting">TCLevel 3</pre><p> + from within Vim, then the next time you compile the document, Latex-Suite will + ignore warnings and errors which match the first three patterns in + <code class="literal">g:Tex_IgnoredWarnings</code>. + </p><p> + When TCLevel is called with the unquoted string strict as follows: + </p><pre class="programlisting">TClevel strict</pre><p> + then Latex-Suite switches to a "verbose", "no-lines-ignored" mode which is useful + when you want to make final checks of your document and want to be careful + not to let things slip by. + </p><p> + See the explanation of the settings <a class="link" href="customizing-compiling.html#Tex_IgnoredWarnings" title="11.6.5 g:Tex_IgnoredWarnings">g:Tex_IgnoredWarnings</a> and <a class="link" href="customizing-compiling.html#Tex_IgnoreLevel" title="11.6.6 g:Tex_IgnoreLevel">g:Tex_IgnoreLevel</a> to find out how to + customize the filtering done by Latex-Suite + </p></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="compiling-multiple.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="latex-compiling.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="part-compiling.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">6.3 Compiling multiple times </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 6.5 Compiling parts of a file</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite/compiler-rules.html b/.vim/doc/latex-suite/compiler-rules.html @@ -0,0 +1,22 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>6.1 Setting Compilation rules</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="Latex-Suite Reference"></link><link rel="up" href="latex-compiling.html" title="6 LaTeX Compiling"></link><link rel="prev" href="latex-compiling.html" title="6 LaTeX Compiling"></link><link rel="next" href="compiler-dependency.html" title="6.2 Handling dependencies in compilation"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">6.1 Setting Compilation rules</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="latex-compiling.html">Prev</a> </td><th width="60%" align="center">6 LaTeX Compiling</th><td width="20%" align="right"> <a accesskey="n" href="compiler-dependency.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="6.1 Setting Compilation rules"><div class="titlepage"><div><div><h3 class="title"><a id="compiler-rules"></a>6.1 Setting Compilation rules</h3></div></div></div><p> + In order to compile LaTeX files into various formats, Latex-Suite needs to know + which external programs to call and in which way they need to be called. + This information is provided to Latex-Suite via a number of "rules". For each + format you want to compile to, you need to specify a rule. A rule is + specified by defining a variable of the form: + </p><pre class="programlisting">g:Tex_CompileRule_&lt;format&gt;</pre><p> + where <code class="literal">&lt;format&gt;</code> is a string like + <code class="literal">"pdf"</code>, <code class="literal">"dvi"</code> etc. + </p><p> + Example: By default, Latex-Suite uses the following rule for compiling LaTeX + documents into DVI. + </p><pre class="programlisting">g:Tex_CompileRule_dvi = 'latex --interaction=nonstopmode $*'</pre><p> + </p><p> + Default values are also provided for ps and pdf formats. You might want to + change these rules in texrc according to your local tex environment. + </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> + For win32 users user MikTeX, sometimes the latex compiler's output has a + bug where a single number is split across different lines. In this case, + put the included <code class="literal">vim-latex</code> file distributed with Latex-Suite. + </p></div></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="latex-compiling.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="latex-compiling.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="compiler-dependency.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">6 LaTeX Compiling </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 6.2 Handling dependencies in compilation</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite/compiling-multiple.html b/.vim/doc/latex-suite/compiling-multiple.html @@ -0,0 +1,55 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>6.3 Compiling multiple times</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="Latex-Suite Reference"></link><link rel="up" href="latex-compiling.html" title="6 LaTeX Compiling"></link><link rel="prev" href="compiler-dependency.html" title="6.2 Handling dependencies in compilation"></link><link rel="next" href="compiler-output-customization.html" title="6.4 Customizing the compiler output"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">6.3 Compiling multiple times</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="compiler-dependency.html">Prev</a> </td><th width="60%" align="center">6 LaTeX Compiling</th><td width="20%" align="right"> <a accesskey="n" href="compiler-output-customization.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="6.3 Compiling multiple times"><div class="titlepage"><div><div><h3 class="title"><a id="compiling-multiple"></a>6.3 Compiling multiple times</h3></div></div></div><p> + Most LaTeX compilers need to be re-run several times in several + commonly occurring situations in order to get a final camera ready copy. + For example, when <code class="literal">\label</code>'s change, when new + <code class="literal">\cite</code> commands are added etc. If the target format + you are compiling to requires multiple compilations, then you will + need to include the format in the + <code class="literal">g:Tex_MultipleCompileFormats</code> setting. This is a + comma separated string of formats which need multiple compilations to + be generated correctly. + </p><p> + By default, this setting contains just the <code class="literal">dvi</code> + format. If you use the <code class="literal">pdflatex</code> compiler to generate + <code class="literal">pdf</code> files, then you might want to also include + <code class="literal">pdf</code> into the above setting. + </p><p> + For every format included in the + <code class="literal">g:Tex_MultipleCompileFormats</code> setting described + above, Latex-Suite will use the following logic to generate the file. Note + that although the following description uses <code class="literal">latex</code> + to refer to the compiler, it could be some other compiler such as + <code class="literal">pdflatex</code> for generating <code class="literal">pdf</code> + output. + </p><p> + </p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">If there was a <code class="literal">.idx</code> file, then remember + its contents.</li><li class="listitem">Run <code class="literal">latex</code>.</li><li class="listitem">If the <code class="literal">.idx</code> file changed due to the latex + compiler, then run <code class="literal">makeindex</code> to redo the + <code class="literal">.ind</code> file and then remember to rerun latex. + </li><li class="listitem"><p> + If the <code class="literal">.aux</code> file generated by the latex + compiler contains a <code class="literal">\bibdata</code> line, then it + means that we are using a <code class="literal">.bib</code> file. Therefore, + run <code class="literal">bibtex</code>. + </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> + This means that we will always run <code class="literal">bibtex</code> + whenever we use the <code class="literal">\bibliography</code> command + whether or not we actually need to. At this time, Latex-Suite does not + parse the <code class="literal">.aux</code> file before and after the latex + compiler to see if we are required to rerun + <code class="literal">bibtex</code>. + </p></div></li><li class="listitem"> + If the <code class="literal">.bbl</code> file changes because of this, then + remember to rerun latex again. + </li><li class="listitem">Also, we check to see if the LaTeX compiler gives certain + standard warnings which notify that we need to compile once again. In + this case also, remember to rerun LaTeX.</li><li class="listitem">If we found we had to rerun latex, then we repeat + the steps above but not running <code class="literal">makeindex</code> or + <code class="literal">bibtex</code> again.</li></ol></div><p> + </p><p> + The LaTeX file is compiled atmost 5 times using this logic. These + steps will ensure that on most platforms/environments, you will get a + clean output with all the cross-references, citations etc correctly + labelled and ordered. + </p></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="compiler-dependency.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="latex-compiling.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="compiler-output-customization.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">6.2 Handling dependencies in compilation </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 6.4 Customizing the compiler output</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite/custom-macros-menu.html b/.vim/doc/latex-suite/custom-macros-menu.html @@ -0,0 +1,39 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>3.11 Custom Macros</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="Latex-Suite Reference"></link><link rel="up" href="latex-macros.html" title="3 Latex-Suite Macros"></link><link rel="prev" href="altkey-mappings.html" title="3.10 Alt Key Macros"></link><link rel="next" href="ls-new-macros.html" title="3.12 Making your own Macros via IMAP()"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">3.11 Custom Macros</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="altkey-mappings.html">Prev</a> </td><th width="60%" align="center">3 Latex-Suite Macros</th><td width="20%" align="right"> <a accesskey="n" href="ls-new-macros.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="3.11 Custom Macros"><div class="titlepage"><div><div><h3 class="title"><a id="custom-macros-menu"></a>3.11 Custom Macros</h3></div></div></div><p> + This functionality available via the TeX-Suite.Macros menu, provides + a way of inserting customized macros into the current file via the + menu. + </p><p> + When Latex-Suite starts up, it scans the + <code class="literal">$VIM/ftplugin/latex-suite/macros/</code> directory and + creates a menu from the files found there. Each file is considered as + a single macro. You can place your own macros in this directory, + using <a class="link" href="latex-macros.html#place-holders" title="Place Holders">placeholders</a> if wanted. + </p><p> + When you choose a macro from the menu, the corresponding file is read + into the current buffer after the current cursor position. In non-gui + mode, you can use the |TMacro| command instead of choosing from the + menu. This command takes the macro file name as an argument. When + called without arguments (preferred usage), then a list of available + macro files is displayed and the user is prompted to choose one of + them). + </p><p> + There are some other tools provided in this menu, namely: + </p><div class="informaltable"><table border="0"><colgroup><col width="0.5in"></col><col width="0.5in"></col></colgroup><tbody><tr><td>{New}</td><td> + Creates a new (unnamed) buffer in the + latex-suite/macros/ directory. Use the command + :TexMacroNew in non-gui mode. + </td></tr><tr><td>{Edit}</td><td> + Opens up the corresponding macro file for editing. Use + |:TexMacroEdit| in non-gui mode. When you try to edit {macro} + not from local directory Latex-Suite will copy it to your local + directory with suffix "-local". If local copy already exists + Latex-Suite prompt for overwriting it. + </td></tr><tr><td>{Delete}</td><td> + Deletes the corresponding macro. Use the prefixed numbers for + fast navigation of menus. Use |:TexMacroDelete| in non-gui mode. + When you choose to delete {macro} which is not in your local + directory Latex-Suite will refuse to delete it. + </td></tr><tr><td>{Redraw}</td><td> + Rescans the macros/ directories and refreshes the macros list. + </td></tr></tbody></table></div></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="altkey-mappings.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="latex-macros.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ls-new-macros.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">3.10 Alt Key Macros </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 3.12 Making your own Macros via <code class="literal">IMAP()</code></td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite/customizing-compiling.html b/.vim/doc/latex-suite/customizing-compiling.html @@ -0,0 +1,88 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>11.6 Compiler Customization</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="Latex-Suite Reference"></link><link rel="up" href="customizing-latex-suite.html" title="11 Customizing Latex-Suite"></link><link rel="prev" href="customizing-latex-completion.html" title="11.5 Latex Completion Customization"></link><link rel="next" href="customizing-viewing.html" title="11.7 Viewer Customization"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">11.6 Compiler Customization</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="customizing-latex-completion.html">Prev</a> </td><th width="60%" align="center">11 Customizing Latex-Suite</th><td width="20%" align="right"> <a accesskey="n" href="customizing-viewing.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="11.6 Compiler Customization"><div class="titlepage"><div><div><h3 class="title"><a id="customizing-compiling"></a>11.6 Compiler Customization</h3></div></div></div><div class="toc"><dl><dt><span class="section"><a href="customizing-compiling.html#Tex_DefaultTargetFormat">11.6.1 g:Tex_DefaultTargetFormat</a></span></dt><dt><span class="section"><a href="customizing-compiling.html#Tex_CompileRule_format">11.6.2 g:Tex_CompileRule_&lt;format&gt;</a></span></dt><dt><span class="section"><a href="customizing-compiling.html#id396628">11.6.3 g:Tex_FormatDependency_&lt;format&gt;</a></span></dt><dt><span class="section"><a href="customizing-compiling.html#Tex_MultipleCompileFormats">11.6.4 g:Tex_MultipleCompileFormats</a></span></dt><dt><span class="section"><a href="customizing-compiling.html#Tex_IgnoredWarnings">11.6.5 g:Tex_IgnoredWarnings</a></span></dt><dt><span class="section"><a href="customizing-compiling.html#Tex_IgnoreLevel">11.6.6 g:Tex_IgnoreLevel</a></span></dt><dt><span class="section"><a href="customizing-compiling.html#Tex_UseMakefile">11.6.7 Tex_UseMakefile</a></span></dt><dt><span class="section"><a href="customizing-compiling.html#Tex_GotoError">11.6.8 g:Tex_GotoError</a></span></dt></dl></div><p> + The following settings affect Latex-Suite's compilation functionality + </p><div class="section" title="11.6.1 g:Tex_DefaultTargetFormat"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_DefaultTargetFormat"></a>11.6.1 g:Tex_DefaultTargetFormat</h4></div></div></div><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>String</td></tr><tr><td>Default Value</td><td><code class="literal">dvi</code> for windows/*nix and + <code class="literal">pdf</code> for mac</td></tr></tbody></table></div><p> + Use this setting to choose the default target format. For example, + setting this to <code class="literal">pdf</code> makes Latex-Suite compile a pdf file + when you press <code class="literal">\ll</code> and fire up the + <code class="literal">pdf</code> viewer on pressing <code class="literal">\lv</code>. Make + sure that a rules for compiling and viewing have been defined for this + target format as described <a class="link" href="customizing-compiling.html#Tex_CompileRule_format" title="11.6.2 g:Tex_CompileRule_&lt;format&gt;">here</a> and <a class="link" href="customizing-viewing.html#Tex_ViewRule_format" title="11.7.1 g:Tex_ViewRule_&lt;format&gt;">here</a>. + </p></div><div class="section" title="11.6.2 g:Tex_CompileRule_&lt;format&gt;"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_CompileRule_format"></a>11.6.2 g:Tex_CompileRule_&lt;format&gt;</h4></div></div></div><p> + Here <code class="literal">&lt;format&gt;</code> refers to the target format for + which this rule is defined. Latex-Suite supports compiling into + <code class="literal">dvi</code>, <code class="literal">ps</code> and <code class="literal">pdf</code> + by default. All these rules are strings defined by default as follows: + </p><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td><code class="literal">g:Tex_CompileRule_dvi</code></td><td><code class="literal">'latex -interaction=nonstopmode $*'</code></td></tr><tr><td><code class="literal">g:Tex_CompileRule_ps</code></td><td><code class="literal">'ps2pdf $*'</code></td></tr><tr><td><code class="literal">g:Tex_CompileRule_pdf</code></td><td><code class="literal">'pdflatex -interaction=nonstopmode $*'</code></td></tr></tbody></table></div><p> + If you desire forward and inverse searching via Latex-Suite, you will need to + change <code class="literal">g:Tex_CompileRule_dvi</code> to include + <code class="literal">-src-specials</code>. However, this has been known to cause + problems with the output file. Therefore, use this with care. + </p></div><div class="section" title="11.6.3 g:Tex_FormatDependency_&lt;format&gt;"><div class="titlepage"><div><div><h4 class="title"><a id="id396628"></a>11.6.3 g:Tex_FormatDependency_&lt;format&gt;</h4></div></div></div><p> + </p><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>string</td></tr><tr><td>Default Value</td><td><code class="literal">''</code></td></tr></tbody></table></div><p> + By default, there are no format dependencies defined. Each definition + is of the form above where <code class="literal">&lt;format&gt;</code> is a + string such as <code class="literal">'dvi'</code> etc. + </p><p> + The value of each string is a comma separated string such as 'dvi,ps'. + See the <a class="link" href="compiler-dependency.html" title="6.2 Handling dependencies in compilation">Compiler dependency</a> + section to see how to use/specify this setting + </p></div><div class="section" title="11.6.4 g:Tex_MultipleCompileFormats"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_MultipleCompileFormats"></a>11.6.4 g:Tex_MultipleCompileFormats</h4></div></div></div><p> + </p><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>string</td></tr><tr><td>Default Value</td><td><code class="literal">'dvi'</code></td></tr></tbody></table></div><p> + </p><p> + This is a comma separated string of formats for which the compiler + needs to be called multiple times in order to get cross-references, + citations etc right. See the <a class="link" href="compiling-multiple.html" title="6.3 Compiling multiple times">Compiling multiple times</a> section + for details. + </p></div><div class="section" title="11.6.5 g:Tex_IgnoredWarnings"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_IgnoredWarnings"></a>11.6.5 g:Tex_IgnoredWarnings</h4></div></div></div><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>String</td></tr><tr><td>Default Value</td><td><code class="literal">a new-line separated list of patterns as described + below</code></td></tr></tbody></table></div><p> + The default value of this setting is + </p><pre class="programlisting">\"Underfull\n". +\"Overfull\n". +\"specifier changed to\n". +\"You have requested\n". +\"Missing number, treated as zero.\n". +\"There were undefined references\n" +\"Citation %.%# undefined"</pre><p> + This setting defines a set of patterns which will be filtered out when + displaying the output from the latex compiler. This is to aid in + filtering out very common warnings/errors. + </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> + Remember to check the value of <a class="link" href="customizing-compiling.html#Tex_IgnoreLevel" title="11.6.6 g:Tex_IgnoreLevel"><code class="literal">g:Tex_IgnoreLevel</code></a> + when you change this setting. For example, if you append a new pattern + which you would like to ignore by default, increase the value of + <code class="literal">g:Tex_IgnoreLevel</code>. + </p></div></div><div class="section" title="11.6.6 g:Tex_IgnoreLevel"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_IgnoreLevel"></a>11.6.6 g:Tex_IgnoreLevel</h4></div></div></div><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>Integer</td></tr><tr><td>Default Value</td><td><code class="literal">7</code></td></tr></tbody></table></div><p> + This setting defines a "filter level" or an "ignore level". A value of 7 + for instance means that any warning/error matching with any of the first + 7 fields of <a class="link" href="customizing-compiling.html#Tex_IgnoredWarnings" title="11.6.5 g:Tex_IgnoredWarnings"><code class="literal">g:Tex_IgnoredWarnings</code></a> + will be ignored. Setting this value to zero will mean that no + error/warning is ignored. However, even with a value of zero, Latex-Suite will + filter out most of the text which a LaTeX compiler typically produces. + Use + </p><pre class="programlisting">TCLevel strict</pre><p> + from within Vim in order to see all the lines from the compiler's + output. + </p></div><div class="section" title="11.6.7 Tex_UseMakefile"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_UseMakefile"></a>11.6.7 Tex_UseMakefile</h4></div></div></div><p> + </p><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>boolean</td></tr><tr><td>Default Value</td><td><code class="literal">1</code></td></tr></tbody></table></div><p> + </p><p> + When set to 1, then if a <code class="literal">makefile</code> or + <code class="literal">Makefile</code> is present in the current directory, then + Latex-Suite sets the <code class="literal">makeprg</code> option to just + <code class="literal">"make &lt;target&gt;"</code>, where + <code class="literal">&lt;target&gt;</code> is the target format chosen using + the <code class="literal">TCTarget</code> or <code class="literal">TTarget</code> + commands. + </p><p> + </p><p> + When set to 0, then Latex-Suite will set the <code class="literal">makeprg</code> + setting to whatever is defined by the <a class="link" href="customizing-compiling.html#Tex_CompileRule_format" title="11.6.2 g:Tex_CompileRule_&lt;format&gt;">g:Tex_CompileRule_target</a> + setting. + </p><p> + </p></div><div class="section" title="11.6.8 g:Tex_GotoError"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_GotoError"></a>11.6.8 g:Tex_GotoError</h4></div></div></div><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>boolean</td></tr><tr><td>Default Value</td><td><code class="literal">1</code></td></tr></tbody></table></div><p> + If set to 1, then pressing <code class="literal">\ll</code> will take you to + the location of the first warning/error, otherwise you will remain in + the original location but the errors/warnings will be listed in the + preview window. + </p></div></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="customizing-latex-completion.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="customizing-latex-suite.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="customizing-viewing.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">11.5 Latex Completion Customization </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 11.7 Viewer Customization</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite/customizing-folding.html b/.vim/doc/latex-suite/customizing-folding.html @@ -0,0 +1,13 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>11.9 Folding Customization</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="Latex-Suite Reference"></link><link rel="up" href="customizing-latex-suite.html" title="11 Customizing Latex-Suite"></link><link rel="prev" href="customizing-menus.html" title="11.8 Menu Customization"></link><link rel="next" href="customizing-packages.html" title="11.10 Package Handling Customization"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">11.9 Folding Customization</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="customizing-menus.html">Prev</a> </td><th width="60%" align="center">11 Customizing Latex-Suite</th><td width="20%" align="right"> <a accesskey="n" href="customizing-packages.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="11.9 Folding Customization"><div class="titlepage"><div><div><h3 class="title"><a id="customizing-folding"></a>11.9 Folding Customization</h3></div></div></div><div class="toc"><dl><dt><span class="section"><a href="customizing-folding.html#Tex_Folding">11.9.1 g:Tex_Folding</a></span></dt><dt><span class="section"><a href="customizing-folding.html#Tex_AutoFolding">11.9.2 g:Tex_AutoFolding</a></span></dt></dl></div><p> + The following settings control the <a class="link" href="latex-folding.html" title="8 Latex Folding">folding</a> functionality of Latex-Suite. + </p><div class="section" title="11.9.1 g:Tex_Folding"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_Folding"></a>11.9.1 g:Tex_Folding</h4></div></div></div><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>Boolean</td></tr><tr><td>Default Value</td><td><code class="literal">1</code></td></tr></tbody></table></div><p> + Setting this to zero completely disables Latex-Suite's folding functionality. + However, the <code class="literal">TexFoldTextFunction()</code> is still available + in case you want to use another folding scheme but still want to continue + using the fold text function. + </p></div><div class="section" title="11.9.2 g:Tex_AutoFolding"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_AutoFolding"></a>11.9.2 g:Tex_AutoFolding</h4></div></div></div><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>Boolean</td></tr><tr><td>Default Value</td><td><code class="literal">1</code></td></tr></tbody></table></div><p> + This setting controls whether Latex-Suite automatically creates manual folds for + a file when it is opened. You can still use the <code class="literal">\rf</code> + mapping to refresh/create folds even when this variable is set to zero. + </p></div></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="customizing-menus.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="customizing-latex-suite.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="customizing-packages.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">11.8 Menu Customization </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 11.10 Package Handling Customization</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite/customizing-latex-completion.html b/.vim/doc/latex-suite/customizing-latex-completion.html @@ -0,0 +1,43 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>11.5 Latex Completion Customization</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="Latex-Suite Reference"></link><link rel="up" href="customizing-latex-suite.html" title="11 Customizing Latex-Suite"></link><link rel="prev" href="customizing-smart-keys.html" title="11.4 Smart Key Customization"></link><link rel="next" href="customizing-compiling.html" title="11.6 Compiler Customization"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">11.5 Latex Completion Customization</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="customizing-smart-keys.html">Prev</a> </td><th width="60%" align="center">11 Customizing Latex-Suite</th><td width="20%" align="right"> <a accesskey="n" href="customizing-compiling.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="11.5 Latex Completion Customization"><div class="titlepage"><div><div><h3 class="title"><a id="customizing-latex-completion"></a>11.5 Latex Completion Customization</h3></div></div></div><div class="toc"><dl><dt><span class="section"><a href="customizing-latex-completion.html#completion-window-preferences">11.5.1 Window size settings</a></span></dt><dt><span class="section"><a href="customizing-latex-completion.html#Tex_BIBINPUTS">11.5.2 g:Tex_BIBINPUTS</a></span></dt><dt><span class="section"><a href="customizing-latex-completion.html#Tex_UseSimpleLabelSearch">11.5.3 Tex_UseSimpleLabelSearch</a></span></dt><dt><span class="section"><a href="customizing-latex-completion.html#Tex_ProjectSourceFiles">11.5.4 g:Tex_ProjectSourceFiles</a></span></dt><dt><span class="section"><a href="customizing-latex-completion.html#Tex_RememberCiteSearch">11.5.5 g:Tex_RememberCiteSearch</a></span></dt></dl></div><p> + The following settings affect the <a class="link" href="latex-completion.html" title="5 Latex Completion"> + completion</a> functionality in Latex-Suite. + </p><div class="section" title="11.5.1 Window size settings"><div class="titlepage"><div><div><h4 class="title"><a id="completion-window-preferences"></a>11.5.1 Window size settings</h4></div></div></div><p> + These three settings affect the aesthetics of the completion + functionality. + </p><a id="Tex_ViewerCwindowHeight"></a><a id="Tex_ViewerPreviewHeight"></a><a id="Tex_ExplorerHeight"></a><a id="Tex_ImageDir"></a><div class="informaltable"><table border="1"><colgroup><col></col><col></col><col></col></colgroup><thead><tr><th>Setting</th><th>Explanation</th><th>Default Value</th></tr></thead><tbody><tr><td><code class="literal">g:Tex_ViewerCwindowHeight</code></td><td>The height of the <code class="literal">cwindow</code> which displays the + list of <code class="literal">\label</code>s etc.</td><td>5</td></tr><tr><td><code class="literal">g:Tex_ViewerPreviewHeight</code></td><td>The height of the preview window which shows the context of a + <code class="literal">\label</code> etc.</td><td>10 </td></tr><tr><td><code class="literal">g:Tex_ExplorerHeight</code></td><td>The height of the explorer window which lists the files from + which to choose an image file.</td><td>10</td></tr><tr><td><code class="literal">g:Tex_ImageDir</code></td><td>The directory to scan for images</td><td>''</td></tr></tbody></table></div></div><div class="section" title="11.5.2 g:Tex_BIBINPUTS"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_BIBINPUTS"></a>11.5.2 g:Tex_BIBINPUTS</h4></div></div></div><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>string</td></tr><tr><td>Default Value</td><td><code class="literal">''</code></td></tr></tbody></table></div><p> + This string describes the directories which are scanned while trying + to search for <code class="literal">.bib</code> and <code class="literal">.bbl</code> + files. See the <a class="link" href="latex-completion-cite.html" title="5.3 Latex-Suite \cite completion">cite completion + section</a> for more details. + </p><p> + This string should be set in the syntax accepted by Vim's native + <code class="literal">'path'</code> setting. Do not include the present + directory <code class="literal">'.'</code>. While searching for + <code class="literal">bibliography</code> files, the present directory will be + prepended to this variable. + </p></div><div class="section" title="11.5.3 Tex_UseSimpleLabelSearch"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_UseSimpleLabelSearch"></a>11.5.3 Tex_UseSimpleLabelSearch</h4></div></div></div><p> + When set to 1, Latex-Suite searches for <code class="literal">\label</code>s in all + <code class="literal">.tex</code> files in the directory containing the file + being edited when &lt;F9&gt; is pressed. See <a class="link" href="ls-completion-ref.html" title="5.2 Latex-Suite \ref completion">\ref completion</a> for details. + </p></div><div class="section" title="11.5.4 g:Tex_ProjectSourceFiles"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_ProjectSourceFiles"></a>11.5.4 g:Tex_ProjectSourceFiles</h4></div></div></div><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>String</td></tr><tr><td>Default Value</td><td><code class="literal">''</code></td></tr></tbody></table></div><p> + This setting is meant to be initialized on a per-project basis using + the <a class="link" href="latex-master-file.html" title="9.2 Specifying which file to compile">Latex-Suite master file</a> as + described in <a class="link" href="latex-project.html" title="9 Multiple file LaTeX projects">Latex-Suite Project</a> + section. It is a list of source files which are used in the project. + If defined, then instead of using the logic described in + <a class="link" href="customizing-latex-completion.html#Tex_UseSimpleLabelSearch" title="11.5.3 Tex_UseSimpleLabelSearch">Tex_UseSimpleLabelSearch</a> to + search for files in which to search for <code class="literal">\label</code>s, we + simply search for <code class="literal">\label</code>s in this list. This + significantly reduces the time it takes to generate the list of + possible completions for large projects. + </p><p> + The list is specified as a whitespace separated list of filenames + relative to the location of the main file. + </p></div><div class="section" title="11.5.5 g:Tex_RememberCiteSearch"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_RememberCiteSearch"></a>11.5.5 g:Tex_RememberCiteSearch</h4></div></div></div><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>Boolean</td></tr><tr><td>Default Value</td><td><code class="literal">0</code></td></tr></tbody></table></div><p> + When this variable is non-zero, then Latex-Suite will try to remember results + from the <code class="literal">\cite</code> completion as described in <a class="link" href="latex-completion-cite.html#cite-search-caching" title="5.3.1 Caching the \cite completion results">this section</a>. + </p></div></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="customizing-smart-keys.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="customizing-latex-suite.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="customizing-compiling.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">11.4 Smart Key Customization </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 11.6 Compiler Customization</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite/customizing-latex-suite.html b/.vim/doc/latex-suite/customizing-latex-suite.html @@ -0,0 +1,21 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>11 Customizing Latex-Suite</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="Latex-Suite Reference"></link><link rel="up" href="index.html" title="Latex-Suite Reference"></link><link rel="prev" href="latex-suite-commands.html" title="10.2 Latex Suite Commands"></link><link rel="next" href="ls-general-purpose-settings.html" title="11.1 General Settings"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">11 Customizing Latex-Suite</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="latex-suite-commands.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="ls-general-purpose-settings.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="11 Customizing Latex-Suite"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="customizing-latex-suite"></a>11 Customizing Latex-Suite</h2></div></div></div><div class="toc"><dl><dt><span class="section"><a href="ls-general-purpose-settings.html">11.1 General Settings</a></span></dt><dt><span class="section"><a href="customizing-place-holders.html">11.2 Place-Holder Customization</a></span></dt><dt><span class="section"><a href="customizing-macros.html">11.3 Macro Customization</a></span></dt><dt><span class="section"><a href="customizing-smart-keys.html">11.4 Smart Key Customization</a></span></dt><dt><span class="section"><a href="customizing-latex-completion.html">11.5 Latex Completion Customization</a></span></dt><dt><span class="section"><a href="customizing-compiling.html">11.6 Compiler Customization</a></span></dt><dt><span class="section"><a href="customizing-viewing.html">11.7 Viewer Customization</a></span></dt><dt><span class="section"><a href="customizing-menus.html">11.8 Menu Customization</a></span></dt><dt><span class="section"><a href="customizing-folding.html">11.9 Folding Customization</a></span></dt><dt><span class="section"><a href="customizing-packages.html">11.10 Package Handling Customization</a></span></dt></dl></div><p> + Customizing Latex-Suite is done by defining certain global variables in + <code class="literal">$VIM/ftplugin/tex.vim</code>, where + <code class="literal">$VIM</code> corresponds to <code class="literal">~/.vim</code> for *nix + machines and <code class="literal">~/vimfiles</code> for windows machines. This file + is not part of the Latex-Suite distribution. You will need to create this file + yourself (or modify it if it exists) if + you need to change any default settings. Since this file is not + included as part of the Latex-Suite distribution, it will not be over-written in + subsequent updates. + </p><p> + The default settings in Latex-Suite are defined in + <code class="literal">$VIM/ftplugin/latex-suite/texrc</code>. Please take a look at + this file if you find this documentation incomplete or confusing. That file + is also well documented. + </p><p> + This chapter describes the various settings which effect Latex-Suite and their + default values. The settings are broken up into sections according to the + behavior which they influence. + </p></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="latex-suite-commands.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="ls-general-purpose-settings.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">10.2 Latex Suite Commands </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 11.1 General Settings</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite/customizing-macros.html b/.vim/doc/latex-suite/customizing-macros.html @@ -0,0 +1,140 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>11.3 Macro Customization</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="Latex-Suite Reference"></link><link rel="up" href="customizing-latex-suite.html" title="11 Customizing Latex-Suite"></link><link rel="prev" href="customizing-place-holders.html" title="11.2 Place-Holder Customization"></link><link rel="next" href="customizing-smart-keys.html" title="11.4 Smart Key Customization"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">11.3 Macro Customization</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="customizing-place-holders.html">Prev</a> </td><th width="60%" align="center">11 Customizing Latex-Suite</th><td width="20%" align="right"> <a accesskey="n" href="customizing-smart-keys.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="11.3 Macro Customization"><div class="titlepage"><div><div><h3 class="title"><a id="customizing-macros"></a>11.3 Macro Customization</h3></div></div></div><div class="toc"><dl><dt><span class="section"><a href="customizing-macros.html#Tex_Env_name">11.3.1 Tex_Env_name</a></span></dt><dt><span class="section"><a href="customizing-macros.html#Tex_Com_name">11.3.2 Tex_Com_name</a></span></dt><dt><span class="section"><a href="customizing-macros.html#macro-enabling">11.3.3 Enabling / disabling macros</a></span></dt><dt><span class="section"><a href="customizing-macros.html#Tex_UseMenuWizard">11.3.4 g:Tex_UseMenuWizard</a></span></dt><dt><span class="section"><a href="customizing-macros.html#Imap_FreezeImap">11.3.5 g:Imap_FreezeImap</a></span></dt><dt><span class="section"><a href="customizing-macros.html#Tex_CatchVisMapErrors">11.3.6 g:Tex_CatchVisMapErrors</a></span></dt><dt><span class="section"><a href="customizing-macros.html#Tex_Diacritics">11.3.7 g:Tex_Diacritics</a></span></dt><dt><span class="section"><a href="customizing-macros.html#Tex_Leader">11.3.8 g:Tex_Leader</a></span></dt><dt><span class="section"><a href="customizing-macros.html#Tex_Leader2">11.3.9 g:Tex_Leader2</a></span></dt><dt><span class="section"><a href="customizing-macros.html#Tex_PromptedEnvironments">11.3.10 g:Tex_PromptedEnvironments</a></span></dt><dt><span class="section"><a href="customizing-macros.html#Tex_HotKeyMappings">11.3.11 g:Tex_HotKeyMappings</a></span></dt><dt><span class="section"><a href="customizing-macros.html#Tex_PromptedCommands">11.3.12 g:Tex_PromptedCommands</a></span></dt><dt><span class="section"><a href="customizing-macros.html#Tex_ItemStyle_environment">11.3.13 Tex_ItemStyle_environment</a></span></dt></dl></div><div class="section" title="11.3.1 Tex_Env_name"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_Env_name"></a>11.3.1 Tex_Env_name</h4></div></div></div><p> + If you wish to wish to expand certain environments differently from + the way Latex-Suite does it, you can define custom expansions using global + variables of the form <code class="literal">Tex_Env_{name}</code> where + <code class="literal">name</code> corresponds to the environment. + </p><p> + For example, if you press <code class="literal">&lt;F5&gt;</code> after typing + <code class="literal">theorem</code>, Latex-Suite will by default expand it to + </p><pre class="programlisting">\begin{theorem} + \label{&lt;++&gt;}&lt;++&gt; +\end{theorem}&lt;++&gt;</pre><p> + However, if you wish change this to + </p><pre class="programlisting">\begin{theorem} + &lt;++&gt; +\end{theorem}&lt;++&gt;</pre><p> + then define the following variable + </p><pre class="programlisting">let g:Tex_Env_theorem = "\\begin{theorem}\&lt;CR&gt;&lt;++&gt;\&lt;CR&gt;\\end{theorem}"</pre><p> + </p><p> + If the expansion uses special keys such as carriage return etc, then + use double-quotes and use the <code class="literal">"\&lt;key&gt;"</code> + notation for special keys. Backslashes have to be doubled. + </p><p> + You could even use strings returned by functions as the expansion by + using the <a class="link" href="ls-new-macros.html#IMAP_PutTextWithMovement">IMAP_PutTextWithMovement()</a> + function. + </p><p> + If the name of the environment contains special characters (for + example, the <code class="literal">eqnarray*</code> environment), then use the + following form: + </p><pre class="programlisting">let g:Tex_Env_{'eqnarray*'} = + \ "\\begin{eqnarray*}\&lt;CR&gt;&lt;++&gt; &amp;=&amp; &lt;++&gt;\&lt;CR&gt;\\end{eqnarray*}&lt;++&gt;"</pre><p> + This will make pressing <code class="literal">&lt;F5&gt;</code> after + <code class="literal">eqnarray*</code> expand to + </p><pre class="programlisting">\begin{eqnarray*} + &lt;++&gt; &amp;=&amp; &lt;++&gt; +\end{eqnarray*}&lt;++&gt;</pre><p> + </p></div><div class="section" title="11.3.2 Tex_Com_name"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_Com_name"></a>11.3.2 Tex_Com_name</h4></div></div></div><p> + If you wish to define new expansions for fast command insertion as + described <a class="link" href="latex-command-maps.html" title="3.2 Command Mappings">here</a>, or redefine + expansions from the default values in Latex-Suite, you will need to define + variables of the form <code class="literal">g:Tex_Com_{name}</code> where + <code class="literal">name</code> is a command name. For example, with the + setting + </p><pre class="programlisting">let g:Tex_Com_frac = "\\frac{&lt;++&gt;}{&lt;++&gt;}&lt;++&gt;"</pre><p> + pressing <code class="literal">&lt;F7&gt;</code> after typing + <code class="literal">frac</code> will change it to <code class="literal">\frac{&lt;++&gt;}{&lt;++&gt;}&lt;++&gt;</code> + </p><p> + See <a class="link" href="customizing-macros.html#Tex_Env_name" title="11.3.1 Tex_Env_name">Tex_Env_name</a> for additional + details on how to create this setting in various special + circumstances. + </p></div><div class="section" title="11.3.3 Enabling / disabling macros"><div class="titlepage"><div><div><h4 class="title"><a id="macro-enabling"></a>11.3.3 Enabling / disabling macros</h4></div></div></div><p> + The following variables disable various parts of the macro functionality + of Latex-Suite. See the links to the relevant sections to see what functionality + setting each of the variables to zero will take away. + </p><a id="Tex_EnvironmentMaps"></a><a id="Tex_EnvironmentMenus"></a><a id="Tex_FontMaps"></a><a id="Tex_FontMenus"></a><a id="Tex_SectionMaps"></a><a id="Tex_SectionMenus"></a><div class="informaltable"><table border="1"><colgroup><col></col><col></col><col></col></colgroup><thead><tr><th>Setting</th><th>Link to relevant section</th><th>Default Value</th></tr></thead><tbody><tr><td><code class="literal">g:Tex_EnvironmentMaps + </code></td><td><a class="link" href="environment-mappings.html" title="3.1 Environment Mappings">Environment Mappings</a></td><td>1</td></tr><tr><td><code class="literal">g:Tex_EnvironmentMenus</code></td><td> </td><td>1</td></tr><tr><td><code class="literal">g:Tex_FontMaps </code></td><td><a class="link" href="font-maps.html" title="3.3 Font Mappings">Font Mappings</a></td><td>1</td></tr><tr><td><code class="literal">g:Tex_FontMenus </code></td><td> </td><td>1</td></tr><tr><td><code class="literal">g:Tex_SectionMaps </code></td><td><a class="link" href="section-mappings.html" title="3.4 Section Mappings">Section Mappings</a></td><td>1</td></tr><tr><td><code class="literal">g:Tex_SectionMenus </code></td><td> </td><td>1</td></tr></tbody></table></div></div><div class="section" title="11.3.4 g:Tex_UseMenuWizard"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_UseMenuWizard"></a>11.3.4 g:Tex_UseMenuWizard</h4></div></div></div><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>Boolean</td></tr><tr><td>Default Value</td><td><code class="literal">0</code></td></tr></tbody></table></div><p> + If this variable is set to 1, then when an environment is chosen from the + menu then for selected environments, Latex-Suite asks a series of + questions on the command line and inserts a template with the + corresponding fields already filled in. Setting this to zero will insert + a template with <a class="link" href="latex-macros.html#place-holders" title="Place Holders">place-holders</a> + marking off the places where fields need to be filled. + </p></div><div class="section" title="11.3.5 g:Imap_FreezeImap"><div class="titlepage"><div><div><h4 class="title"><a id="Imap_FreezeImap"></a>11.3.5 g:Imap_FreezeImap</h4></div></div></div><p> + </p><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>boolean</td></tr><tr><td>Default Value</td><td><code class="literal">0</code></td></tr></tbody></table></div><p> + </p><p> + This option when set to 1, temporarily freezes Latex-Suite's macro + expansion. It might be useful when you are using some other keymap + which is causing excessive macro expansion. Use a buffer-local + variable of the same name if you wish to affect just the present + buffer. + </p><p> + </p></div><div class="section" title="11.3.6 g:Tex_CatchVisMapErrors"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_CatchVisMapErrors"></a>11.3.6 g:Tex_CatchVisMapErrors</h4></div></div></div><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>Boolean</td></tr><tr><td>Default Value</td><td><code class="literal">1</code></td></tr></tbody></table></div><p> + With so many visual maps, its helpful to have a way of catching typing + errors made in visual mode. What this does is to prompt you to correct + your visual mode mapping if you start out with <code class="literal"><a class="link" href="customizing-macros.html#Tex_Leader" title="11.3.8 g:Tex_Leader">g:Tex_Leader</a></code> and then type some + illegal keys. It basically maps just the <code class="literal">g:Tex_Leader</code> + character to a function. + </p></div><div class="section" title="11.3.7 g:Tex_Diacritics"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_Diacritics"></a>11.3.7 g:Tex_Diacritics</h4></div></div></div><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>Boolean</td></tr><tr><td>Default Value</td><td><code class="literal">0</code></td></tr></tbody></table></div><p> + Whether or not you want to use <a class="link" href="diacritic-mappings.html" title="3.7 Diacritics">diacritics</a>. + </p></div><div class="section" title="11.3.8 g:Tex_Leader"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_Leader"></a>11.3.8 g:Tex_Leader</h4></div></div></div><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>String</td></tr><tr><td>Default Value</td><td><code class="literal">'`'</code></td></tr></tbody></table></div><p> + The mappings in Latex-Suite are by default prefixed with the back-tick + character. For example, <code class="literal">`/</code> inserts + <code class="literal">\frac{&lt;++&gt;}{&lt;++&gt;}&lt;++&gt;</code> etc. You can change the + prefix with the following setting. + <code class="literal">','</code>, <code class="literal">'/'</code>, + <code class="literal">'`'</code> are preferred values. <code class="literal">''</code> or + <code class="literal">'\'</code> will lead to a <span class="emphasis"><em>lot</em></span> of + trouble. + </p><p> + g:Tex_Leader is also used for visual mode mappings for fonts. + </p></div><div class="section" title="11.3.9 g:Tex_Leader2"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_Leader2"></a>11.3.9 g:Tex_Leader2</h4></div></div></div><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>String</td></tr><tr><td>Default Value</td><td><code class="literal">','</code></td></tr></tbody></table></div><p> + In order to avoid clashes between the large number of visual mode macros + provided, the <a class="link" href="environment-mappings.html#enclosing-env-threeletter" title="3.1.2.2 Method 2: Using three letter mappings">visual mode + macros for environments</a> and sections start with a character + different from <code class="literal">g:Tex_Leader</code>. + </p></div><div class="section" title="11.3.10 g:Tex_PromptedEnvironments"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_PromptedEnvironments"></a>11.3.10 g:Tex_PromptedEnvironments</h4></div></div></div><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>String</td></tr><tr><td>Default Value</td><td><code class="literal">'eqnarray*,eqnarray,equation,equation*,\[,$$,align,align*'</code></td></tr></tbody></table></div><p> + This string represents a comma separated list of fields corresponding to + environments. Pressing <code class="literal">&lt;F5&gt;</code> in insert-mode in + the body of the document asks you to choose from one of these + environments to insert. + </p><p> + Leaving this string empty will leave the <code class="literal">&lt;F5&gt;</code> + key unmapped + </p></div><div class="section" title="11.3.11 g:Tex_HotKeyMappings"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_HotKeyMappings"></a>11.3.11 g:Tex_HotKeyMappings</h4></div></div></div><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>String</td></tr><tr><td>Default Value</td><td><code class="literal">'eqnarray*,eqnarray,bmatrix'</code></td></tr></tbody></table></div><p> + This string represents a comma separated list of environments which are + mapped to <code class="literal">&lt;Shift-F-1&gt;</code> through + <code class="literal">&lt;Shift-F-4&gt;</code>. For example, pressing + <code class="literal">&lt;Shift-F-2&gt;</code> with this setting inserts the + <code class="literal">eqnarray</code> environment. + </p><p> + Leaving this string empty will leave <code class="literal">&lt;Shift-F-1&gt;</code> through + <code class="literal">&lt;Shift-F-4&gt;</code> unmapped. + </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> + Only the first four fields of this list are used. The rest are silently + ignored. + </p></div></div><div class="section" title="11.3.12 g:Tex_PromptedCommands"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_PromptedCommands"></a>11.3.12 g:Tex_PromptedCommands</h4></div></div></div><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>String</td></tr><tr><td>Default Value</td><td> + <code class="literal">'footnote,cite,pageref,label'</code> + </td></tr></tbody></table></div><p> + This string represents a comma separated list of LaTeX commands + which Latex-Suite uses for the <code class="literal">&lt;F7&gt;</code> and + <code class="literal">&lt;S-F7&gt;</code> maps as described <a class="link" href="latex-command-maps.html" title="3.2 Command Mappings">here</a>. + </p><p> + Leaving this string empty will leave the <code class="literal">&lt;F7&gt;</code> + key unmapped. + </p></div><div class="section" title="11.3.13 Tex_ItemStyle_environment"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_ItemStyle_environment"></a>11.3.13 Tex_ItemStyle_environment</h4></div></div></div><p> + This setting affects the style which Latex-Suite uses to insert an + <code class="literal">\item</code> when <code class="literal">&lt;Alt-I&gt;</code> is + pressed as described <a class="link" href="altkey-mappings.html#Alt-I" title="3.10.4 &lt;Alt-I&gt;">here</a>. By default + Latex-Suite defines styles for the following environments: + </p><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><thead><tr><th>Environment</th><th>Style</th></tr></thead><tbody><tr><td>itemize</td><td>\item </td></tr><tr><td>enumerate</td><td>\item </td></tr><tr><td>theindex</td><td>\item </td></tr><tr><td>thebibliography</td><td>\item[&lt;+biblabel+&gt;]{&lt;+bibkey+&gt;} &lt;++&gt;</td></tr><tr><td>description</td><td>\item[&lt;+label+&gt;] &lt;++&gt;</td></tr></tbody></table></div><p> + Each style is defined by a variable of the form + <code class="literal">g:Tex_ItemStyle_{envname}</code> where + <code class="literal">envname</code> is the name of the environment for which + the style is defined. For example, by default + </p><pre class="programlisting">g:Tex_ItemStyle_description = '\item[&lt;+label+&gt;] &lt;++&gt;'</pre><p> + Redefining the style for a particular environment or defining a style + for an entirely new environment is simply a matter of setting the + value of a variable of the corresponding name. + </p></div></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="customizing-place-holders.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="customizing-latex-suite.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="customizing-smart-keys.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">11.2 Place-Holder Customization </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 11.4 Smart Key Customization</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite/customizing-menus.html b/.vim/doc/latex-suite/customizing-menus.html @@ -0,0 +1,40 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>11.8 Menu Customization</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="Latex-Suite Reference"></link><link rel="up" href="customizing-latex-suite.html" title="11 Customizing Latex-Suite"></link><link rel="prev" href="customizing-viewing.html" title="11.7 Viewer Customization"></link><link rel="next" href="customizing-folding.html" title="11.9 Folding Customization"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">11.8 Menu Customization</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="customizing-viewing.html">Prev</a> </td><th width="60%" align="center">11 Customizing Latex-Suite</th><td width="20%" align="right"> <a accesskey="n" href="customizing-folding.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="11.8 Menu Customization"><div class="titlepage"><div><div><h3 class="title"><a id="customizing-menus"></a>11.8 Menu Customization</h3></div></div></div><div class="toc"><dl><dt><span class="section"><a href="customizing-menus.html#Tex_Menus">11.8.1 g:Tex_Menus</a></span></dt><dt><span class="section"><a href="customizing-menus.html#Tex_MainMenuLocation">11.8.2 <code class="literal">g:Tex_MainMenuLocation</code></a></span></dt><dt><span class="section"><a href="customizing-menus.html#Tex_MathMenus">11.8.3 g:Tex_MathMenus</a></span></dt><dt><span class="section"><a href="customizing-menus.html#Tex_NestElementMenus">11.8.4 g:Tex_NestElementMenus</a></span></dt><dt><span class="section"><a href="customizing-menus.html#Tex_PackagesMenu">11.8.5 g:Tex_PackagesMenu</a></span></dt><dt><span class="section"><a href="customizing-menus.html#Tex_NestPackagesMenu">11.8.6 g:Tex_NestPackagesMenu</a></span></dt><dt><span class="section"><a href="customizing-menus.html#Tex_UseUtfMenus">11.8.7 g:Tex_UseUtfMenus</a></span></dt></dl></div><p> + In addition to using the variables defined in this section to affect + the menu-layout permanently (i.e, the layout Latex-Suite will start with), you + can also use the <code class="literal">TeX-Suite &gt; Configure Menu</code> menu to + dynamically configure the menu layout after Latex-Suite has started. + </p><div class="section" title="11.8.1 g:Tex_Menus"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_Menus"></a>11.8.1 g:Tex_Menus</h4></div></div></div><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>Boolean</td></tr><tr><td>Default Value</td><td><code class="literal">1</code></td></tr></tbody></table></div><p> + If set to 0, Latex-Suite will suppress showing all menus. Useful if you mostly + work in terminals. + </p></div><div class="section" title="11.8.2 g:Tex_MainMenuLocation"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_MainMenuLocation"></a>11.8.2 <code class="literal">g:Tex_MainMenuLocation</code></h4></div></div></div><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>number</td></tr><tr><td>Default Value</td><td><code class="literal">80</code></td></tr></tbody></table></div><p> + This setting decides the location of the first top-level Latex-Suite + menu. You can for example shift all the menus created by Latex-Suite + to the very end by setting this value to a large number like 990. + </p></div><div class="section" title="11.8.3 g:Tex_MathMenus"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_MathMenus"></a>11.8.3 g:Tex_MathMenus</h4></div></div></div><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>Boolean</td></tr><tr><td>Default Value</td><td><code class="literal">1</code></td></tr></tbody></table></div><p> + The <code class="literal">Tex-Math</code> menu consists of hundreds of mathematical + symbols used in LaTeX. This menu comprises about 75% of the menus. + </p></div><div class="section" title="11.8.4 g:Tex_NestElementMenus"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_NestElementMenus"></a>11.8.4 g:Tex_NestElementMenus</h4></div></div></div><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>Boolean</td></tr><tr><td>Default Value</td><td><code class="literal">1</code></td></tr></tbody></table></div><p> + This setting controls the "compactness" of the menus. If set to 1, then the + Font, Counter and Dimensioning menus are collected together in a single + menu called <code class="literal">Tex-Elements</code>, otherwise, they will each get + a separate menu. + </p></div><div class="section" title="11.8.5 g:Tex_PackagesMenu"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_PackagesMenu"></a>11.8.5 g:Tex_PackagesMenu</h4></div></div></div><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>Boolean</td></tr><tr><td>Default Value</td><td><code class="literal">1</code></td></tr></tbody></table></div><p> + Setting this to zero will stop Latex-Suite from automatically creating the + <code class="literal">TeX-Suite &gt; Packages &gt; Supported</code> menu at startup. You + can still create the menu after startup by going to + <code class="literal">TeX-Suite &gt; Configure Menu</code>. + </p></div><div class="section" title="11.8.6 g:Tex_NestPackagesMenu"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_NestPackagesMenu"></a>11.8.6 g:Tex_NestPackagesMenu</h4></div></div></div><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>String</td></tr><tr><td>Default Value</td><td><code class="literal">'TeX-'</code></td></tr></tbody></table></div><p> + This string is the prefix added to all the menus created by Latex-Suite. If you + define this variable with a dot (<code class="literal">'.'</code>) as the last + character, then all the menus created by Latex-Suite will be nested under a + single master menu. For example, set this to + <code class="literal">'&amp;LaTeX-Suite.'</code> to nest all menus under a menu + called <code class="literal">&amp;LaTeX-Suite</code>. + </p></div><div class="section" title="11.8.7 g:Tex_UseUtfMenus"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_UseUtfMenus"></a>11.8.7 g:Tex_UseUtfMenus</h4></div></div></div><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>Boolean</td></tr><tr><td>Default Value</td><td><code class="literal">0</code></td></tr></tbody></table></div><p> + This setting controls whether Latex-Suite uses utf-8 symbols to display some of + the mathematical symbols in the <code class="literal">TeX-Math</code> menu. It is + necessary for your system/GUI to support utf-8. Setting this to 1 has the + side-effect of setting the <code class="literal">'encoding'</code> option of Vim + to 'utf-8'. + </p></div></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="customizing-viewing.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="customizing-latex-suite.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="customizing-folding.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">11.7 Viewer Customization </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 11.9 Folding Customization</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite/customizing-packages.html b/.vim/doc/latex-suite/customizing-packages.html @@ -0,0 +1,13 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>11.10 Package Handling Customization</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="Latex-Suite Reference"></link><link rel="up" href="customizing-latex-suite.html" title="11 Customizing Latex-Suite"></link><link rel="prev" href="customizing-folding.html" title="11.9 Folding Customization"></link><link rel="next" href="latex-suite-credits.html" title="12 Credits"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">11.10 Package Handling Customization</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="customizing-folding.html">Prev</a> </td><th width="60%" align="center">11 Customizing Latex-Suite</th><td width="20%" align="right"> <a accesskey="n" href="latex-suite-credits.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="11.10 Package Handling Customization"><div class="titlepage"><div><div><h3 class="title"><a id="customizing-packages"></a>11.10 Package Handling Customization</h3></div></div></div><div class="toc"><dl><dt><span class="section"><a href="customizing-packages.html#Tex_TEXINPUTS">11.10.1 g:Tex_TEXINPUTS</a></span></dt></dl></div><p> + These settings affect the <a class="link" href="automatic-package-detection.html#custom-packages" title="4.3.1 Custom Packages">custom + packages</a> functionality in Latex-Suite + </p><div class="section" title="11.10.1 g:Tex_TEXINPUTS"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_TEXINPUTS"></a>11.10.1 g:Tex_TEXINPUTS</h4></div></div></div><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>string</td></tr><tr><td>Default Value</td><td><code class="literal">''</code></td></tr></tbody></table></div><p> + This setting describes the directories scanned by Latex-Suite while searching + for custom user packages as described in the <a class="link" href="automatic-package-detection.html#custom-packages" title="4.3.1 Custom Packages">custom packages</a> section. Do not + include the present directory in this setting. The present directory + is always scanned for custom packages. + </p><p> + This string should be set in the syntax accepted by Vim's native + <code class="literal">'path'</code> setting. + </p></div></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="customizing-folding.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="customizing-latex-suite.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="latex-suite-credits.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">11.9 Folding Customization </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 12 Credits</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite/customizing-place-holders.html b/.vim/doc/latex-suite/customizing-place-holders.html @@ -0,0 +1,27 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>11.2 Place-Holder Customization</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="Latex-Suite Reference"></link><link rel="up" href="customizing-latex-suite.html" title="11 Customizing Latex-Suite"></link><link rel="prev" href="ls-general-purpose-settings.html" title="11.1 General Settings"></link><link rel="next" href="customizing-macros.html" title="11.3 Macro Customization"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">11.2 Place-Holder Customization</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ls-general-purpose-settings.html">Prev</a> </td><th width="60%" align="center">11 Customizing Latex-Suite</th><td width="20%" align="right"> <a accesskey="n" href="customizing-macros.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="11.2 Place-Holder Customization"><div class="titlepage"><div><div><h3 class="title"><a id="customizing-place-holders"></a>11.2 Place-Holder Customization</h3></div></div></div><div class="toc"><dl><dt><span class="section"><a href="customizing-place-holders.html#Imap_UsePlaceHolders">11.2.1 g:Imap_UsePlaceHolders</a></span></dt><dt><span class="section"><a href="customizing-place-holders.html#Imap_PlaceHolderStart">11.2.2 g:Imap_PlaceHolderStart &amp; g:Imap_PlaceHolderEnd</a></span></dt><dt><span class="section"><a href="customizing-place-holders.html#Imap_DeleteEmptyPlaceHolders">11.2.3 g:Imap_DeleteEmptyPlaceHolders</a></span></dt><dt><span class="section"><a href="customizing-place-holders.html#Imap_StickyPlaceHolders">11.2.4 g:Imap_StickyPlaceHolders</a></span></dt></dl></div><p> + Latex-Suite uses <a class="link" href="latex-macros.html#place-holders" title="Place Holders">place-holders</a> to minimize + using the movement keys while typing. The following settings affect how + place-holders are used. + </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> + These setting need to be set in your <code class="literal">~/.vimrc</code>, not + <code class="literal">$VIM/ftplugin/tex.vim</code> because these settings affect + the behavior of <code class="literal">imaps.vim</code>, which is a global plugin, + not a file-type plugin. + </p></div><div class="section" title="11.2.1 g:Imap_UsePlaceHolders"><div class="titlepage"><div><div><h4 class="title"><a id="Imap_UsePlaceHolders"></a>11.2.1 g:Imap_UsePlaceHolders</h4></div></div></div><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>Boolean</td></tr><tr><td>Default Value</td><td><code class="literal">1</code></td></tr></tbody></table></div><p> + Setting this to zero completely disables using place-holders. + </p></div><div class="section" title="11.2.2 g:Imap_PlaceHolderStart &amp; g:Imap_PlaceHolderEnd"><div class="titlepage"><div><div><h4 class="title"><a id="Imap_PlaceHolderStart"></a>11.2.2 g:Imap_PlaceHolderStart &amp; g:Imap_PlaceHolderEnd</h4></div></div></div><a id="Imap_PlaceHolderEnd"></a><div class="informaltable"><table border="1"><colgroup><col></col><col></col><col></col></colgroup><thead><tr><th>Setting</th><th>Type</th><th>Value</th></tr></thead><tbody><tr><td><code class="literal">Imap_PlaceHolderStart</code></td><td>String</td><td><code class="literal">'&lt;+'</code></td></tr><tr><td><code class="literal">Imap_PlaceHolderEnd</code></td><td>String</td><td><code class="literal">'+&gt;'</code></td></tr></tbody></table></div><p> + These settings affect the strings displayed at the beginning and end of + the place-holder string. Set these strings to a value different than a + commonly occurring sequence of characters. + </p><div class="note" title="TIP" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">TIP</h3><p> + If you use the <code class="literal">latin1</code> encoding and do not type in + french, then you can set these strings to the <code class="literal">\xab</code> + and <code class="literal">\xbb</code> characters (the french quotation marks). + </p></div></div><div class="section" title="11.2.3 g:Imap_DeleteEmptyPlaceHolders"><div class="titlepage"><div><div><h4 class="title"><a id="Imap_DeleteEmptyPlaceHolders"></a>11.2.3 g:Imap_DeleteEmptyPlaceHolders</h4></div></div></div><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>Boolean</td></tr><tr><td>Default Value</td><td><code class="literal">1</code></td></tr></tbody></table></div><p> + When set to one, non-descriptive or empty place-holders are deleted on + pressing <code class="literal">&lt;Ctrl-J&gt;</code>. + </p></div><div class="section" title="11.2.4 g:Imap_StickyPlaceHolders"><div class="titlepage"><div><div><h4 class="title"><a id="Imap_StickyPlaceHolders"></a>11.2.4 g:Imap_StickyPlaceHolders</h4></div></div></div><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>Boolean</td></tr><tr><td>Default Value</td><td><code class="literal">1</code></td></tr></tbody></table></div><p> + When set to 1, in visual mode, <code class="literal">&lt;Ctrl-J&gt;</code> takes + you to the next placeholder without deleting the current placeholder. + </p></div></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ls-general-purpose-settings.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="customizing-latex-suite.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="customizing-macros.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">11.1 General Settings </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 11.3 Macro Customization</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite/customizing-smart-keys.html b/.vim/doc/latex-suite/customizing-smart-keys.html @@ -0,0 +1,18 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>11.4 Smart Key Customization</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="Latex-Suite Reference"></link><link rel="up" href="customizing-latex-suite.html" title="11 Customizing Latex-Suite"></link><link rel="prev" href="customizing-macros.html" title="11.3 Macro Customization"></link><link rel="next" href="customizing-latex-completion.html" title="11.5 Latex Completion Customization"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">11.4 Smart Key Customization</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="customizing-macros.html">Prev</a> </td><th width="60%" align="center">11 Customizing Latex-Suite</th><td width="20%" align="right"> <a accesskey="n" href="customizing-latex-completion.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="11.4 Smart Key Customization"><div class="titlepage"><div><div><h3 class="title"><a id="customizing-smart-keys"></a>11.4 Smart Key Customization</h3></div></div></div><div class="toc"><dl><dt><span class="section"><a href="customizing-smart-keys.html#Tex_SmartKeyBS">11.4.1 g:Tex_SmartKeyBS</a></span></dt><dt><span class="section"><a href="customizing-smart-keys.html#Tex_SmartKeyQuote">11.4.2 g:Tex_SmartKeyQuote</a></span></dt></dl></div><p> + These settings affect the smart key functionality as described <a class="link" href="smart-keys.html" title="3.9 Smart Key Mappings">here</a>. + </p><div class="section" title="11.4.1 g:Tex_SmartKeyBS"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_SmartKeyBS"></a>11.4.1 g:Tex_SmartKeyBS</h4></div></div></div><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>Boolean</td></tr><tr><td>Default Value</td><td><code class="literal">1</code></td></tr></tbody></table></div><p> + Whether or not <code class="literal">&lt;Backspace&gt;</code> deletes diacritics. + </p></div><div class="section" title="11.4.2 g:Tex_SmartKeyQuote"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_SmartKeyQuote"></a>11.4.2 g:Tex_SmartKeyQuote</h4></div></div></div><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>Boolean</td></tr><tr><td>Default Value</td><td><code class="literal">1</code></td></tr></tbody></table></div><p> + Whether or not the <a class="link" href="smart-keys.html" title="3.9 Smart Key Mappings">smart quotes</a> + functionality is available. + </p><p> + If enabled, the quote characters can be customized by setting the + following variables: + </p><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><thead><tr><th>Setting</th><th>Value</th></tr></thead><tbody><tr><td><code class="literal">g:Tex_SmartQuoteOpen</code></td><td><code class="literal">"``"</code></td></tr><tr><td><code class="literal">g:Tex_SmartQuoteClose</code></td><td><code class="literal">"''"</code></td></tr></tbody></table></div><p> + Non-English users will want to change these settings to their locale. + These global variables will be ignored if there are buffer-local + variables (with the same name), which may be set in the language specific + package files, such as + <code class="literal">$VIM/ftplugin/latex-suite/packages/german</code>. + </p></div></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="customizing-macros.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="customizing-latex-suite.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="customizing-latex-completion.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">11.3 Macro Customization </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 11.5 Latex Completion Customization</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite/customizing-viewing.html b/.vim/doc/latex-suite/customizing-viewing.html @@ -0,0 +1,65 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>11.7 Viewer Customization</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="Latex-Suite Reference"></link><link rel="up" href="customizing-latex-suite.html" title="11 Customizing Latex-Suite"></link><link rel="prev" href="customizing-compiling.html" title="11.6 Compiler Customization"></link><link rel="next" href="customizing-menus.html" title="11.8 Menu Customization"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">11.7 Viewer Customization</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="customizing-compiling.html">Prev</a> </td><th width="60%" align="center">11 Customizing Latex-Suite</th><td width="20%" align="right"> <a accesskey="n" href="customizing-menus.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="11.7 Viewer Customization"><div class="titlepage"><div><div><h3 class="title"><a id="customizing-viewing"></a>11.7 Viewer Customization</h3></div></div></div><div class="toc"><dl><dt><span class="section"><a href="customizing-viewing.html#Tex_ViewRule_format">11.7.1 g:Tex_ViewRule_&lt;format&gt;</a></span></dt><dt><span class="section"><a href="customizing-viewing.html#Tex_ViewRuleComplete_format">11.7.2 Tex_ViewRuleComplete_&lt;format&gt;</a></span></dt></dl></div><p> + The following settings affect how Latex-Suite will display compiled files. + </p><div class="section" title="11.7.1 g:Tex_ViewRule_&lt;format&gt;"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_ViewRule_format"></a>11.7.1 g:Tex_ViewRule_&lt;format&gt;</h4></div></div></div><p> + Here <code class="literal">&lt;format&gt;</code> refers to a format such as + <code class="literal">dvi</code>, <code class="literal">ps</code>, etc. This variable defines + the program which will be called to display a file of that format. + </p><p> + By default, Latex-Suite defines viewer programs for viewing DVI, PS and PDF + formats as follows: + </p><div class="informaltable"><table border="1"><colgroup><col></col><col></col><col></col></colgroup><thead><tr><th> </th><th>Windows</th><th>Unix</th></tr></thead><tbody><tr><td><code class="literal">g:Tex_ViewRule_dvi</code></td><td><code class="literal">'yap -1'</code></td><td><code class="literal">'xdvi'</code></td></tr><tr><td><code class="literal">g:Tex_ViewRule_ps</code></td><td><code class="literal">'gsview32'</code></td><td><code class="literal">'ghostview'</code></td></tr><tr><td><code class="literal">g:Tex_ViewRule_pdf</code></td><td><code class="literal">'AcroRd32'</code></td><td><code class="literal">'xpdf'</code></td></tr></tbody></table></div><p> + For Macintosh systems, these strings are left empty by default. This lets + the system pick the program for each format. If you define these variables + for Mac, the system choice will be over-ridden. + </p><p> + Latex-Suite appends <code class="literal">file.format</code> to the above settings + while calling the external programs. For example, with + </p><pre class="programlisting">let g:Tex_ViewRule_dvi = 'yap -1'</pre><p> + <code class="literal">yap</code> is called as + </p><pre class="programlisting">!start yap -1 file.dvi</pre><p> from within + Vim. (The initial <code class="literal">start</code> is used on + <code class="literal">Windows</code> platforms is to make <code class="literal">yap</code> + start as a separate process.) If you find the way Latex-Suite constructs the + command line too restrictive, you can use the <a class="link" href="customizing-viewing.html#Tex_ViewRuleComplete_format" title="11.7.2 Tex_ViewRuleComplete_&lt;format&gt;"><code class="literal">Tex_ViewRuleComplete_format</code></a> + setting for more complete control on how the command line is + constructed while calling the external program for viewing. + </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> + For windows, you will need to set the <code class="literal">$PATH</code> variable + to include the paths to <code class="literal">yap</code>, + <code class="literal">AcroRd32</code>, <code class="literal">gsview32</code> and any other + programs. See your system documentation for how to do this. + </p></div><div class="note" title="Default Viewing Format" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Default Viewing Format</h3><p> + To change the default format for viewing files, set the <a class="link" href="customizing-compiling.html#Tex_DefaultTargetFormat" title="11.6.1 g:Tex_DefaultTargetFormat">g:Tex_DefaultTargetFormat</a> + variable. + </p></div></div><div class="section" title="11.7.2 Tex_ViewRuleComplete_&lt;format&gt;"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_ViewRuleComplete_format"></a>11.7.2 Tex_ViewRuleComplete_&lt;format&gt;</h4></div></div></div><p> + Here <code class="literal">&lt;format&gt;</code> refers to the extension of a + output format such as <code class="literal">dvi</code>, <code class="literal">html</code> + etc. + </p><p> + <code class="literal">Tex_ViewRuleComplete_format</code> takes precedence over + <code class="literal">Tex_ViewRule_format</code> if both are specified. By + default, Latex-Suite does not define values for + <code class="literal">Tex_ViewRuleComplete_format</code> for any + <code class="literal">format</code>. Unlike in the case of + <code class="literal">Tex_ViewRule_format</code>, Latex-Suite does not modify + <code class="literal">Tex_ViewRuleComplete_format</code> at all in constructing + the command line. The only modification is to substitute + <code class="literal">'$*'</code> everywhere in the string with the name of the + file being viewed (without the extension). + </p><div class="note" title="IMPORTANT" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">IMPORTANT</h3><p> + Make sure you make the process go into the background otherwise vim + will wait for the viewer to terminate before letting you edit the file + again. + </p><p> + To make a process go into the background on a <code class="literal">*nix</code> + platform, use a trailing <code class="literal">&amp;</code> in the setting. On + <code class="literal">Windows</code>, use <code class="literal">start</code> at the + beginning of the setting. Example: Suppose you have a latex-&gt;html + converter which converts a file say foo.tex to a file foo/index.html. + Then you would use: + </p><pre class="programlisting">" On *nix platform +let g:Tex_ViewRuleComplete_html = 'MozillaFirebird $*/index.html &amp;' +" On windows platform +let g:Tex_ViewRuleComplete_html = 'start MozillaFirebird $*/index.html'</pre><p> + </p></div></div></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="customizing-compiling.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="customizing-latex-suite.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="customizing-menus.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">11.6 Compiler Customization </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 11.8 Menu Customization</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite/customizing-what-to-fold.html b/.vim/doc/latex-suite/customizing-what-to-fold.html @@ -0,0 +1,129 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>8.2 Customizing what to fold</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="Latex-Suite Reference"></link><link rel="up" href="latex-folding.html" title="8 Latex Folding"></link><link rel="prev" href="default-folding.html" title="8.1 Default Folding Scheme in Latex-Suite"></link><link rel="next" href="editing-folding.html" title="8.3 Editing the folding.vim file directly"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">8.2 Customizing what to fold</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="default-folding.html">Prev</a> </td><th width="60%" align="center">8 Latex Folding</th><td width="20%" align="right"> <a accesskey="n" href="editing-folding.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="8.2 Customizing what to fold"><div class="titlepage"><div><div><h3 class="title"><a id="customizing-what-to-fold"></a>8.2 Customizing what to fold</h3></div></div></div><div class="toc"><dl><dt><span class="section"><a href="customizing-what-to-fold.html#Tex_FoldedSections">8.2.1 Tex_FoldedSections</a></span></dt><dt><span class="section"><a href="customizing-what-to-fold.html#Tex_FoldedEnvironments">8.2.2 Tex_FoldedEnvironments</a></span></dt><dt><span class="section"><a href="customizing-what-to-fold.html#Tex_FoldedCommands">8.2.3 Tex_FoldedCommands</a></span></dt><dt><span class="section"><a href="customizing-what-to-fold.html#Tex_FoldedMisc">8.2.4 Tex_FoldedMisc</a></span></dt><dt><span class="section"><a href="customizing-what-to-fold.html#fold-setting-advanced">8.2.5 Advanced Fold setting details</a></span></dt></dl></div><p> + From version 1.6 onwards, the folding in Latex-Suite can be controlled + to a large extent via a number of global variables. + </p><div class="section" title="8.2.1 Tex_FoldedSections"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_FoldedSections"></a>8.2.1 Tex_FoldedSections</h4></div></div></div><p> + This entry defines which sections will be folded. This + setting is a comma separated list of section names. + The default value is: + </p><pre class="programlisting">part,chapter,section,%%fakesection, +subsection,subsubsection,paragraph</pre><p> + Each of the entries in the list will fold up a section of the + corresponding name. The <code class="literal">%%fakesection</code> section is + provided as a means for the user to group lines into "fake" sections. + A <code class="literal">%%fakesection</code> is assumed to start on a line which + begins with the string <code class="literal">%%fakesection</code> and continue + till the start of the next <code class="literal">\section</code>, + <code class="literal">\subsection</code> or any other section. + </p><p> + See also <a class="link" href="customizing-what-to-fold.html#fold-setting-advanced" title="8.2.5 Advanced Fold setting details">advanced fold + settings</a>. + </p></div><div class="section" title="8.2.2 Tex_FoldedEnvironments"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_FoldedEnvironments"></a>8.2.2 Tex_FoldedEnvironments</h4></div></div></div><p> + This entry defines which environments will be folded. It is a + comma separated string of words each of which defines a single + environment. The default setting is + </p><pre class="programlisting">verbatim,comment,eq,gather, +align,figure,table,thebibliography, +keywords,abstract,titlepage</pre><p> + The words need not be standard Latex environments. You can + add any word you like. Also, each word will fold up all + environments whose name begins with that word. For example, in + the setting above, the word <code class="literal">"eq"</code> folds up the + <code class="literal">\begin{equation}</code>, + <code class="literal">\begin{eqnarray}</code>, + <code class="literal">\begin{eqnarray*}</code> environments. To avoid + this, you can replace the word <code class="literal">"eq"</code> with + <code class="literal">"eq}"</code>. + </p><p> + See also <a class="link" href="customizing-what-to-fold.html#fold-setting-advanced" title="8.2.5 Advanced Fold setting details">advanced fold + settings</a>. + </p></div><div class="section" title="8.2.3 Tex_FoldedCommands"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_FoldedCommands"></a>8.2.3 Tex_FoldedCommands</h4></div></div></div><p> + This entry defines which commands will be folded. It is a comma + separated string of words each of which defines a single command. + The default setting is empty, i.e no commands are folded. + The words need not be standard Latex commands. You can use whatever + words you like. Each word will fold all commands whose name begins + with that word as in the case of the <a class="link" href="customizing-what-to-fold.html#Tex_FoldedEnvironments" title="8.2.2 Tex_FoldedEnvironments">Tex_FoldedEnvironments</a> + variable. + </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> + It is very difficult to fold commands reliably because it is very + difficult to create a regexp which will match a line containing + unmatched parentheses (or curly brackets), but will not match a line + containing matched parentheses. + </p><p> + Just to make things safer, only lines which start a command but do + not contain additional curly braces after the command has started are + folded. In other words, if you wanted to fold the the command + <code class="literal">"mycommand"</code>, then the lines + </p><pre class="programlisting">\mycommand{This is a line +and some more text on the next line +}</pre><p> + will be folded, but the lines + </p><pre class="programlisting">\mycommand{This is a \textbf{line} +and some more text +}</pre><p> + will not be folded. This is a bug which is very difficult to fix. + </p></div><p> + See also <a class="link" href="customizing-what-to-fold.html#fold-setting-advanced" title="8.2.5 Advanced Fold setting details">advanced fold + settings</a>. + </p></div><div class="section" title="8.2.4 Tex_FoldedMisc"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_FoldedMisc"></a>8.2.4 Tex_FoldedMisc</h4></div></div></div><p> + This entry defines fold syntax for certain items which do not + naturally fit into the section, environment of command lists. It is a + comma separated list of words. The default value is: + </p><pre class="programlisting">item,preamble,&lt;&lt;&lt;</pre><p> + </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> + Unlike the other Tex_FoldedXXXX variables, the words in this setting + are limited to take values from the following list: + </p><p> + </p><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><thead><tr><th>Value</th><th>Meaning</th></tr></thead><tbody><tr><td>comments</td><td>Folds up contiguous blocks of comments</td></tr><tr><td>item</td><td>Folds up the <code class="literal">\item</code>s within list + environments</td></tr><tr><td>preamble</td><td>Folds up the preamble of a document. (The part between + the <code class="literal">\documentclass</code> command and the + <code class="literal">\begin{document}</code> environment)</td></tr><tr><td><code class="literal">&lt;&lt;&lt;</code></td><td>Folds defined manually by the user using the + <code class="literal">&lt;&lt;&lt;</code> and + <code class="literal">&gt;&gt;&gt;</code> strings as fold-markers.</td></tr></tbody></table></div><p> + Any other words in the <code class="literal">Tex_FoldedMisc</code> setting + are silently ignored. + </p></div><p> + </p><p> + See also <a class="link" href="customizing-what-to-fold.html#fold-setting-advanced" title="8.2.5 Advanced Fold setting details">advanced fold + settings</a>. + </p></div><div class="section" title="8.2.5 Advanced Fold setting details"><div class="titlepage"><div><div><h4 class="title"><a id="fold-setting-advanced"></a>8.2.5 Advanced Fold setting details</h4></div></div></div><p> + The order of the words in the <code class="literal">Tex_FoldedXXXX</code> + variables is <span class="emphasis"><em>important</em></span>. The order defines the + order in which the folds are nested. For example, the value + <code class="literal">"subsection,section"</code> for the + <code class="literal">Tex_FoldedSections</code> variable will not fold any + subsections at all. This is because the folds are created in the + <span class="emphasis"><em>reverse</em></span> order in which they occur in the + <code class="literal">Tex_FoldedSections</code> setting and also, once a fold is + created, the interior of the fold is not examined for creating + additional folds. In the above case, this means that a + <code class="literal">\section</code> is folded first and then its interior is + not examined further. The correct value should have been + <code class="literal">"section,subsection"</code> + </p><a id="fold-setting-adding"></a><p> + Each of the fold setting variables + <code class="literal">Tex_FoldedSections</code>, + <code class="literal">Tex_FoldedEnvironments</code> etc., as explained previously + is a comma separated string of variables. However, to make it easier + to <span class="emphasis"><em>add</em></span> to the default settings without having to + repeat the whole default setting again, Latex-Suite uses the following logic + in forming the complete setting string from the + <code class="literal">Tex_FoldedXXXX</code> variables. If the variable starts with + a comma, then <code class="literal">Tex_FoldedXXXX</code> is added to the end of + the default string rather than replacing it. Similarly, if it ends + with a comma, then it will be prepended to the beginning of the + default setting rather than replacing it. + </p><p> + For example, if <code class="literal">Tex_FoldedEnvironments</code> is set to the + string <code class="literal">"myenv"</code>, then only an environment of the + form <code class="literal">\begin{myenv}</code> will be folded. However, if the + <code class="literal">Tex_FoldedEnvironments</code> setting is + <code class="literal">",myenv"</code>, then the <code class="literal">\begin{myenv}</code> + environment will be folded after all other environments in the default + setting have been folded. On the other hand if + <code class="literal">Tex_FoldedEnvironments</code> is of the form + <code class="literal">"myenv,"</code>, the <code class="literal">\begin{myenv}</code> + environment will be folded before the rest of the environments in the + default setting. + </p></div></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="default-folding.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="latex-folding.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="editing-folding.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">8.1 Default Folding Scheme in Latex-Suite </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 8.3 Editing the folding.vim file directly</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite/default-folding.html b/.vim/doc/latex-suite/default-folding.html @@ -0,0 +1,18 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>8.1 Default Folding Scheme in Latex-Suite</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="Latex-Suite Reference"></link><link rel="up" href="latex-folding.html" title="8 Latex Folding"></link><link rel="prev" href="latex-folding.html" title="8 Latex Folding"></link><link rel="next" href="customizing-what-to-fold.html" title="8.2 Customizing what to fold"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">8.1 Default Folding Scheme in Latex-Suite</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="latex-folding.html">Prev</a> </td><th width="60%" align="center">8 Latex Folding</th><td width="20%" align="right"> <a accesskey="n" href="customizing-what-to-fold.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="8.1 Default Folding Scheme in Latex-Suite"><div class="titlepage"><div><div><h3 class="title"><a id="default-folding"></a>8.1 Default Folding Scheme in Latex-Suite</h3></div></div></div><p> + By default Latex-Suite creates folds in the following manner: + </p><pre class="programlisting">\chapter +\section +%%fakesection + \subsection + \subsubsection + \item + \equation + \eqnarray + \figure + \table + \footnote</pre><p> + The indentation shows the "nestedness" of the folding scheme. + See the <a class="link" href="customizing-what-to-fold.html" title="8.2 Customizing what to fold">next section</a> to + see how you can change this scheme. + </p></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="latex-folding.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="latex-folding.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="customizing-what-to-fold.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">8 Latex Folding </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 8.2 Customizing what to fold</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite/diacritic-mappings.html b/.vim/doc/latex-suite/diacritic-mappings.html @@ -0,0 +1,17 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>3.7 Diacritics</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="Latex-Suite Reference"></link><link rel="up" href="latex-macros.html" title="3 Latex-Suite Macros"></link><link rel="prev" href="auc-tex-mappings.html" title="3.6 Auc-Tex Key Bindings"></link><link rel="next" href="bibtex-bindings.html" title="3.8 BibTeX Shortcuts"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">3.7 Diacritics</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="auc-tex-mappings.html">Prev</a> </td><th width="60%" align="center">3 Latex-Suite Macros</th><td width="20%" align="right"> <a accesskey="n" href="bibtex-bindings.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="3.7 Diacritics"><div class="titlepage"><div><div><h3 class="title"><a id="diacritic-mappings"></a>3.7 Diacritics</h3></div></div></div><p> + These mappings speed up typing European languages which contain diacritic + characters such as a-umlaut etc. + </p><pre class="programlisting">+&lt;l&gt; expands to \v{&lt;l&gt;} +=&lt;l&gt; expands to \'{&lt;l&gt;}</pre><p> + where <code class="literal">&lt;l&gt;</code> is an alphabet. + </p><pre class="programlisting">+} expands to \"{a} ++: expands to \^{o}</pre><p> + Latex-Suite also ships with <a class="link" href="smart-keys.html#smart-backspace">smart + backspacing</a> functionality which provides another convenience while + editing languages with diacritics. + </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>Diacritics are disabled by default in Latex-Suite because they can + sometimes be a little too intrusive. Moreover, most European users can + nowadays use font encodings which display diacritic characters directly + instead of having to rely on Latex-Suite's method of displaying diacritics.</p><p>Set the <a class="link" href="customizing-macros.html#Tex_Diacritics" title="11.3.7 g:Tex_Diacritics">g:Tex_Diacritics</a> + variable to enable diacritics.</p></div></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="auc-tex-mappings.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="latex-macros.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="bibtex-bindings.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">3.6 Auc-Tex Key Bindings </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 3.8 BibTeX Shortcuts</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite/editing-folding.html b/.vim/doc/latex-suite/editing-folding.html @@ -0,0 +1,100 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>8.3 Editing the folding.vim file directly</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="Latex-Suite Reference"></link><link rel="up" href="latex-folding.html" title="8 Latex Folding"></link><link rel="prev" href="customizing-what-to-fold.html" title="8.2 Customizing what to fold"></link><link rel="next" href="latex-project.html" title="9 Multiple file LaTeX projects"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">8.3 Editing the folding.vim file directly</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="customizing-what-to-fold.html">Prev</a> </td><th width="60%" align="center">8 Latex Folding</th><td width="20%" align="right"> <a accesskey="n" href="latex-project.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="8.3 Editing the folding.vim file directly"><div class="titlepage"><div><div><h3 class="title"><a id="editing-folding"></a>8.3 Editing the folding.vim file directly</h3></div></div></div><p> + If you are using version 1.5 of Latex-Suite or older, you will need to + directly edit the + <code class="literal">$VIM/ftplugin/latex-suite/folding.vim</code> file if you + wish to modify the folding scheme. You will need to modify the + function <code class="literal">MakeTexFolds()</code> defined in that file to + modify the fold syntax. <code class="literal">MakeTexFolds</code> makes a number + of calls to <code class="literal">AddSyntaxFoldItem</code>. Each such call + defines a new "fold item". The order in which these calls are made + defines how the folds are nested. For example, if you desire an + <code class="literal">figure</code> environment to be nested within a + <code class="literal">section</code>, then you should define the fold for the + <code class="literal">figure</code> first. The syntax of + <code class="literal">AddSyntaxFoldItem</code> is as follows: + </p><pre class="programlisting">AddSyntaxFoldItem(startpat, endpat, startoff, endoff [, startskip, endskip])</pre><p> + If the last two arguments are omitted, then they are assumed to default + to the empty strings <code class="literal">''</code>. + The explanation for each argument is as follows: + </p><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><thead><tr><th>Argument</th><th>Explanation</th></tr></thead><tbody><tr><td><code class="literal">startpat</code></td><td>a line matching this pattern defines + the beginning of a fold. + </td></tr><tr><td> + <code class="literal">endpat</code> + </td><td> + a line matching this pattern defines the end of a fold. + </td></tr><tr><td><code class="literal">startoff</code></td><td> + this is the offset from the starting line at which folding will + actually start + </td></tr><tr><td><code class="literal">endoff</code></td><td> + like <code class="literal">startoff</code>, but gives the offset of the + actual fold end from the line satisfying <code class="literal">endpat</code>. + <code class="literal">startoff</code> and <code class="literal">endoff</code> are + necessary when the folding region does not have a specific end + pattern corresponding to a start pattern. for example in LaTeX, + <code class="literal">\section{Section Name}</code> defines the beginning of + a section, but there is no command which specifically ends a + section. Thus a <code class="literal">\section</code> is assumed to end 1 + line <span class="emphasis"><em>before</em></span> another section starts. + </td></tr><tr><td> + <code class="literal">startskip</code> + </td><td> + A Pattern Which Defines The Beginning Of A "Skipped" Region. + + For example, suppose we define a \itemize fold as follows: + <pre class="programlisting"><code class="literal">startpat</code> = '^\s*\\item', +<code class="literal">endpat</code> = '^\s*\\item\|^\s*\\end{\(enumerate\|itemize\|description\)}', +<code class="literal">startoff</code> = 0, +<code class="literal">endoff</code> = -1</pre> + + This defines a fold which starts with a line beginning with an + <code class="literal">\item</code> and ending one line before a line beginning with an + <code class="literal">\item</code> or <code class="literal">\end{enumerate}</code> etc. + + Then, as long as <code class="literal">\item</code>'s are not nested things are fine. + However, once items begin to nest, the fold started by one + <code class="literal">\item</code> can end because of an + <code class="literal">\item</code> in an <code class="literal">\itemize</code> + environment within this <code class="literal">\item</code>. i.e, the following can happen: + + <pre class="programlisting">\begin{itemize} +\item Some text &lt;------- fold will start here +This item will contain a nested item +\begin{itemize} &lt;----- fold will end here because next line contains \item... +\item Hello +\end{itemize} &lt;----- ... instead of here. +\item Next item of the parent itemize +\end{itemize}</pre> + + Therefore, in order to completely define a folding item which + allows nesting, we need to also define a "skip" pattern. + <code class="literal">startskip</code> and end skip do that. + Leave '' when there is no nesting. + </td></tr><tr><td> + <code class="literal">endskip</code> + </td><td> + the pattern which defines the end of the "skip" pattern for + nested folds. + </td></tr></tbody></table></div><div class="note" title="Example 1" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Example 1</h3><p> + A syntax fold region for the latex section is defined with the + following arguments to <code class="literal">AddSyntaxFoldItem</code>: + </p><pre class="programlisting">startpat = "\\section{" +endpat = "\\section{" +startoff = 0 +endoff = -1 +startskip = '' +endskip = ''</pre><p> + Note that the start and end patterns are thus the same and + <code class="literal">endoff</code> has a negative value to capture the effect + of a section ending one line before the next starts. + </p></div><div class="note" title="Example 2" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Example 2</h3><p> + A syntax fold region for the \itemize environment is: + </p><pre class="programlisting">startpat = '^\s*\\item', +endpat = '^\s*\\item\|^\s*\\end{\(enumerate\|itemize\|description\)}', +startoff = 0, +endoff = -1, +startskip = '^\s*\\begin{\(enumerate\|itemize\|description\)}', +endskip = '^\s*\\end{\(enumerate\|itemize\|description\)}'</pre><p> + Note the use of <code class="literal">startskip</code> and + <code class="literal">endskip</code> to allow nesting. + </p></div></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="customizing-what-to-fold.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="latex-folding.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="latex-project.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">8.2 Customizing what to fold </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 9 Multiple file LaTeX projects</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite/environment-mappings.html b/.vim/doc/latex-suite/environment-mappings.html @@ -0,0 +1,118 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>3.1 Environment Mappings</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="Latex-Suite Reference"></link><link rel="up" href="latex-macros.html" title="3 Latex-Suite Macros"></link><link rel="prev" href="latex-macros.html" title="3 Latex-Suite Macros"></link><link rel="next" href="latex-command-maps.html" title="3.2 Command Mappings"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">3.1 Environment Mappings</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="latex-macros.html">Prev</a> </td><th width="60%" align="center">3 Latex-Suite Macros</th><td width="20%" align="right"> <a accesskey="n" href="latex-command-maps.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="3.1 Environment Mappings"><div class="titlepage"><div><div><h3 class="title"><a id="environment-mappings"></a>3.1 Environment Mappings</h3></div></div></div><div class="toc"><dl><dt><span class="section"><a href="environment-mappings.html#inserting-environments">3.1.1 Inserting Environments</a></span></dt><dt><span class="section"><a href="environment-mappings.html#enclosing-environments">3.1.2 Enclosing in Environments</a></span></dt><dt><span class="section"><a href="environment-mappings.html#changing-environments">3.1.3 Changing Environments</a></span></dt></dl></div> + Latex-Suite provides a rich set of mappings to insert, enclose and modify + LaTeX environments, i.e, <code class="literal">\begin{...} ... \end{...}</code> + pairs. + <div class="section" title="3.1.1 Inserting Environments"><div class="titlepage"><div><div><h4 class="title"><a id="inserting-environments"></a>3.1.1 Inserting Environments</h4></div></div></div><div class="toc"><dl><dt><span class="section"><a href="environment-mappings.html#inserting-env-f5">3.1.1.1 Method 1: Pressing <code class="literal">&lt;F5&gt;</code></a></span></dt><dt><span class="section"><a href="environment-mappings.html#inserting-env-shift-f1">3.1.1.2 Method 2: Using <code class="literal">&lt;S-F1&gt;</code>-<code class="literal">&lt;S-F4&gt;</code></a></span></dt><dt><span class="section"><a href="environment-mappings.html#inserting-env-threeletter">3.1.1.3 Method 3: Using three letter sequences</a></span></dt></dl></div><p> + Latex-Suite provides the following ways to insert environments + </p><div class="section" title="3.1.1.1 Method 1: Pressing &lt;F5&gt;"><div class="titlepage"><div><div><h5 class="title"><a id="inserting-env-f5"></a>3.1.1.1 Method 1: Pressing <code class="literal">&lt;F5&gt;</code></h5></div></div></div><p> + If you press <code class="literal">&lt;F5&gt;</code> in the insert or normal + mode while on an empty line, Latex-Suite prompts you with a list of + environments you might want to insert. You can either choose one + from the list or type in a new environment name. If you press + <code class="literal">&lt;F5&gt;</code> on a line which already has a word, + then that word is used instead of prompting. + </p><p> + See <a class="link" href="customizing-macros.html#Tex_Env_name" title="11.3.1 Tex_Env_name">Tex_Env_name</a> for a + description of how Latex-Suite uses the word to form the expansion and how + to modify Latex-Suite's behavior. + </p><p> + The list of environments which Latex-Suite prompts you with (when + <code class="literal">&lt;F5&gt;</code> is pressed on an empty line) is formed + from the <a class="link" href="customizing-macros.html#Tex_PromptedEnvironments" title="11.3.10 g:Tex_PromptedEnvironments">Tex_PromptedEnvironments</a> + setting. + </p><p> + In addition to this setting, Latex-Suite also lists environments found in + custom packages as described in the section <a class="link" href="package-actions.html" title="4.2 Actions taken for supported packages">Package actions.</a> + </p></div><div class="section" title="3.1.1.2 Method 2: Using &lt;S-F1&gt;-&lt;S-F4&gt;"><div class="titlepage"><div><div><h5 class="title"><a id="inserting-env-shift-f1"></a>3.1.1.2 Method 2: Using <code class="literal">&lt;S-F1&gt;</code>-<code class="literal">&lt;S-F4&gt;</code></h5></div></div></div><p> + The shifted function keys, <code class="literal">&lt;S-F1&gt;</code> to + <code class="literal">&lt;S-F4&gt;</code> can be mapped to insert very commonly + used environments. The environments mapped to each key can be + customized via the <a class="link" href="customizing-macros.html#Tex_HotKeyMappings" title="11.3.11 g:Tex_HotKeyMappings">g:Tex_HotKeyMappings</a> setting. + </p></div><div class="section" title="3.1.1.3 Method 3: Using three letter sequences"><div class="titlepage"><div><div><h5 class="title"><a id="inserting-env-threeletter"></a>3.1.1.3 Method 3: Using three letter sequences</h5></div></div></div><p> + Environments can also be inserted by pressing a 3 capital letter + sequence starting with an <code class="literal">E</code>. The sequence of 3 + letters generally tries to follow the following rules: + </p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"> + All environment mappings begin with <code class="literal">E</code></li><li class="listitem"> + If the environment can be broken up into 2 distinct words, + such as flushright (flush + right), then the next 2 letters + are the first letters of the 2 words. Example: + <pre class="programlisting">flushleft (_f_lush + _l_eft) ---&gt; EFL +flushright (_f_lush + _r_ight) ---&gt; EFR +eqnarray (_e_qn + _a_rray) ---&gt; EEA</pre> + If on the other hand, the environment name cannot be broken + up into 2 distinct words, then the next 2 letters are the + first 2 letters of the name of the environment. + Example: + <pre class="programlisting">equation (_eq_uation) ---&gt; EEQ</pre></li></ol></div><p> + Unfortunately there are some environments that cannot be + split in two words and first two letters in name are + identical. In this case shortcut is created from E, first and + last letter. Example: + </p><pre class="programlisting">quote (_q_uot_e_) ---&gt; EQE +quotation (_q_uotatio_n_) ---&gt; EQN</pre><p> + Of course, not every last one of the environments can follow + this rule because of ambiguities. In case of doubt, pull down + the Tex-Environments menu. The menu item should give the hint + for the map. + </p></div></div><div class="section" title="3.1.2 Enclosing in Environments"><div class="titlepage"><div><div><h4 class="title"><a id="enclosing-environments"></a>3.1.2 Enclosing in Environments</h4></div></div></div><div class="toc"><dl><dt><span class="section"><a href="environment-mappings.html#enclosing-env-f5">3.1.2.1 Method 1: Pressing <code class="literal">&lt;F5&gt;</code></a></span></dt><dt><span class="section"><a href="environment-mappings.html#enclosing-env-threeletter">3.1.2.2 Method 2: Using three letter mappings</a></span></dt></dl></div><p> + Latex-Suite provides visual-mode mappings which enclose visually + selected portions of text in environments. There are two ways provided + to do this. + </p><div class="section" title="3.1.2.1 Method 1: Pressing &lt;F5&gt;"><div class="titlepage"><div><div><h5 class="title"><a id="enclosing-env-f5"></a>3.1.2.1 Method 1: Pressing <code class="literal">&lt;F5&gt;</code></h5></div></div></div><p> + You can also select a portion of text visually and press + <code class="literal">&lt;F5&gt;</code> while still in visual mode. This will + prompt you with a list of environments. (This list can be customized + via the <a class="link" href="customizing-macros.html#Tex_PromptedEnvironments" title="11.3.10 g:Tex_PromptedEnvironments">g:Tex_PromptedEnvironments</a> + setting). You can either choose from this list or type in a new + environment name. Once the selection is done, Latex-Suite encloses the + visually selected portion in the chosen environment. + </p></div><div class="section" title="3.1.2.2 Method 2: Using three letter mappings"><div class="titlepage"><div><div><h5 class="title"><a id="enclosing-env-threeletter"></a>3.1.2.2 Method 2: Using three letter mappings</h5></div></div></div><p> + You can also select text visually and press a sequence of three + characters beginning with <code class="literal">,</code> (the single comma + character) and the selected text will be enclosed in the chosen + environment. The three letter sequence follows directly from the + three letter sequence used to insert environments as described <a class="link" href="environment-mappings.html#inserting-env-threeletter" title="3.1.1.3 Method 3: Using three letter sequences">here</a>. The following + example describes the rule used: + </p><p> + If <code class="literal">ECE</code> inserts a + <code class="literal">\begin{center}...\end{center}</code> environment, then to + enclose a block of selected text in + <code class="literal">\begin{center}...\end{center}</code>, simply select the + text and press <code class="literal">,ce</code>. The rule simply says that the + leading <code class="literal">E</code> is converted to <code class="literal">,</code> and + the next 2 letters are small case. + </p></div><p> + Some of the visual mode mappings are sensitive to whether you + choose line-wise or character-wise. For example, if you choose a + word and press <code class="literal">,ce</code>, then you get + <code class="literal">\centerline{word}</code>, whereas if you press + <code class="literal">,ce</code> on a line-wise selection, you get: + </p><pre class="programlisting">\begin{center} + line +\end{center}</pre><p> + </p></div><div class="section" title="3.1.3 Changing Environments"><div class="titlepage"><div><div><h4 class="title"><a id="changing-environments"></a>3.1.3 Changing Environments</h4></div></div></div><p> + Pressing <code class="literal">&lt;S-F5&gt;</code> in normal mode detects which + environment the cursor is presently located in and prompts you to + replace it with a new one. The innermost environment is detected. For + example, in the following source: + </p><pre class="programlisting">\begin{eqnarray} + \begin{array}{ccc} + 2 &amp; 3 &amp; 4 + \end{array} +\end{eqnarray}</pre><p> + if you are located in the middle "2 &amp; 3 &amp; 4" line, then pressing + <code class="literal">&lt;S-F5&gt;</code> will prompt you to change the array + environment, not the eqnarray environment. In addition, Latex-Suite will also + try to change lines within the environment to be consistent with the + new environment. For example, if the original environment was an + <code class="literal">eqnarray</code> environment with a + <code class="literal">\label</code> command, then changing it to an + <code class="literal">eqnarray*</code> environment will delete the + <code class="literal">\label</code>. + </p><p> + Pressing <code class="literal">&lt;F5&gt;</code> in normal mode has the same + effect as pressing <code class="literal">&lt;F5&gt;</code> in insert-mode, + namely you will be prompted to choose an environment to insert. + </p></div></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="latex-macros.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="latex-macros.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="latex-command-maps.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">3 Latex-Suite Macros </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 3.2 Command Mappings</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite/font-maps.html b/.vim/doc/latex-suite/font-maps.html @@ -0,0 +1,21 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>3.3 Font Mappings</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="Latex-Suite Reference"></link><link rel="up" href="latex-macros.html" title="3 Latex-Suite Macros"></link><link rel="prev" href="latex-command-maps.html" title="3.2 Command Mappings"></link><link rel="next" href="section-mappings.html" title="3.4 Section Mappings"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">3.3 Font Mappings</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="latex-command-maps.html">Prev</a> </td><th width="60%" align="center">3 Latex-Suite Macros</th><td width="20%" align="right"> <a accesskey="n" href="section-mappings.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="3.3 Font Mappings"><div class="titlepage"><div><div><h3 class="title"><a id="font-maps"></a>3.3 Font Mappings</h3></div></div></div><p> + These mappings insert font descriptions such as: + <code class="literal">\textsf{&lt;++&gt;}&lt;++&gt;</code> + with the cursor left in place of the first <a class="link" href="latex-macros.html#place-holders" title="Place Holders">placeholder</a> (the &lt;++&gt; characters). + </p><p> + Mnemonic: + </p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">first letter is always F (F for font)</li><li class="listitem">next 2 letters are the 2 letters describing the font.</li></ol></div><p> + </p><p> + Example: Typing <code class="literal">FEM</code> in insert-mode expands to + <code class="literal">\emph{&lt;++&gt;}&lt;++&gt;</code>. + </p><p> + Just like environment mappings, you can visually select an area and press + <code class="literal">`sf</code> to have it enclosed in: + <code class="literal">\textsf{word}</code> + or + </p><pre class="programlisting">{\sffamily +line +}</pre><p> + depending on character-wise or line-wise selection. + </p></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="latex-command-maps.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="latex-macros.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="section-mappings.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">3.2 Command Mappings </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 3.4 Section Mappings</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite/forward-searching.html b/.vim/doc/latex-suite/forward-searching.html @@ -0,0 +1,27 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>7.2 Forward Searching documents</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="Latex-Suite Reference"></link><link rel="up" href="latex-viewing.html" title="7 Latex Viewing and Searching"></link><link rel="prev" href="latex-viewing-rules.html" title="7.1 Setting Viewing rules"></link><link rel="next" href="inverse-searching.html" title="7.3 Inverse Searching"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">7.2 Forward Searching documents</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="latex-viewing-rules.html">Prev</a> </td><th width="60%" align="center">7 Latex Viewing and Searching</th><td width="20%" align="right"> <a accesskey="n" href="inverse-searching.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="7.2 Forward Searching documents"><div class="titlepage"><div><div><h3 class="title"><a id="forward-searching"></a>7.2 Forward Searching documents</h3></div></div></div><p> + Forward searching refers to making a viewer display a given document at + a given location from within Vim. At present, these viewers are known to support + forward searching, but viewers that are not listed here may work, too: + </p><div class="informaltable"><table border="1"><colgroup><col></col><col></col><col></col></colgroup><thead><tr><th>Viewer</th><th>OS</th><th>Supported documents</th><th>Comment</th></tr></thead><tbody><tr><td><a class="ulink" href="http://skim-app.sourceforge.net/" target="_top">Skim</a></td><td>Apple / OS X Tiger</td><td>PDF</td><td>Supports also inverse searching</td></tr><tr><td><a class="ulink" href="http://pdfview.sourceforge.net/" target="_top">PDFView</a></td><td>Apple / OS X</td><td>PDF</td><td>No longer in development, supports also inverse searching</td></tr><tr><td><a class="ulink" href="http://www2.ing.unipi.it/~d9615/homepage/texniscope.html" target="_top">TeXniscope</a></td><td>Apple</td><td>PDF, DVI</td><td> </td></tr><tr><td><a class="ulink" href="http://www.miktex.org/" target="_top">YAP</a></td><td>Windows</td><td>DVI, PS</td><td>ships with MikTex</td></tr><tr><td><a class="ulink" href="http://blog.kowalczyk.info/software/sumatrapdf/" target="_top">Sumatra PDF</a></td><td>Windows</td><td>PDF</td><td> </td></tr><tr><td><a class="ulink" href="http://developer.kde.org/~kdvi/" target="_top">kdvi</a></td><td>Linux/UNIX</td><td>DVI</td><td> </td></tr><tr><td><a class="ulink" href="http://okular.kde.org/" target="_top">okular</a></td><td>Linux/UNIX</td><td>DVI, PDF, PS and many more</td><td>Included in KDE 4</td></tr><tr><td><a class="ulink" href="http://math.berkeley.edu/~vojta/xdvi.html" target="_top">xdvi</a></td><td>Linux/UNIX</td><td>DVI</td><td> </td></tr><tr><td><a class="ulink" href="http://xdvi.sourceforge.net/" target="_top">xdvik</a></td><td>Linux/UNIX</td><td>DVI</td><td> </td></tr></tbody></table></div><p> + + Pressing <code class="literal">\ls</code> from within Vim + should make the viewer display the portion of the document where your + cursor is placed. + </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> + OS/X users need to set the <code class="literal">g:TreatMacViewerAsUNIX</code> flag + to <code class="literal">1</code> and provide a UNIX-like viewrule, that expects as + arguments the document, the linenumber and the sourcefile in this order. + </p></div><p> + </p><a id="enabling-searching"></a><div class="note" title="Enabling Forward and Inverse Searching" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Enabling Forward and Inverse Searching</h3><p> + Most DVI viewers need "source-special" information in order to do + forward (and inverse) searching. This information is embedded in the + <code class="literal">dvi</code> file if the LaTeX source is compiled with the + <code class="literal">--src-specials</code> option. By default, Latex-Suite does not + supply this argument to the compiler. See the section on + <code class="literal"><a class="link" href="customizing-compiling.html#Tex_CompileRule_format" title="11.6.2 g:Tex_CompileRule_&lt;format&gt;">g:Tex_CompileRule_dvi</a></code> + to find out how this option can be set. + + For pdf viewers you need to use the <a class="ulink" href="http://itexmac.sourceforge.net/pdfsync.html" target="_top">pdfsync</a> + package in your LaTeX document. + </p></div></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="latex-viewing-rules.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="latex-viewing.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="inverse-searching.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">7.1 Setting Viewing rules </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 7.3 Inverse Searching</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite/greek-letter-mappings.html b/.vim/doc/latex-suite/greek-letter-mappings.html @@ -0,0 +1,19 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>3.5 Greek Letter Mappings</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="Latex-Suite Reference"></link><link rel="up" href="latex-macros.html" title="3 Latex-Suite Macros"></link><link rel="prev" href="section-mappings.html" title="3.4 Section Mappings"></link><link rel="next" href="auc-tex-mappings.html" title="3.6 Auc-Tex Key Bindings"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">3.5 Greek Letter Mappings</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="section-mappings.html">Prev</a> </td><th width="60%" align="center">3 Latex-Suite Macros</th><td width="20%" align="right"> <a accesskey="n" href="auc-tex-mappings.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="3.5 Greek Letter Mappings"><div class="titlepage"><div><div><h3 class="title"><a id="greek-letter-mappings"></a>3.5 Greek Letter Mappings</h3></div></div></div><p> + Lower case + </p><code class="literal">`a</code> through <code class="literal">`z</code> expand to + <code class="literal">\alpha</code> through <code class="literal">\zeta</code>. + <p> + Upper case: + </p><pre class="programlisting">`D = \Delta +`F = \Phi +`G = \Gamma +`Q = \Theta +`L = \Lambda +`X = \Xi +`Y = \Psi +`S = \Sigma +`U = \Upsilon +`W = \Omega</pre><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>LaTeX does not support upper case for all greek alphabets.</p></div><p>Just like other Latex-Suite mappings, these mappings are not created using + the standard <code class="literal">imap</code> command. Thus you can type slowly, + correct using <code class="literal">&lt;BS&gt;</code> etc.</p></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="section-mappings.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="latex-macros.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="auc-tex-mappings.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">3.4 Section Mappings </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 3.6 Auc-Tex Key Bindings</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite/index.html b/.vim/doc/latex-suite/index.html @@ -0,0 +1,17 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Latex-Suite Reference</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><meta name="description" content="Latex-Suite attempts to provide a comprehensive set of tools to view, edit and compile LaTeX documents in Vim. Together, they provide tools starting from macros to speed up editing LaTeX documents to functions for forward searching .dvi documents. Latex-Suite has been possible because of the contributions of many people. Please see latex-suite-credits for a list of people who have helped. Latex-Suite is released under the Vim charityware license. For license and conditions of use look at |copyright|. Replace all occurrences of ``Vim'' with ``Latex-Suite''. The current copyright holders of Latex-Suite are Srinath Avadhanula and Mikolaj Machowski. Homepage: http://vim-latex.sourceforge.net"></meta><link rel="home" href="index.html" title="Latex-Suite Reference"></link><link rel="next" href="recommended-settings.html" title="1 Installation and recommended Settings"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Latex-Suite Reference</th></tr><tr><td width="20%" align="left"> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="recommended-settings.html">Next</a></td></tr></table><hr></hr></div><div xml:lang="en" class="article" title="Latex-Suite Reference"><div class="titlepage"><div><div><h2 class="title"><a id="id346093"></a>Latex-Suite Reference</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Srinath</span> <span class="surname">Avadhanula</span></h3><div class="affiliation"><div class="address"><p><code class="email">&lt;<a class="email" href="mailto:srinath AT fastmail DOT fm">srinath AT fastmail DOT fm</a>&gt;</code></p></div></div></div></div><div><div class="author"><h3 class="author"><span class="firstname">Mikolaj</span> <span class="surname">Machowski</span></h3><div class="affiliation"><div class="address"><p><code class="email">&lt;<a class="email" href="mailto:mikmach AT wp DOT pl">mikmach AT wp DOT pl</a>&gt;</code></p></div></div></div></div><div><div class="abstract" title="Abstract"><p class="title"><b>Abstract</b></p><p> + Latex-Suite attempts to provide a comprehensive set of tools to + view, edit and compile LaTeX documents in Vim. Together, they + provide tools starting from macros to speed up editing LaTeX + documents to functions for forward searching .dvi documents. + Latex-Suite has been possible because of the contributions of many + people. Please see <a class="link" href="latex-suite-credits.html" title="12 Credits">latex-suite-credits</a> for a list of + people who have helped. + </p><p> + Latex-Suite is released under the Vim charityware license. For + license and conditions of use look at |copyright|. Replace all + occurrences of ``Vim'' with ``Latex-Suite''. The current copyright + holders of Latex-Suite are Srinath Avadhanula and Mikolaj Machowski. + </p><p> + Homepage: <a class="ulink" href="http://vim-latex.sourceforge.net" target="_top">http://vim-latex.sourceforge.net</a> + </p></div></div></div><hr></hr></div><div class="toc"><dl><dt><span class="section"><a href="recommended-settings.html">1 Installation and recommended Settings</a></span></dt><dt><span class="section"><a href="latex-suite-templates.html">2 Inserting Templates</a></span></dt><dt><span class="section"><a href="latex-macros.html">3 Latex-Suite Macros</a></span></dt><dd><dl><dt><span class="section"><a href="environment-mappings.html">3.1 Environment Mappings</a></span></dt><dt><span class="section"><a href="latex-command-maps.html">3.2 Command Mappings</a></span></dt><dt><span class="section"><a href="font-maps.html">3.3 Font Mappings</a></span></dt><dt><span class="section"><a href="section-mappings.html">3.4 Section Mappings</a></span></dt><dt><span class="section"><a href="greek-letter-mappings.html">3.5 Greek Letter Mappings</a></span></dt><dt><span class="section"><a href="auc-tex-mappings.html">3.6 Auc-Tex Key Bindings</a></span></dt><dt><span class="section"><a href="diacritic-mappings.html">3.7 Diacritics</a></span></dt><dt><span class="section"><a href="bibtex-bindings.html">3.8 BibTeX Shortcuts</a></span></dt><dt><span class="section"><a href="smart-keys.html">3.9 Smart Key Mappings</a></span></dt><dt><span class="section"><a href="altkey-mappings.html">3.10 Alt Key Macros</a></span></dt><dt><span class="section"><a href="custom-macros-menu.html">3.11 Custom Macros</a></span></dt><dt><span class="section"><a href="ls-new-macros.html">3.12 Making your own Macros via <code class="literal">IMAP()</code></a></span></dt></dl></dd><dt><span class="section"><a href="latex-packages.html">4 Package Handling</a></span></dt><dd><dl><dt><span class="section"><a href="inserting-packages.html">4.1 Inserting package commands</a></span></dt><dt><span class="section"><a href="package-actions.html">4.2 Actions taken for supported packages</a></span></dt><dt><span class="section"><a href="automatic-package-detection.html">4.3 Automatic Package detection</a></span></dt><dt><span class="section"><a href="supporting-packages.html">4.4 Writing supporting for a package</a></span></dt></dl></dd><dt><span class="section"><a href="latex-completion.html">5 Latex Completion</a></span></dt><dd><dl><dt><span class="section"><a href="ls-completion-usage.html">5.1 Latex-Suite completion example</a></span></dt><dt><span class="section"><a href="ls-completion-ref.html">5.2 Latex-Suite \ref completion</a></span></dt><dt><span class="section"><a href="latex-completion-cite.html">5.3 Latex-Suite <code class="literal">\cite</code> completion</a></span></dt><dt><span class="section"><a href="ls-filename-completion.html">5.4 Latex-Suite filename completion</a></span></dt><dt><span class="section"><a href="ls-completion-custom.html">5.5 Custom command completion</a></span></dt></dl></dd><dt><span class="section"><a href="latex-compiling.html">6 LaTeX Compiling</a></span></dt><dd><dl><dt><span class="section"><a href="compiler-rules.html">6.1 Setting Compilation rules</a></span></dt><dt><span class="section"><a href="compiler-dependency.html">6.2 Handling dependencies in compilation</a></span></dt><dt><span class="section"><a href="compiling-multiple.html">6.3 Compiling multiple times</a></span></dt><dt><span class="section"><a href="compiler-output-customization.html">6.4 Customizing the compiler output</a></span></dt><dt><span class="section"><a href="part-compiling.html">6.5 Compiling parts of a file</a></span></dt></dl></dd><dt><span class="section"><a href="latex-viewing.html">7 Latex Viewing and Searching</a></span></dt><dd><dl><dt><span class="section"><a href="latex-viewing-rules.html">7.1 Setting Viewing rules</a></span></dt><dt><span class="section"><a href="forward-searching.html">7.2 Forward Searching documents</a></span></dt><dt><span class="section"><a href="inverse-searching.html">7.3 Inverse Searching</a></span></dt></dl></dd><dt><span class="section"><a href="latex-folding.html">8 Latex Folding</a></span></dt><dd><dl><dt><span class="section"><a href="default-folding.html">8.1 Default Folding Scheme in Latex-Suite</a></span></dt><dt><span class="section"><a href="customizing-what-to-fold.html">8.2 Customizing what to fold</a></span></dt><dt><span class="section"><a href="editing-folding.html">8.3 Editing the folding.vim file directly</a></span></dt></dl></dd><dt><span class="section"><a href="latex-project.html">9 Multiple file LaTeX projects</a></span></dt><dd><dl><dt><span class="section"><a href="latex-project-settings.html">9.1 Latex-Suite project settings</a></span></dt><dt><span class="section"><a href="latex-master-file.html">9.2 Specifying which file to compile</a></span></dt></dl></dd><dt><span class="section"><a href="latex-suite-commands-maps.html">10 Latex-Suite Commands and Maps</a></span></dt><dd><dl><dt><span class="section"><a href="latex-suite-maps.html">10.1 Latex-Suite Maps</a></span></dt><dt><span class="section"><a href="latex-suite-commands.html">10.2 Latex Suite Commands</a></span></dt></dl></dd><dt><span class="section"><a href="customizing-latex-suite.html">11 Customizing Latex-Suite</a></span></dt><dd><dl><dt><span class="section"><a href="ls-general-purpose-settings.html">11.1 General Settings</a></span></dt><dt><span class="section"><a href="customizing-place-holders.html">11.2 Place-Holder Customization</a></span></dt><dt><span class="section"><a href="customizing-macros.html">11.3 Macro Customization</a></span></dt><dt><span class="section"><a href="customizing-smart-keys.html">11.4 Smart Key Customization</a></span></dt><dt><span class="section"><a href="customizing-latex-completion.html">11.5 Latex Completion Customization</a></span></dt><dt><span class="section"><a href="customizing-compiling.html">11.6 Compiler Customization</a></span></dt><dt><span class="section"><a href="customizing-viewing.html">11.7 Viewer Customization</a></span></dt><dt><span class="section"><a href="customizing-menus.html">11.8 Menu Customization</a></span></dt><dt><span class="section"><a href="customizing-folding.html">11.9 Folding Customization</a></span></dt><dt><span class="section"><a href="customizing-packages.html">11.10 Package Handling Customization</a></span></dt></dl></dd><dt><span class="section"><a href="latex-suite-credits.html">12 Credits</a></span></dt></dl></div></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="recommended-settings.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"> </td><td width="20%" align="center"> </td><td width="40%" align="right" valign="top"> 1 Installation and recommended Settings</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite/inserting-packages.html b/.vim/doc/latex-suite/inserting-packages.html @@ -0,0 +1,30 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>4.1 Inserting package commands</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="Latex-Suite Reference"></link><link rel="up" href="latex-packages.html" title="4 Package Handling"></link><link rel="prev" href="latex-packages.html" title="4 Package Handling"></link><link rel="next" href="package-actions.html" title="4.2 Actions taken for supported packages"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">4.1 Inserting package commands</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="latex-packages.html">Prev</a> </td><th width="60%" align="center">4 Package Handling</th><td width="20%" align="right"> <a accesskey="n" href="package-actions.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="4.1 Inserting package commands"><div class="titlepage"><div><div><h3 class="title"><a id="inserting-packages"></a>4.1 Inserting package commands</h3></div></div></div><p> + When you first invoke Latex-Suite, it scans the + <code class="literal">$VIM/ftplugin/latex-suite/packages</code> directory for + package script files and creates a menu from all the files found there. + This menu is created under <code class="literal">TeX-Suite &gt; Packages &gt; + Supported</code>. This menu contains a list of packages "supported" + by Latex-Suite. When you choose one of the packages from this menu (for example + the <code class="literal">amsmath</code> package), then a line of + the form + </p><pre class="programlisting">\usepackage[&lt;++&gt;]{amsmath}&lt;++&gt;</pre><p> + will be inserted into the current file. + </p><p> + The <code class="literal">\usepackage</code> line can also be inserted in an easy + manner in the current file by pressing <code class="literal">&lt;F5&gt;</code> + while in the preamble of the current document. This will set up a prompt + from the supported packages and ask you to choose from one of them. If + you do not find the package you want to insert in the list, you can type + in a package-name and it will use that. Pressing + <code class="literal">&lt;F5&gt;</code> in the preamble on a line containing a + single word will construct a <code class="literal">\usepackage</code> line from + that word. + </p><p> + You can also use the <a class="link" href="latex-suite-commands.html#TPackage" title="10.2.5 :TPackage [{package, ...}]"><code class="literal">TPackage</code></a> to insert the + <code class="literal">\usepackage</code> line. + </p><p> + Once you have inserted a <code class="literal">\usepackage</code> line, for + supported packages, you can use the Options and Commands menus + described in the <a class="link" href="package-actions.html" title="4.2 Actions taken for supported packages">next section</a>. + </p></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="latex-packages.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="latex-packages.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="package-actions.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">4 Package Handling </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 4.2 Actions taken for supported packages</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite/inverse-searching.html b/.vim/doc/latex-suite/inverse-searching.html @@ -0,0 +1,23 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>7.3 Inverse Searching</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="Latex-Suite Reference"></link><link rel="up" href="latex-viewing.html" title="7 Latex Viewing and Searching"></link><link rel="prev" href="forward-searching.html" title="7.2 Forward Searching documents"></link><link rel="next" href="latex-folding.html" title="8 Latex Folding"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">7.3 Inverse Searching</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="forward-searching.html">Prev</a> </td><th width="60%" align="center">7 Latex Viewing and Searching</th><td width="20%" align="right"> <a accesskey="n" href="latex-folding.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="7.3 Inverse Searching"><div class="titlepage"><div><div><h3 class="title"><a id="inverse-searching"></a>7.3 Inverse Searching</h3></div></div></div><p> + Inverse searching refers to the viewer telling Vim to display the + LaTeX source file at a given location when you double-click in the + viewer window. + </p><p> + You will need to <a class="link" href="forward-searching.html#enabling-searching">enable + searching</a> in order to use this functionality. + </p><p> + You will also need to specify certain settings to the DVI viewer + conveying the syntax which it needs to use to tell Vim how to display + the source file. In <code class="literal">YAP</code>, you can set this option in + <code class="literal">View &gt; Options &gt; Inverse Search</code>. The + <code class="literal">Command Line</code> field needs to be set as follows: + </p><pre class="programlisting">"C:\Program Files\vim\vim61\gvim" -c ":RemoteOpen +%l %f"</pre><p> + The command <code class="literal">:RemoteOpen</code> is supplied when you install + Latex-Suite. + </p><p> + On *nix machines, Latex-Suite attempts to call the DVI viewer in such a way + that it already knows how to communicate with Vim. If this does not + seem to be working, you can use the <code class="literal">RemoteOpen</code> + command described above. + </p></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="forward-searching.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="latex-viewing.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="latex-folding.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">7.2 Forward Searching documents </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 8 Latex Folding</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite/latex-command-maps.html b/.vim/doc/latex-suite/latex-command-maps.html @@ -0,0 +1,37 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>3.2 Command Mappings</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="Latex-Suite Reference"></link><link rel="up" href="latex-macros.html" title="3 Latex-Suite Macros"></link><link rel="prev" href="environment-mappings.html" title="3.1 Environment Mappings"></link><link rel="next" href="font-maps.html" title="3.3 Font Mappings"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">3.2 Command Mappings</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="environment-mappings.html">Prev</a> </td><th width="60%" align="center">3 Latex-Suite Macros</th><td width="20%" align="right"> <a accesskey="n" href="font-maps.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="3.2 Command Mappings"><div class="titlepage"><div><div><h3 class="title"><a id="latex-command-maps"></a>3.2 Command Mappings</h3></div></div></div><div class="toc"><dl><dt><span class="section"><a href="latex-command-maps.html#inserting-commands">3.2.1 Inserting LaTeX commands</a></span></dt><dt><span class="section"><a href="latex-command-maps.html#enclosing-commands">3.2.2 Enclosing in a command</a></span></dt><dt><span class="section"><a href="latex-command-maps.html#changing-commands">3.2.3 Changing commands</a></span></dt></dl></div> + Latex-Suite provides a rich set of mappings to insert, enclose and modify + LaTeX commands. + <div class="section" title="3.2.1 Inserting LaTeX commands"><div class="titlepage"><div><div><h4 class="title"><a id="inserting-commands"></a>3.2.1 Inserting LaTeX commands</h4></div></div></div><a id="ls-imap-f7"></a><a id="ls-imap-s-f7"></a><p> + Pressing <code class="literal">&lt;F7&gt;</code> in insert or normal mode while + the cursor is touching a word will insert a command formed from the + word touching the cursor. + </p><p> + For certain common commands, Latex-Suite will expand them to include + additional arguments as needed. For example, <code class="literal">frac</code> + becomes <code class="literal">\frac{&lt;++&gt;}{&lt;++&gt;}&lt;++&gt;</code>. Otherwise, it will + simply change the word under the cursor as follows + </p><pre class="programlisting">word --&gt; \word{&lt;++&gt;}&lt;++&gt;</pre><p> + You can define custom expansions + of commands using the <code class="literal">Tex_Com_{name}</code> setting as + described in <a class="link" href="customizing-macros.html#Tex_Com_name" title="11.3.2 Tex_Com_name">here</a>. + </p><p> + If <code class="literal">&lt;F7&gt;</code> is pressed when the cursor is on + white-space, then Latex-Suite will prompt you to choose a command and insert + that instead.The list of commands is constructed from the <a class="link" href="customizing-macros.html#Tex_PromptedCommands" title="11.3.12 g:Tex_PromptedCommands"><code class="literal">g:Tex_PromptedCommands</code></a> + setting and also from commands which Latex-Suite finds while scanning custom + packages which Latex-Suite finds. See the <a class="link" href="package-actions.html" title="4.2 Actions taken for supported packages">Package actions</a> section for details + on which files are scanned etc. + </p></div><div class="section" title="3.2.2 Enclosing in a command"><div class="titlepage"><div><div><h4 class="title"><a id="enclosing-commands"></a>3.2.2 Enclosing in a command</h4></div></div></div><p> + You can select a portion of text visually and press + <code class="literal">&lt;F7&gt;</code> while still in visual mode. This will + prompt you with a list of commands. (This list can be customized + via the <a class="link" href="customizing-macros.html#Tex_PromptedCommands" title="11.3.12 g:Tex_PromptedCommands">g:Tex_PromptedCommands</a> + setting). You can either choose from this list or type in a new + command name. Once the selection is done, Latex-Suite encloses the + visually selected portion in the chosen command. + </p></div><div class="section" title="3.2.3 Changing commands"><div class="titlepage"><div><div><h4 class="title"><a id="changing-commands"></a>3.2.3 Changing commands</h4></div></div></div><a id="ls-vmap-f7"></a><p> + In both insert and normal mode <code class="literal">&lt;S-F7&gt;</code> will + find out if you are presently within an environment and then prompt you + with a list of commands to change it to. + </p></div></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="environment-mappings.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="latex-macros.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="font-maps.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">3.1 Environment Mappings </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 3.3 Font Mappings</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite/latex-compiling.html b/.vim/doc/latex-suite/latex-compiling.html @@ -0,0 +1,33 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>6 LaTeX Compiling</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="Latex-Suite Reference"></link><link rel="up" href="index.html" title="Latex-Suite Reference"></link><link rel="prev" href="ls-completion-custom.html" title="5.5 Custom command completion"></link><link rel="next" href="compiler-rules.html" title="6.1 Setting Compilation rules"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">6 LaTeX Compiling</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ls-completion-custom.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="compiler-rules.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="6 LaTeX Compiling"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="latex-compiling"></a>6 LaTeX Compiling</h2></div></div></div><div class="toc"><dl><dt><span class="section"><a href="compiler-rules.html">6.1 Setting Compilation rules</a></span></dt><dt><span class="section"><a href="compiler-dependency.html">6.2 Handling dependencies in compilation</a></span></dt><dt><span class="section"><a href="compiling-multiple.html">6.3 Compiling multiple times</a></span></dt><dt><span class="section"><a href="compiler-output-customization.html">6.4 Customizing the compiler output</a></span></dt><dt><span class="section"><a href="part-compiling.html">6.5 Compiling parts of a file</a></span></dt></dl></div><p> + This functionality, available via the TeX-Suite menu, provides various tools + to compile and debug LaTeX files from within Vim. + </p><p> + If you are using commonly used LaTeX tools, then you should be all set + as soon as you download and install Latex-Suite. In order to compile a + LaTeX file, simply press <code class="literal">\ll</code> while editing the file. + This runs latex on the current file and displays the errors in a + |quickfix-window| below the file being edited. You can then scroll + through the errors and press <code class="literal">&lt;enter&gt;</code> to be + taken to the location of the corresponding error. Along with the errors + being listed in the quickfix window, the corresponding log file is also + opened in |preview| mode beneath the quickfix window. It is scrolled + automatically to keep in sync with the error being viewed in the + quickfix window. You will be automatically taken to the location of the + first error/warning unless you set the <a class="link" href="customizing-compiling.html#Tex_GotoError" title="11.6.8 g:Tex_GotoError">g:Tex_GotoError</a> variable to 0. + </p><p> + Latex-Suite also supports compiling LaTeX into formats other than DVI. By + default, Latex-Suite supports PDF and PS formats. In order to choose a format + other than DVI, use the <code class="literal">TTarget</code> command or the + <code class="literal">TeX-Suite &gt; Target Format</code> menu item. This will ask you + to type in the name of the target format you want to compile to. If a rule + has been defined for the format (as described in the next + <a class="link" href="compiler-rules.html" title="6.1 Setting Compilation rules">section</a>), then Latex-Suite will switch to + that format. + </p><p>Trying to choose a format for which no rule has been defined will + result in Latex-Suite displaying a warning message without taking any action. + </p><p> + If you are using a multiple file project and need to compile a master + file while editing other files, then Latex-Suite provides a way to specify the + file to be compiled as described in <a class="link" href="latex-master-file.html" title="9.2 Specifying which file to compile">latex-master-file</a>. + </p></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ls-completion-custom.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="compiler-rules.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">5.5 Custom command completion </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 6.1 Setting Compilation rules</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite/latex-completion-cite.html b/.vim/doc/latex-suite/latex-completion-cite.html @@ -0,0 +1,113 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>5.3 Latex-Suite \cite completion</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="Latex-Suite Reference"></link><link rel="up" href="latex-completion.html" title="5 Latex Completion"></link><link rel="prev" href="ls-completion-ref.html" title="5.2 Latex-Suite \ref completion"></link><link rel="next" href="ls-filename-completion.html" title="5.4 Latex-Suite filename completion"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">5.3 Latex-Suite <code class="literal">\cite</code> completion</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ls-completion-ref.html">Prev</a> </td><th width="60%" align="center">5 Latex Completion</th><td width="20%" align="right"> <a accesskey="n" href="ls-filename-completion.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="5.3 Latex-Suite \cite completion"><div class="titlepage"><div><div><h3 class="title"><a id="latex-completion-cite"></a>5.3 Latex-Suite <code class="literal">\cite</code> completion</h3></div></div></div><div class="toc"><dl><dt><span class="section"><a href="latex-completion-cite.html#cite-search-caching">5.3.1 Caching the <code class="literal">\cite</code> completion results</a></span></dt></dl></div><p> + Latex-Suite provides an easy way to insert references to bibliographic + entries. Pressing <code class="literal">&lt;F9&gt;</code> when the cursor is + placed inside a partially completed <code class="literal">\cite</code> command + will split open a new window (named <code class="literal">__OUTLINE__</code>) + which contains a formatted and syntax highlighted list of all bibtex + entries found. For example, pressing <code class="literal">&lt;F9&gt;</code> + after typing <code class="literal">\ref{</code> should present you with a window + which looks something like this: + </p><pre class="programlisting"> +Article [dickinson:science:99] + "Wing rotation and aerodynamic basis of insect flight" + M. H. Dickinson and F-O. Lehman and S. P. Sane + In Science, 1999 + +Article [ellington:84:part1] + "The Aerodynamics of Hovering Insect Flight. I. The Quasi-Steady Analysis" + Ellington, C P + In Philosophical Transactions of the Royal Society of London. Series B, Biological Sciences, 1984 + +Article [ellington:84:part2] + "The Aerodynamics of Hovering Insect Flight. II. Morphological Parameters" + Ellington, C P + In Philosophical Transactions of the Royal Society of London. Series B, Biological Sciences, 1984 + </pre><p> + </p><p> + You can easily jump from one entry to another using the + <code class="literal">'n'</code> and <code class="literal">'p'</code> keys (to go to the + next / previous entry respectively). + </p><p> + You can also filter out a subset of the bibtex entries by pressing + <code class="literal">'f'</code> while in this window. Doing this presents the + following prompt: + </p><pre class="programlisting"> +Field acronyms: (`:let g:Tex_EchoBibFields = 0` to avoid this message) + [t] title [a] author [b] booktitle + [j] journal [y] year [p] bibtype + (you can also enter the complete field name) +Enter filter criterion [field&lt;space&gt;value]: + </pre><p> + At the prompt, type + </p><pre class="programlisting">a ellington</pre><p> + Notice that the letter a is an acronym for <code class="literal">author</code> + according to the prompt above. Therefore this filter only shows those + bibtex entries whose author field contains the text + <code class="literal">ellington</code>. You can keep narrowing your selection by + repeatedly filtering the results. If you would like to remove all the + filters and see all entries again, press 'a', which removes + all the filters. + </p><p> + You can also sort the bibtex entries based on a field. To do this, + press 's'. This will present you with a prompt like in the case of the + filter and you are asked to choose a field. In this case, you would + type in a single character. This sorts the entries according to that + field. + </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> + <code class="literal">&lt;F9&gt;</code> will also work in a similar way after any + command which contains the word <code class="literal">cite</code> in it. For + example, pressing <code class="literal">&lt;F9&gt;</code> will also work with + <code class="literal">\citenum</code> etc. + </p></div><p> + The following logic is applied to find out which bibliographic entries + are included in the completion. + </p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p> + Firstly, if the present file has a <a class="link" href="latex-master-file.html" title="9.2 Specifying which file to compile">master-file</a> defined for it, then Latex-Suite + will perform the following steps on that file instead of on the + current file. + </p></li><li class="listitem"><p> + First, the file is scanned for a <code class="literal">\bibliography</code> + command. To explain better, assume that a command + </p><pre class="programlisting">\bibliography{file1,file2}</pre><p> is found + in the present file. For each bibliography file, say + <code class="literal">file1</code>, Latex-Suite first tries to see if a + <code class="literal">.bib</code> file, <code class="literal">file1.bib</code> can be + found. If so, it will scan it for bib-keys of the form + <code class="literal">@BOOK{</code> etc., and add these searches to the + completion list. If a <code class="literal">.bib</code> file cannot be found, + then it will try to see if <code class="literal">file1.bbl</code> can be found. + If so, Latex-Suite will search it for bib-keys of the form + <code class="literal">\bibitem</code> and add these to the completion list. + </p><p> + You can set the location where Latex-Suite will search for + <code class="literal">.bib</code> and <code class="literal">.bbl</code> files using the + <a class="link" href="customizing-latex-completion.html#Tex_BIBINPUTS" title="11.5.2 g:Tex_BIBINPUTS"><code class="literal">|Tex_BIBINPUTS|</code></a> + variable. + </p></li><li class="listitem"><p> + If a <code class="literal">\bibliography</code> command is not found, then Latex-Suite + tries to scan the present file for a + <code class="literal">\begin{thebibliography}</code> environment. If found, + Latex-Suite searches the present file for bib-keys of the form + <code class="literal">\bibitem</code>. + </p></li><li class="listitem"><p> + Finally, it will try to see if this file includes other files + via the <code class="literal">\input</code> command. For each such file found, + Latex-Suite will repeat the previous two steps stopping at the first file + which has either a <code class="literal">\bibliography</code> command or a + <code class="literal">thebibliography</code> environment. + </p></li></ol></div><div class="section" title="5.3.1 Caching the \cite completion results"><div class="titlepage"><div><div><h4 class="title"><a id="cite-search-caching"></a>5.3.1 Caching the <code class="literal">\cite</code> completion results</h4></div></div></div><a id="TClearCiteHist"></a><p> + Often times, the editing cycle proceeds by first laying out a + comprehensive bibliography and then completing all the + <code class="literal">\cite</code> commands in one session. In such situations, + it is inefficient to scan the whole list of bibliography files for + bib-keys each time. Latex-Suite provides a way to cache the results of the + cite completion search using the <a class="link" href="customizing-latex-completion.html#Tex_RememberCiteSearch" title="11.5.5 g:Tex_RememberCiteSearch"><code class="literal">Tex_RememberCiteSearch</code></a> + variable. If set, Latex-Suite will perform the search only the first time + <code class="literal">&lt;F9&gt;</code> is used. Next time on, it will reuse the + search results. If you wish to redo the search results, issue the + command + </p><pre class="programlisting">TClearCiteHist</pre><p> + This will redo the completion list next time you use + <code class="literal">&lt;F9&gt;</code>. + </p></div></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ls-completion-ref.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="latex-completion.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ls-filename-completion.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">5.2 Latex-Suite \ref completion </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 5.4 Latex-Suite filename completion</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite/latex-completion.html b/.vim/doc/latex-suite/latex-completion.html @@ -0,0 +1,36 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>5 Latex Completion</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="Latex-Suite Reference"></link><link rel="up" href="index.html" title="Latex-Suite Reference"></link><link rel="prev" href="supporting-packages.html" title="4.4 Writing supporting for a package"></link><link rel="next" href="ls-completion-usage.html" title="5.1 Latex-Suite completion example"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">5 Latex Completion</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="supporting-packages.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="ls-completion-usage.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="5 Latex Completion"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="latex-completion"></a>5 Latex Completion</h2></div></div></div><div class="toc"><dl><dt><span class="section"><a href="ls-completion-usage.html">5.1 Latex-Suite completion example</a></span></dt><dt><span class="section"><a href="ls-completion-ref.html">5.2 Latex-Suite \ref completion</a></span></dt><dt><span class="section"><a href="latex-completion-cite.html">5.3 Latex-Suite <code class="literal">\cite</code> completion</a></span></dt><dt><span class="section"><a href="ls-filename-completion.html">5.4 Latex-Suite filename completion</a></span></dt><dt><span class="section"><a href="ls-completion-custom.html">5.5 Custom command completion</a></span></dt></dl></div><p> + Latex-Suite provides an easy way to insert references to labels and + bibliographic entries and also provide filename arguments to commands + such as <code class="literal">\includegraphics</code>. Although the completion + capabilities are very diverse, Latex-Suite only uses a single key + (<code class="literal">&lt;F9&gt;</code> by default) to do all of it. Pressing the + <code class="literal">&lt;F9&gt;</code> key does different things based on where + you are located. Latex-Suite tries to guess what you might be trying to + complete at the location where you pressed + <code class="literal">&lt;F9&gt;</code>. For example, pressing + <code class="literal">&lt;F9&gt;</code> when you are within a + <code class="literal">\ref</code> command will try to list the + <code class="literal">\label</code>'s in the present directory. Pressing it when + you are in a <code class="literal">\cite</code> command will list bibliography + keys. Latex-Suite also recognizes commands which need a file name argument and + will put up an explorer window for you to choose a filename. + </p><div class="note" title="Before you start with Latex-Suite's completion function..." style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title"><a id="ls-set-grepprg"></a>Before you start with Latex-Suite's completion function...</h3><p> + All of Latex-Suite's completion capabilities depend on a external program + being available on your system which can search through a number of + files for a reg-exp pattern. On *nix systems, the pre-installed + <code class="literal">grep</code> utility is more than adequate. Most windows + systems come with a utility <code class="literal">findstr</code>, but that has + proven to be very inadequate (for one, it does not have an option to + force the file name to be displayed when searching through a single + file). Your best bet is to install <a class="ulink" href="http://www.cygwin.com" target="_top">cygwin</a>, but if you think that's + overkill, you can <a class="ulink" href="http://www.google.com/search?q=windows%20gnu%20grep" target="_top">search + for</a> a windows implementation of GNU grep. (Latex-Suite testing on + windows has been done with cygwin's port of GNU grep). + </p><p> + Once you have a <code class="literal">grep</code> program installed, you need to + set the <code class="literal">'grepprg'</code> option for vim. Make sure you use a + setting which forces the program to display file names even when you are + searching through a single file. For GNU grep, the syntax is + </p><pre class="programlisting">set grepprg=grep\ -nH\ $*</pre><p> + </p></div></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="supporting-packages.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="ls-completion-usage.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">4.4 Writing supporting for a package </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 5.1 Latex-Suite completion example</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite/latex-folding.html b/.vim/doc/latex-suite/latex-folding.html @@ -0,0 +1,34 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>8 Latex Folding</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="Latex-Suite Reference"></link><link rel="up" href="index.html" title="Latex-Suite Reference"></link><link rel="prev" href="inverse-searching.html" title="7.3 Inverse Searching"></link><link rel="next" href="default-folding.html" title="8.1 Default Folding Scheme in Latex-Suite"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">8 Latex Folding</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="inverse-searching.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="default-folding.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="8 Latex Folding"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="latex-folding"></a>8 Latex Folding</h2></div></div></div><div class="toc"><dl><dt><span class="section"><a href="default-folding.html">8.1 Default Folding Scheme in Latex-Suite</a></span></dt><dt><span class="section"><a href="customizing-what-to-fold.html">8.2 Customizing what to fold</a></span></dt><dt><span class="section"><a href="editing-folding.html">8.3 Editing the folding.vim file directly</a></span></dt></dl></div><p> + Latex-Suite ships with the plugin SyntaxFolds.vim which is a plugin for + creating "fake" syntax folds on the fly. The fold method is actually manual + but the folding is based on LaTeX syntax. This offers a speed increase over + regular syntax folding. Ofcourse it has the disadvantage that the folds are + not dynamic, i.e newly created syntax items are not automatically folded up. + (This is a compromise between speed and convenience). + </p><p> + When you open up a LaTeX file, all the portions will be automatically folded + up. However, no new folds will be created until you press + <code class="literal">&lt;F6&gt;</code> or <code class="literal">\rf</code>. (rf + stands for "refresh folds"). + </p><p> + The fold-text is set to the first line of the folded text unless the fold is a + table, figure etc. (an environment). In this case, if a \caption and/or a + label is found in the folded region, then those are used to make a more + meaningful fold-text, otherwise the second line of the environment is displayed + along with the name of the environment. In other words, the following + </p><pre class="programlisting">\begin{figure}[h] + \centerline{\psfig{figure=slidercrank.eps,height=6cm}} + \caption{The Slider Crank Mechanism.} + \label{fig:slidercrank} +\end{figure} +% a LaTeX comment. +\begin{eqnarray} + \sin(\pi) = 0 +\end{eqnarray}</pre><p> + </p><p> + will be shown as: + </p><pre class="programlisting">+--- 5 lines: figure (fig:slidercrank) : The Slider Crank Mechanism. ----- +% a LaTeX comment. ++--- 3 lines: eqnarray () : \sin(\pi) = 0 --------------------------------</pre><p> + </p></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="inverse-searching.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="default-folding.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">7.3 Inverse Searching </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 8.1 Default Folding Scheme in Latex-Suite</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite/latex-macros.html b/.vim/doc/latex-suite/latex-macros.html @@ -0,0 +1,70 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>3 Latex-Suite Macros</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="Latex-Suite Reference"></link><link rel="up" href="index.html" title="Latex-Suite Reference"></link><link rel="prev" href="latex-suite-templates.html" title="2 Inserting Templates"></link><link rel="next" href="environment-mappings.html" title="3.1 Environment Mappings"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">3 Latex-Suite Macros</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="latex-suite-templates.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="environment-mappings.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="3 Latex-Suite Macros"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="latex-macros"></a>3 Latex-Suite Macros</h2></div></div></div><div class="toc"><dl><dt><span class="section"><a href="environment-mappings.html">3.1 Environment Mappings</a></span></dt><dt><span class="section"><a href="latex-command-maps.html">3.2 Command Mappings</a></span></dt><dt><span class="section"><a href="font-maps.html">3.3 Font Mappings</a></span></dt><dt><span class="section"><a href="section-mappings.html">3.4 Section Mappings</a></span></dt><dt><span class="section"><a href="greek-letter-mappings.html">3.5 Greek Letter Mappings</a></span></dt><dt><span class="section"><a href="auc-tex-mappings.html">3.6 Auc-Tex Key Bindings</a></span></dt><dt><span class="section"><a href="diacritic-mappings.html">3.7 Diacritics</a></span></dt><dt><span class="section"><a href="bibtex-bindings.html">3.8 BibTeX Shortcuts</a></span></dt><dt><span class="section"><a href="smart-keys.html">3.9 Smart Key Mappings</a></span></dt><dt><span class="section"><a href="altkey-mappings.html">3.10 Alt Key Macros</a></span></dt><dt><span class="section"><a href="custom-macros-menu.html">3.11 Custom Macros</a></span></dt><dt><span class="section"><a href="ls-new-macros.html">3.12 Making your own Macros via <code class="literal">IMAP()</code></a></span></dt></dl></div><p> + Latex-Suite ships with a very comprehensive set of insert mode and + |visual-mode| mappings and menu items to typeset most of the LaTeX + elements. + </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> + These mappings are are not standard mappings in the sense that + only the last character is mapped. See plugin/imaps.vim for + further documentation. For example, in the case of the mapping + <code class="literal">EFI</code> provided by Latex-Suite you can press the characters + '<code class="literal">E</code>', '<code class="literal">F</code>' and '<code class="literal">I</code>' + as slowly as you wish (unlike the normal <code class="literal">imap</code> command + where <code class="literal">timeout</code> issues are involved). The characters are + visible as you type them (unlike normal <code class="literal">imap</code>s) and you + can use the movement or backspace key to correct yourself unlike normal + mappings. + </p></div><a id="place-holder"></a><div class="note" title="Place Holders" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title"><a id="place-holders"></a>Place Holders</h3><p> + Almost all macros provided in Latex-Suite implement Stephen Riem's bracketing + system and Gergely Kontra's <code class="literal">JumpFunc()</code> for handling + place-holders. This consists of using "place-holders" to mark off + locations where the next relevant editing has to be done. As an example, + when you type <code class="literal">EFI</code> in |insert-mode|, you will get the + following: + </p><pre class="programlisting">\begin{figure}[h] + \centerline{\psfig{figure=&lt;+eps file+&gt;}} + \caption{&lt;+caption text+&gt;} + \label{fig:&lt;+label+&gt;} +\end{figure}&lt;++&gt;</pre><p> + The text <code class="literal">&lt;+eps file+&gt;</code> will be selected and + you will be left in |select-mode| so that you can continue typing + straight away. After having typed in the file name, you can press + <code class="literal">&lt;Ctrl-J&gt;</code> (while still in insert-mode). This will + take you directly to the next "place-holder". i.e, <code class="literal">&lt;+caption + text+&gt;</code> will be visually selected with Vim in select mode + again for typing in the caption. This saves on a lot of key presses. + </p></div><div class="note" title="Over-riding Latex-Suite Macros" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title"><a id="overriding-macros"></a>Over-riding Latex-Suite Macros</h3><p> + If you wish to change these macros from their default values, for + example, if you wish to change <code class="literal">`w</code> to expand to + <code class="literal">\omega</code> instead of its default expansion to + <code class="literal">\wedge</code>, you should use the <code class="literal">IMAP</code> + function as described in the <a class="link" href="ls-new-macros.html" title="3.12 Making your own Macros via IMAP()">Using + IMAP()</a> section. + </p><p> + An important thing to note is that if you wish to over-ride macros + created by Latex-Suite rather than merely create new macros, you should place + the <code class="literal">IMAP()</code> calls in a script which gets sourced + after the files in Latex-Suite. A good place typically is as a file-type + plugin file in the + <code class="literal">~/.vim/after/ftplugin/</code> directory. (Use + <code class="literal">~/vimfiles</code> if you are using + <code class="literal">WINDOWS</code>). For example to over-ride + <code class="literal">`w</code> to <code class="literal">\omega</code> instead of + <code class="literal">\wedge</code>, place the following line in (say) + <code class="literal">~/.vim/after/ftplugin/tex_macros.vim</code>: + </p><pre class="programlisting">call IMAP('`w', '\omega', 'tex')</pre><p> + </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> + It is important to use a file-name which will get sourced on a + <code class="literal">FileType</code> event. Therefore you must use a file-name + which conforms to the standards as described in + <code class="literal">|ftplugin-name|</code>. + </p></div></div><div class="note" title="Pausing Macro expansion" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title"><a id="pausing-imaps"></a>Pausing Macro expansion</h3><p> + If you wish to temporarily suspend the imaps functionality, then you + can set the <code class="literal">Imap_FreezeImap</code> to 1. If you set + <code class="literal">g:Imap_FreezeImap</code> to 1, then it will be a + system-wide setting. Setting <code class="literal">b:Imap_FreezeImap</code> will + affect only the current buffer. + </p></div><p> + The following sections describe the various editing macros provided + by Latex-Suite. + </p></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="latex-suite-templates.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="environment-mappings.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">2 Inserting Templates </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 3.1 Environment Mappings</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite/latex-master-file.html b/.vim/doc/latex-suite/latex-master-file.html @@ -0,0 +1,31 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>9.2 Specifying which file to compile</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="Latex-Suite Reference"></link><link rel="up" href="latex-project.html" title="9 Multiple file LaTeX projects"></link><link rel="prev" href="latex-project-settings.html" title="9.1 Latex-Suite project settings"></link><link rel="next" href="latex-suite-commands-maps.html" title="10 Latex-Suite Commands and Maps"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">9.2 Specifying which file to compile</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="latex-project-settings.html">Prev</a> </td><th width="60%" align="center">9 Multiple file LaTeX projects</th><td width="20%" align="right"> <a accesskey="n" href="latex-suite-commands-maps.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="9.2 Specifying which file to compile"><div class="titlepage"><div><div><h3 class="title"><a id="latex-master-file"></a>9.2 Specifying which file to compile</h3></div></div></div><p> + In the example described <a class="link" href="latex-project.html#latex-project-example">previously</a>, if you are editing + <code class="literal">intro/intro.tex</code> and press <code class="literal">\ll</code>, + then you still want Latex-Suite to compile <code class="literal">main.tex</code>, + because <code class="literal">intro/intro.tex</code> is merely a fragment which + is <code class="literal">\input</code>'ed into <code class="literal">main.tex</code>. If + the master file is already specified using the + <code class="literal">*.latexmain</code> convention described <a class="link" href="latex-project.html#latex-project-example">previously</a>, then Latex-Suite will automatically + compile the master file when you are editing any of its + <code class="literal">\input</code>'ed fragments. Thus pressing + <code class="literal">\ll</code> while editing <code class="literal">intro/intro.tex</code> + will compile <code class="literal">main.tex</code>. + </p><a id="Tex_MainFileExpression"></a><p> + If you wish to use some different logic to specify the main file name, + you can specify a custom expression via the + <code class="literal">Tex_MainFileExpression</code> variable. This is a string + containing a valid vim expression. In addition, you can use a variable + <code class="literal">modifier</code> which is in the format used for + <code class="literal">|filename-modifiers|</code>, for example, + <code class="literal">':p:h'</code>. You should utilize this variable to modify + the filename of the main file. + </p><pre class="programlisting">let g:Tex_MainFileExpression = 'MainFile(modifier)' +function! MainFile(fmod) + if glob('*.latexmain') != '' + return fnamemodify(glob('*.latexmain'), a:fmod) + else + return '' + endif +endif</pre><p> + </p></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="latex-project-settings.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="latex-project.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="latex-suite-commands-maps.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">9.1 Latex-Suite project settings </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 10 Latex-Suite Commands and Maps</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite/latex-packages.html b/.vim/doc/latex-suite/latex-packages.html @@ -0,0 +1,18 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>4 Package Handling</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="Latex-Suite Reference"></link><link rel="up" href="index.html" title="Latex-Suite Reference"></link><link rel="prev" href="ls-new-macros.html" title="3.12 Making your own Macros via IMAP()"></link><link rel="next" href="inserting-packages.html" title="4.1 Inserting package commands"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">4 Package Handling</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ls-new-macros.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="inserting-packages.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="4 Package Handling"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="latex-packages"></a>4 Package Handling</h2></div></div></div><div class="toc"><dl><dt><span class="section"><a href="inserting-packages.html">4.1 Inserting package commands</a></span></dt><dt><span class="section"><a href="package-actions.html">4.2 Actions taken for supported packages</a></span></dt><dt><span class="section"><a href="automatic-package-detection.html">4.3 Automatic Package detection</a></span></dt><dt><span class="section"><a href="supporting-packages.html">4.4 Writing supporting for a package</a></span></dt></dl></div><p> + Latex-Suite has a lot of functionality written to ease working with packages. + Packages here refers to files which you include into the LaTeX + document using the <code class="literal">\usepackage</code> command. + </p><p> + In addition, the <code class="literal">TeX-Suite &gt; Packages</code> menu also + contains the following submenus + </p><p title="Update"><b>Update. </b> + This command is to be invoked with the cursor placed on the package + name. If the corresponding package is found, then a sub-menu with the + supported commands and options is created. + </p><p title="Update All"><b>Update All. </b> + This function reads the preamble of the document for + <code class="literal">\usepackage</code> lines and if Latex-Suite supports the detected + packages, then sub-menus containing the package options and commands + are created. + </p></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ls-new-macros.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="inserting-packages.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">3.12 Making your own Macros via <code class="literal">IMAP()</code> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 4.1 Inserting package commands</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite/latex-project-settings.html b/.vim/doc/latex-suite/latex-project-settings.html @@ -0,0 +1,11 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>9.1 Latex-Suite project settings</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="Latex-Suite Reference"></link><link rel="up" href="latex-project.html" title="9 Multiple file LaTeX projects"></link><link rel="prev" href="latex-project.html" title="9 Multiple file LaTeX projects"></link><link rel="next" href="latex-master-file.html" title="9.2 Specifying which file to compile"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">9.1 Latex-Suite project settings</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="latex-project.html">Prev</a> </td><th width="60%" align="center">9 Multiple file LaTeX projects</th><td width="20%" align="right"> <a accesskey="n" href="latex-master-file.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="9.1 Latex-Suite project settings"><div class="titlepage"><div><div><h3 class="title"><a id="latex-project-settings"></a>9.1 Latex-Suite project settings</h3></div></div></div><p> + If a <a class="link" href="latex-master-file.html" title="9.2 Specifying which file to compile">master file</a> is found, + then Latex-Suite <code class="literal">:source</code>s the file. Thus this file needs to + contain valid Vim commands. This file is typically used to store + project specific settings. + </p><p> + Some typical per-project settings which are best put in the master file + are + </p><table border="0" summary="Simple list" class="simplelist"><tr><td><a class="link" href="customizing-latex-completion.html#Tex_ProjectSourceFiles" title="11.5.4 g:Tex_ProjectSourceFiles">Tex_ProjectSourceFiles</a></td></tr></table><p> + </p></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="latex-project.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="latex-project.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="latex-master-file.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">9 Multiple file LaTeX projects </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 9.2 Specifying which file to compile</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite/latex-project.html b/.vim/doc/latex-suite/latex-project.html @@ -0,0 +1,57 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>9 Multiple file LaTeX projects</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="Latex-Suite Reference"></link><link rel="up" href="index.html" title="Latex-Suite Reference"></link><link rel="prev" href="editing-folding.html" title="8.3 Editing the folding.vim file directly"></link><link rel="next" href="latex-project-settings.html" title="9.1 Latex-Suite project settings"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">9 Multiple file LaTeX projects</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="editing-folding.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="latex-project-settings.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="9 Multiple file LaTeX projects"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="latex-project"></a>9 Multiple file LaTeX projects</h2></div></div></div><div class="toc"><dl><dt><span class="section"><a href="latex-project-settings.html">9.1 Latex-Suite project settings</a></span></dt><dt><span class="section"><a href="latex-master-file.html">9.2 Specifying which file to compile</a></span></dt></dl></div><a id="latex-project-example"></a><p> + Many LaTeX projects contain multiple source files which are + <code class="literal">\include</code>d from a master file. A typical example of + this situation is a directory layout such as the following + </p><p> + </p><pre class="programlisting">thesis/ + main.tex + abstract.tex + intro/ + intro.tex + figures/ + fig1.eps + fig2.eps + chapter1/ + chap1.tex + figures/ + fig1.eps + conclusion/ + conclusion.tex + figures/</pre><p> + </p><p> + In the above case, <code class="literal">main.tex</code> will typically look like + </p><p> + </p><pre class="programlisting">% file: main.tex +\documentclass{report} +\begin{document} + +\input{abstract.tex} +\input{intro/intro.tex} +\input{chapter1/chap1.tex} +\input{conclusion/conclusion.tex} + +\end{document}</pre><p> + </p><p> + <a id="latex-master-file-specification"></a> In such situations, you will + need to convey to Latex-Suite that <code class="literal">main.tex</code> is the main file + which <code class="literal">\input</code>s the other files. This is done by creating + an empty file called <code class="literal">main.tex.latexmain</code> in the same + directory in which <code class="literal">main.tex</code> resides. This file is called + the <span class="emphasis"><em>master file</em></span> in this manual. See <a class="link" href="latex-master-file.html#Tex_MainFileExpression">Tex_MainFileExpression</a> for an + alternative way of specifying the master file. + </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> + Here <code class="literal">main.tex.latexmain</code> is (obviously) a different + file from <code class="literal">main.tex</code> itself. + <code class="literal">main.tex</code> need not be renamed. This ofcourse + restricts each directory to have a single master file. + </p></div><p> + Each time Latex-Suite opens a new LaTeX file, it will try to see if it is + part of a multiple file project by searching upwards (to the root of + the file-system) from the current file's directory to see if it finds a + file of the form <code class="literal">*.latexmain</code>. If such a file is + found, then it is considered that the current file is part of a larger + project. The name of the LaTeX master file is inferred directly from + the first part of the <code class="literal">*.latexmain</code> file as described + in the example above. + </p></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="editing-folding.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="latex-project-settings.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">8.3 Editing the folding.vim file directly </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 9.1 Latex-Suite project settings</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite/latex-suite-commands-maps.html b/.vim/doc/latex-suite/latex-suite-commands-maps.html @@ -0,0 +1,6 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>10 Latex-Suite Commands and Maps</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="Latex-Suite Reference"></link><link rel="up" href="index.html" title="Latex-Suite Reference"></link><link rel="prev" href="latex-master-file.html" title="9.2 Specifying which file to compile"></link><link rel="next" href="latex-suite-maps.html" title="10.1 Latex-Suite Maps"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">10 Latex-Suite Commands and Maps</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="latex-master-file.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="latex-suite-maps.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="10 Latex-Suite Commands and Maps"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="latex-suite-commands-maps"></a>10 Latex-Suite Commands and Maps</h2></div></div></div><div class="toc"><dl><dt><span class="section"><a href="latex-suite-maps.html">10.1 Latex-Suite Maps</a></span></dt><dt><span class="section"><a href="latex-suite-commands.html">10.2 Latex Suite Commands</a></span></dt></dl></div><p> + This section describes the maps and commands used in Latex-Suite. It also + describes a way to change the map sequences according to your + preference. + </p></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="latex-master-file.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="latex-suite-maps.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">9.2 Specifying which file to compile </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 10.1 Latex-Suite Maps</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite/latex-suite-commands.html b/.vim/doc/latex-suite/latex-suite-commands.html @@ -0,0 +1,148 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>10.2 Latex Suite Commands</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="Latex-Suite Reference"></link><link rel="up" href="latex-suite-commands-maps.html" title="10 Latex-Suite Commands and Maps"></link><link rel="prev" href="latex-suite-maps.html" title="10.1 Latex-Suite Maps"></link><link rel="next" href="customizing-latex-suite.html" title="11 Customizing Latex-Suite"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">10.2 Latex Suite Commands</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="latex-suite-maps.html">Prev</a> </td><th width="60%" align="center">10 Latex-Suite Commands and Maps</th><td width="20%" align="right"> <a accesskey="n" href="customizing-latex-suite.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="10.2 Latex Suite Commands"><div class="titlepage"><div><div><h3 class="title"><a id="latex-suite-commands"></a>10.2 Latex Suite Commands</h3></div></div></div><div class="toc"><dl><dt><span class="section"><a href="latex-suite-commands.html#TMacro">10.2.1 :TMacro [{macro}]</a></span></dt><dt><span class="section"><a href="latex-suite-commands.html#TMacroEdit">10.2.2 :TMacroEdit [{macro}]</a></span></dt><dt><span class="section"><a href="latex-suite-commands.html#TMacroNew">10.2.3 :TMacroNew</a></span></dt><dt><span class="section"><a href="latex-suite-commands.html#TMacroDelete">10.2.4 :TMacroDelete [{macro}]</a></span></dt><dt><span class="section"><a href="latex-suite-commands.html#TPackage">10.2.5 :TPackage [{package, ...}]</a></span></dt><dt><span class="section"><a href="latex-suite-commands.html#TPackageUpdate">10.2.6 :TPackageUpdate</a></span></dt><dt><span class="section"><a href="latex-suite-commands.html#TPackageUpdateAll">10.2.7 :TPackageUpdateAll</a></span></dt><dt><span class="section"><a href="latex-suite-commands.html#TTemplate">10.2.8 :TTemplate [{template}]</a></span></dt><dt><span class="section"><a href="latex-suite-commands.html#TSection">10.2.9 :TSection [{argument}]</a></span></dt><dt><span class="section"><a href="latex-suite-commands.html#TSectionAdvanced">10.2.10 :TSectionAdvanced</a></span></dt><dt><span class="section"><a href="latex-suite-commands.html#TLook">10.2.11 :TLook</a></span></dt><dt><span class="section"><a href="latex-suite-commands.html#TLookBib">10.2.12 :TLookBib</a></span></dt><dt><span class="section"><a href="latex-suite-commands.html#TLookAll">10.2.13 :TLookAll</a></span></dt><dt><span class="section"><a href="latex-suite-commands.html#TPartComp">10.2.14 :TPartComp</a></span></dt><dt><span class="section"><a href="latex-suite-commands.html#TPartView">10.2.15 :TPartView</a></span></dt><dt><span class="section"><a href="latex-suite-commands.html#Tshortcuts">10.2.16 :Tshortcuts [{arg}]</a></span></dt></dl></div><div class="section" title="10.2.1 :TMacro [{macro}]"><div class="titlepage"><div><div><h4 class="title"><a id="TMacro"></a>10.2.1 :TMacro [{macro}]</h4></div></div></div><p> + When used without any arguments lists all available macros defined + in runtime ftplugin/latex-suite/macros/ directories and prompts you + to choose one of them. With one argument |:read| this macro under + cursor position. With more than one argument it will not work :) In + Vim &gt;= 6.2 works completion of names of macros (see 'wildmenu', + 'wildmode' for more about command-line completion). + </p></div><div class="section" title="10.2.2 :TMacroEdit [{macro}]"><div class="titlepage"><div><div><h4 class="title"><a id="TMacroEdit"></a>10.2.2 :TMacroEdit [{macro}]</h4></div></div></div><p> + Splits window for editing {macro}. When used without any arguments + lists all available macros defined in runtime + ftplugin/latex-suite/macros/ directories and prompt you to choose + one of them. When you try to edit {macro} not from local directory + Latex-Suite will copy it to your local directory with suffix + "-local". If local copy already exists Latex-Suite prompt for + overwriting it. In Vim &gt;= 6.2 works completion of names of macros + (see 'wildmenu', 'wildmode' for more about command-line completion). + </p></div><div class="section" title="10.2.3 :TMacroNew"><div class="titlepage"><div><div><h4 class="title"><a id="TMacroNew"></a>10.2.3 :TMacroNew</h4></div></div></div><p> + Splits window to write new macro. Directory in new buffer is + locally changed to Latex-Suite/macros/. + </p></div><div class="section" title="10.2.4 :TMacroDelete [{macro}]"><div class="titlepage"><div><div><h4 class="title"><a id="TMacroDelete"></a>10.2.4 :TMacroDelete [{macro}]</h4></div></div></div><p> + Delets {macro} from your local ftplugin/latex-suite/macros/ + directory. When used without any arguments lists all available + macros defined in Latex-Suite/macros/ directory and prompt you to + choose one of them. When you choose to delete {macro} which is not + in your local directory Latex-Suite will refuse to delete it. In + Vim &gt;= 6.2 works completion of names of macros (see 'wildmenu', + 'wildmode' for more about command-line completion) + </p></div><div class="section" title="10.2.5 :TPackage [{package, ...}]"><div class="titlepage"><div><div><h4 class="title"><a id="TPackage"></a>10.2.5 :TPackage [{package, ...}]</h4></div></div></div><p> + When used without any arguments lists name of the packages for + which support is available. If you are using Vim GUI and have + <code class="literal">Tex_Menus</code> set to 1, then it will list all files + found in the <code class="literal">$VIM/ftplugin/latex-suite/packages</code> + directory. Otherwise, Latex-Suite will list files found in the + <code class="literal">$VIM/ftplugin/latex-suite/dictionaries</code> directory. + Choosing a file from the list will insert a + </p><pre class="programlisting">\usepackage[&lt;++&gt;]{&lt;packname&gt;}</pre><p> line into the + buffer at the current cursor location. For Vim 6.2 and above, you + can use command-line completion to choose a package file. You can also + call <code class="literal">TPackage</code> with one or more package names + separated with spaces in which case, Latex-Suite will insert + <code class="literal">\usepackage</code> lines for each of them in turn. + </p><p> + After inserting the <code class="literal">\usepackage</code> line(s), Latex-Suite will + support it (them) in various ways as described in the section <a class="link" href="package-actions.html" title="4.2 Actions taken for supported packages">Actions taken for supported + packages</a>. + </p></div><div class="section" title="10.2.6 :TPackageUpdate"><div class="titlepage"><div><div><h4 class="title"><a id="TPackageUpdate"></a>10.2.6 :TPackageUpdate</h4></div></div></div><p> + This command `reads' name of package under cursor and turns on + possible support. + </p></div><div class="section" title="10.2.7 :TPackageUpdateAll"><div class="titlepage"><div><div><h4 class="title"><a id="TPackageUpdateAll"></a>10.2.7 :TPackageUpdateAll</h4></div></div></div><p> + After issuing this command latexSuite scans the file in + looking for not declared packages, removing not needed entries + from Packages menu and turning off not necessary packages' + dictionaries. + </p></div><div class="section" title="10.2.8 :TTemplate [{template}]"><div class="titlepage"><div><div><h4 class="title"><a id="TTemplate"></a>10.2.8 :TTemplate [{template}]</h4></div></div></div><p> + When used without any arguments lists all available templates + from latex-suite/templates/ directory and prompts to choose + one of them. + With one argument :0|read| {template} file. + With more than one argument it will not work :) + In Vim &gt;= 6.2 works completion of names of macros (see 'wildmenu', + 'wildmode' for more about command-line completion) + </p></div><div class="section" title="10.2.9 :TSection [{argument}]"><div class="titlepage"><div><div><h4 class="title"><a id="TSection"></a>10.2.9 :TSection [{argument}]</h4></div></div></div><p> + Used without any arguments inserts last section type + (|latex-sectioning|). + Accepts arguments: + n&gt; inserts section name in &lt;n&gt; logical level. + Levels are: + </p><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>0</td><td>part</td></tr><tr><td>1</td><td>chapter</td></tr><tr><td>2</td><td>section</td></tr><tr><td>3</td><td>subsection</td></tr><tr><td>4</td><td>subsubsection</td></tr><tr><td>5</td><td>paragraph</td></tr><tr><td>6</td><td>subparagraph</td></tr></tbody></table></div><p> + + </p><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td> + +&lt;n&gt; + </td><td> + inserts section name &lt;n&gt; logical levels above the last + used comand + </td></tr><tr><td> + -&lt;n&gt; + </td><td> + inserts section name &lt;n&gt; logical levels below the last + used comand + </td></tr><tr><td> + + + </td><td> + inserts section name one logical level below the last + used command (equal to +1). + </td></tr><tr><td> + ++ + </td><td> + inserts section name two logical levels below the last + used command (equal to +2). + </td></tr><tr><td> + - + </td><td> + inserts section name one logical level over the last + used command (equal to -1). + </td></tr><tr><td> + -- + </td><td> + inserts section name two logical levels over the last + used command (equal to -2). + </td></tr></tbody></table></div><p> + + Command accepts also latexSuite mappings (|latex-macros|) + without preceding S and in lowercase: + </p><pre class="programlisting">:TSection pa</pre><p> + will result in <code class="literal">\part{}</code>. It is possible to use full names of + sections: <code class="literal">:TSection part</code> + </p></div><div class="section" title="10.2.10 :TSectionAdvanced"><div class="titlepage"><div><div><h4 class="title"><a id="TSectionAdvanced"></a>10.2.10 :TSectionAdvanced</h4></div></div></div><p> + Accepts the same arguments as |TSection| but leads to a couple + of questions (whether you want to include the section in the + table of contents, whether there is a shorter name for the + table of contents) and then creates a more intelligent + template. + </p></div><div class="section" title="10.2.11 :TLook"><div class="titlepage"><div><div><h4 class="title"><a id="TLook"></a>10.2.11 :TLook</h4></div></div></div><p> + Accepts one argument. Will look through .tex files in + directory of edited file for argument. It can be regexp. You + don't have to enclose argument in "". &lt;cr&gt; takes you to + location. Other keys work as described in |latex-viewer|. + Note: TLook uses :grep command and is using 'grepprg'. Its + regular expressions can be different from those of Vim. + </p></div><div class="section" title="10.2.12 :TLookBib"><div class="titlepage"><div><div><h4 class="title"><a id="TLookBib"></a>10.2.12 :TLookBib</h4></div></div></div><p> + Accepts one argument. Will look through .bib files in + directory of edited file for argument. It can be regexp. You + don't have to enclose argument in "". &lt;cr&gt; takes you to + location. Other keys work as described in |latex-viewer|. + </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> + TLookBib uses :grep command and is using 'grepprg'. Its + regular expressions can be different from those of Vim. + </p></div></div><div class="section" title="10.2.13 :TLookAll"><div class="titlepage"><div><div><h4 class="title"><a id="TLookAll"></a>10.2.13 :TLookAll</h4></div></div></div><p> + Accepts one argument. Will look through all files in directory + of edited file for argument. It can be regexp. You don't have + to enclose argument in "". &lt;cr&gt; takes you to location. Other + keys work as described in |latex-viewer|. + Note: TLook uses :grep command and is using 'grepprg'. Its + regular expressions can be different from those of Vim. + </p></div><div class="section" title="10.2.14 :TPartComp"><div class="titlepage"><div><div><h4 class="title"><a id="TPartComp"></a>10.2.14 :TPartComp</h4></div></div></div><p> + No argument allowed but accepts range in all formats. Define + fragment of interest with :'a,'b, :/a/,/b/, :'&lt;,'&gt; or :20,30. + All other rules of compilation apply. + </p></div><div class="section" title="10.2.15 :TPartView"><div class="titlepage"><div><div><h4 class="title"><a id="TPartView"></a>10.2.15 :TPartView</h4></div></div></div><p> + Show last compiled fragment. All rules of viewing apply but + |latex-searching|. + </p></div><div class="section" title="10.2.16 :Tshortcuts [{arg}]"><div class="titlepage"><div><div><h4 class="title"><a id="Tshortcuts"></a>10.2.16 :Tshortcuts [{arg}]</h4></div></div></div><p> + Show shortcuts in terminal (not using menu). Without {arg} + you will see simple menu prompting for one of them. Possible + arguments: + </p><div class="informaltable"><table border="0"><colgroup><col></col><col></col></colgroup><tbody><tr><td>g</td><td>General shortcuts</td></tr><tr><td>e</td><td>Environment shortcuts</td></tr><tr><td>f</td><td>Font shortcuts</td></tr><tr><td>s</td><td>Section shortcuts</td></tr><tr><td>m</td><td>Math shortcuts</td></tr><tr><td>a</td><td>All shortcuts</td></tr></tbody></table></div><p> + </p></div></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="latex-suite-maps.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="latex-suite-commands-maps.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="customizing-latex-suite.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">10.1 Latex-Suite Maps </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 11 Customizing Latex-Suite</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite/latex-suite-credits.html b/.vim/doc/latex-suite/latex-suite-credits.html @@ -0,0 +1,80 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>12 Credits</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="Latex-Suite Reference"></link><link rel="up" href="index.html" title="Latex-Suite Reference"></link><link rel="prev" href="customizing-packages.html" title="11.10 Package Handling Customization"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">12 Credits</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="customizing-packages.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> </td></tr></table><hr></hr></div><div class="section" title="12 Credits"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="latex-suite-credits"></a>12 Credits</h2></div></div></div><p> + And finally, the credits: + </p><div class="informaltable"><table border="0"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Artur R. Czechowski</td><td>maintains the BSD package of Latex-Suite. Lots of valuable + feedback.</td></tr><tr><td> + Lubomir Host + </td><td> + provided the diacritics and also helped in development. + + </td></tr><tr><td> + Alexander Wagner + </td><td> + valuable suggestions during development. + + </td></tr><tr><td> + Luc Hermitte + </td><td> + his variation of Stephen Riehm's bracketing system is used + in Latex-Suite. + + </td></tr><tr><td> + Gergely Kontra + </td><td> + the clever little JumpFunc() in imaps.vim is due to him. + The implementation of the templates also borrows from + mu-template.vim by him. + + </td></tr><tr><td> + Dimitri Antoniou + </td><td> + author of ltags and also provided the nice tip about + forward / reverse search on DVI documents. + + </td></tr><tr><td> + Stephen Riehm + </td><td> + the extremely helpful bracketing system is from him. + + </td></tr><tr><td> + Alan Schmitt + </td><td> + provided macros/folding elements. Continued feedback, + bug-reports/fixes. + + </td></tr><tr><td> + Hari Krishna Dara + </td><td> + for ExecMap(), the clever little function which makes + typing visual mode mappings so much easier and error-free. + + </td></tr><tr><td> + Alan G Isac + </td><td> + for the comprehensive BibT() function for entering bibtex + entries. + + </td></tr><tr><td> + Gontran Baerts + </td><td> + for libList.vim + + </td></tr><tr><td> + Peter Heslin + </td><td> + useful discussion and also a lot of bug fixes. + the %%fakesection in folding.vim. + + </td></tr><tr><td> + Zhang Lin-bo + </td><td> + lots of very useful additions to folding. The code for customizing + the folding scheme is due to him. + </td></tr></tbody></table></div><p> + A large number of functions in Latex-Suite come from various other people. + Some of those people might have been missed here. Each function should however + have the author's name/e-mail above it. Thats the more authoritative place to + check out who has done what. + </p><a id="latex-suite-maintainer"></a><p> + The current maintainer(s) of Latex-Suite is(are) + </p><table border="0" summary="Simple list" class="simplelist"><tr><td>Srinath Avadhanula &lt;srinath@fastmail.fm&gt;</td></tr><tr><td>Mikolaj Machowski &lt;mikmach@wp.pl&gt;</td></tr><tr><td>Benji Fisher &lt;benji@member.AMS.org&gt;</td></tr></table></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="customizing-packages.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> </td></tr><tr><td width="40%" align="left" valign="top">11.10 Package Handling Customization </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> </td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite/latex-suite-maps.html b/.vim/doc/latex-suite/latex-suite-maps.html @@ -0,0 +1,52 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>10.1 Latex-Suite Maps</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="Latex-Suite Reference"></link><link rel="up" href="latex-suite-commands-maps.html" title="10 Latex-Suite Commands and Maps"></link><link rel="prev" href="latex-suite-commands-maps.html" title="10 Latex-Suite Commands and Maps"></link><link rel="next" href="latex-suite-commands.html" title="10.2 Latex Suite Commands"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">10.1 Latex-Suite Maps</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="latex-suite-commands-maps.html">Prev</a> </td><th width="60%" align="center">10 Latex-Suite Commands and Maps</th><td width="20%" align="right"> <a accesskey="n" href="latex-suite-commands.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="10.1 Latex-Suite Maps"><div class="titlepage"><div><div><h3 class="title"><a id="latex-suite-maps"></a>10.1 Latex-Suite Maps</h3></div></div></div><div class="toc"><dl><dt><span class="section"><a href="latex-suite-maps.html#customize-imap-maps">10.1.1 IMAP mappings</a></span></dt><dt><span class="section"><a href="latex-suite-maps.html#customize-alt-key-maps">10.1.2 Alt-Key mappings</a></span></dt></dl></div><a id="remapping-latex-suite-keys"></a><p> + Most of the mappings used in Latex-Suite can be mapped to a different key + combination to suit your particular needs. An example best explains the + procedure for doing this. Suppose you want to remap the + <code class="literal">&lt;C-j&gt;</code> key which Latex-Suite (actually imaps.vim) uses + to jump to the next placeholder. To do this, you first need to find out + which <code class="literal">&lt;Plug&gt;</code> mapping + <code class="literal">&lt;C-j&gt;</code> is derived from. You will need to look + at the relevant section of this manual to do this. For example, the + section <a class="link" href="latex-suite-maps.html#customize-imap-maps" title="10.1.1 IMAP mappings">IMAP mappings</a> has + the information that the <code class="literal">&lt;C-j&gt;</code> key is derived + from <code class="literal">&lt;Plug&gt;IMAP_JumpForward</code>. Therefore to + remap the <code class="literal">&lt;C-j&gt;</code> key to say + <code class="literal">&lt;C-space&gt;</code>, you will need to put a + statement like the following in your <code class="literal">~/.vimrc</code>. + </p><pre class="programlisting">imap &lt;C-space&gt; &lt;Plug&gt;IMAP_JumpForward</pre><p> + </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> + To change the <code class="literal">IMAP</code> mappings which affect jumping + between placeholders, the <code class="literal">map</code> statement above has + to be placed in your <code class="literal">~/.vimrc</code>. For other mappings + you can place the <code class="literal">map</code> statement in your + <code class="literal">$VIM/ftplugin/tex.vim</code> file. The reason for this is + that the <code class="literal">&lt;C-j&gt;</code> maps are created in + <code class="literal">plugin/imaps.vim</code>, which is sourced as soon as Vim + starts before sourcing any ftplugin files. + </p></div><div class="section" title="10.1.1 IMAP mappings"><div class="titlepage"><div><div><h4 class="title"><a id="customize-imap-maps"></a>10.1.1 IMAP mappings</h4></div></div></div><p> + These mappings are utilized for jumping between placeholders as + described <a class="link" href="latex-macros.html#place-holders" title="Place Holders">here</a>. See the <a class="link" href="latex-suite-maps.html" title="10.1 Latex-Suite Maps">parent section</a> to find out how to + use this information to change the default maps. + </p><a id="Plug_IMAP_JumpForward"></a><a id="Plug_IMAP_JumpBack"></a><a id="Plug_IMAP_DeleteAndJumpForward"></a><a id="Plug_IMAP_DeleteAndJumBack"></a><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><thead><tr><th>Plug map</th><th>Default Key</th></tr></thead><tbody><tr><td><code class="literal">&lt;Plug&gt;IMAP_JumpForward</code></td><td><code class="literal">&lt;C-j&gt;</code></td></tr><tr><td><code class="literal">&lt;Plug&gt;IMAP_JumpBack</code></td><td>(none)</td></tr><tr><td><code class="literal">&lt;Plug&gt;IMAP_DeleteAndJumpForward</code></td><td>(none)</td></tr><tr><td><code class="literal">&lt;Plug&gt;IMAP_DeleteAndJumpBack</code></td><td>(none)</td></tr></tbody></table></div><p> + <code class="literal">&lt;Plug&gt;IMAP_JumpForward</code> takes you to the + location of the next <a class="link" href="latex-macros.html#place-holders" title="Place Holders">place-holder</a>. + </p><p> + <code class="literal">&lt;Plug&gt;IMAP_JumpBack</code> takes you to the previous + <a class="link" href="latex-macros.html#place-holders" title="Place Holders">place-holder</a>. + </p><p> + <code class="literal">&lt;Plug&gt;IMAP_DeleteAndJumpForward</code> deletes the + presently selected place-holder and jumps to the next place-holder + irrespective of whether the present placeholder is empty or not and + ignoring the value of place-holder settings like <a class="link" href="customizing-place-holders.html#Imap_DeleteEmptyPlaceHolders" title="11.2.3 g:Imap_DeleteEmptyPlaceHolders"><code class="literal">g:Imap_DeleteEmptyPlaceHolders</code></a> + and <a class="link" href="customizing-place-holders.html#Imap_StickyPlaceHolders" title="11.2.4 g:Imap_StickyPlaceHolders"><code class="literal">g:Imap_StickyPlaceHolders</code></a> + </p><p> + <code class="literal">&lt;Plug&gt;IMAP_DeleteAndJumpBack</code> deletes the + presently selected place-holder and jumps to the previous place-holder + irrespective of whether the present placeholder is empty or not and + ignoring the value of place-holder settings like <a class="link" href="customizing-place-holders.html#Imap_DeleteEmptyPlaceHolders" title="11.2.3 g:Imap_DeleteEmptyPlaceHolders"><code class="literal">g:Imap_DeleteEmptyPlaceHolders</code></a> + and <a class="link" href="customizing-place-holders.html#Imap_StickyPlaceHolders" title="11.2.4 g:Imap_StickyPlaceHolders"><code class="literal">g:Imap_StickyPlaceHolders</code></a> + </p></div><div class="section" title="10.1.2 Alt-Key mappings"><div class="titlepage"><div><div><h4 class="title"><a id="customize-alt-key-maps"></a>10.1.2 Alt-Key mappings</h4></div></div></div><p> + These mappings are are described in the section <a class="link" href="altkey-mappings.html" title="3.10 Alt Key Macros">Alt key macros</a>. See <a class="link" href="latex-suite-maps.html#remapping-latex-suite-keys">the parent section</a> to see + how to use the following information to remap keys. + </p><a id="Plug_Tex_MathBF"></a><a id="Plug_Tex_MathCal"></a><a id="Plug_Tex_LeftRight"></a><a id="Plug_Tex_InsertItemOnThisLine"></a><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><thead><tr><th>Plug Mapping</th><th>Default Key</th></tr></thead><tbody><tr><td><code class="literal">&lt;Plug&gt;Tex_MathBF</code></td><td><code class="literal">&lt;Alt-B&gt;</code></td></tr><tr><td><code class="literal">&lt;Plug&gt;Tex_MathCal</code></td><td><code class="literal">&lt;Alt-C&gt;</code></td></tr><tr><td><code class="literal">&lt;Plug&gt;Tex_LeftRight</code></td><td><code class="literal">&lt;Alt-L&gt;</code></td></tr><tr><td><code class="literal">&lt;Plug&gt;Tex_InsertItemOnThisLine</code></td><td><code class="literal">&lt;Alt-I&gt;</code></td></tr></tbody></table></div></div></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="latex-suite-commands-maps.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="latex-suite-commands-maps.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="latex-suite-commands.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">10 Latex-Suite Commands and Maps </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 10.2 Latex Suite Commands</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite/latex-suite-templates.html b/.vim/doc/latex-suite/latex-suite-templates.html @@ -0,0 +1,31 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>2 Inserting Templates</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="Latex-Suite Reference"></link><link rel="up" href="index.html" title="Latex-Suite Reference"></link><link rel="prev" href="recommended-settings.html" title="1 Installation and recommended Settings"></link><link rel="next" href="latex-macros.html" title="3 Latex-Suite Macros"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">2 Inserting Templates</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="recommended-settings.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="latex-macros.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="2 Inserting Templates"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="latex-suite-templates"></a>2 Inserting Templates</h2></div></div></div><p> + This functionality is available via the <code class="literal">TeX-Suite &gt; + Templates</code> menu. + This module provides a way to insert custom templates at the beginning of the + current file. + </p><p> + When Latex-Suite first starts up, it scans the + <code class="literal">$VIM/ftplugin/latex-suite/templates/</code> + directory and creates menu items based on the files found there. When + you select a template from this menu, the file will be read in above + the first line of the current file. + </p><p> + A template file can utilize placeholders for initializing the cursor + position when the template is read in and subsequent movement. In + addition, template files can contain dynamic elements such as the + time of creation of a file etc, by using vim expressions. + </p><p> + You can place your own templates in the + <code class="literal">$VIM/ftplugin/latex-suite/templates/</code> directory in + order for them to be available via the menu. Unless Latex-Suite releases a + template with the same name, these files should not get over-written + when you install a new release over an existing one. + </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> + Templates are also accessible for non-gui users with the command + |<code class="literal">:TTemplate</code>|. The argument should be name of + the corresponding template file. If the command is called + without arguments (preferred usage), then a list of available + templates is displayed and the user is asked to choose one of + them. + </p></div></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="recommended-settings.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="latex-macros.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">1 Installation and recommended Settings </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 3 Latex-Suite Macros</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite/latex-viewing-rules.html b/.vim/doc/latex-suite/latex-viewing-rules.html @@ -0,0 +1,31 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>7.1 Setting Viewing rules</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="Latex-Suite Reference"></link><link rel="up" href="latex-viewing.html" title="7 Latex Viewing and Searching"></link><link rel="prev" href="latex-viewing.html" title="7 Latex Viewing and Searching"></link><link rel="next" href="forward-searching.html" title="7.2 Forward Searching documents"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">7.1 Setting Viewing rules</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="latex-viewing.html">Prev</a> </td><th width="60%" align="center">7 Latex Viewing and Searching</th><td width="20%" align="right"> <a accesskey="n" href="forward-searching.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="7.1 Setting Viewing rules"><div class="titlepage"><div><div><h3 class="title"><a id="latex-viewing-rules"></a>7.1 Setting Viewing rules</h3></div></div></div><p> + In order to view the output files created by compiling the source + files, you need to specify which external program Latex-Suite should call. You + can specify the external program using one of two settings + <a class="link" href="customizing-viewing.html#Tex_ViewRule_format" title="11.7.1 g:Tex_ViewRule_&lt;format&gt;">Tex_ViewRule_format</a> or <a class="link" href="customizing-viewing.html#Tex_ViewRuleComplete_format" title="11.7.2 Tex_ViewRuleComplete_&lt;format&gt;">Tex_ViewRuleComplete_format</a>. + By default, Latex-Suite has default settings for viewing various common output + formats via the <code class="literal">Tex_ViewRule_format</code> settings, so + that if you are using commonly used programs, you should be all set to + view compiled files from within Vim by simply pressing + <code class="literal">\lv</code>. + </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> + The viewing function also takes the <a class="link" href="latex-master-file.html" title="9.2 Specifying which file to compile"><code class="literal">*.latexmain</code></a> file + into account to decide which file to show. + </p></div><p> + If pressing <code class="literal">\lv</code> does not work, then it most probably + has to do with incorrect settings of the <a class="link" href="customizing-viewing.html#Tex_ViewRule_format" title="11.7.1 g:Tex_ViewRule_&lt;format&gt;"><code class="literal">g:Tex_ViewRule_&lt;format&gt;</code></a> + where <code class="literal">&lt;format&gt;</code> is the format you are + attempting to view. See the link above for how to set this according to + your system. + </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> + On Windows and OS/X, you can leave the view rule empty to open the document + with the default viewer on your system. On Linux/UNIX systems, you can use + the <code class="literal">xdg-open</code> command to open the document with the default + viewer. + </p></div><p> + In addition to viewing the files, Latex-Suite also supports forward and inverse + searching for certain common tools for viewing documents. + See the next few sections for details on forward and inverse searching, + including an overview of viewers. + </p></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="latex-viewing.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="latex-viewing.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="forward-searching.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">7 Latex Viewing and Searching </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 7.2 Forward Searching documents</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite/latex-viewing.html b/.vim/doc/latex-suite/latex-viewing.html @@ -0,0 +1,2 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>7 Latex Viewing and Searching</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="Latex-Suite Reference"></link><link rel="up" href="index.html" title="Latex-Suite Reference"></link><link rel="prev" href="part-compiling.html" title="6.5 Compiling parts of a file"></link><link rel="next" href="latex-viewing-rules.html" title="7.1 Setting Viewing rules"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">7 Latex Viewing and Searching</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="part-compiling.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="latex-viewing-rules.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="7 Latex Viewing and Searching"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="latex-viewing"></a>7 Latex Viewing and Searching</h2></div></div></div><div class="toc"><dl><dt><span class="section"><a href="latex-viewing-rules.html">7.1 Setting Viewing rules</a></span></dt><dt><span class="section"><a href="forward-searching.html">7.2 Forward Searching documents</a></span></dt><dt><span class="section"><a href="inverse-searching.html">7.3 Inverse Searching</a></span></dt></dl></div></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="part-compiling.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="latex-viewing-rules.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">6.5 Compiling parts of a file </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 7.1 Setting Viewing rules</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite/ls-completion-custom.html b/.vim/doc/latex-suite/ls-completion-custom.html @@ -0,0 +1,22 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>5.5 Custom command completion</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="Latex-Suite Reference"></link><link rel="up" href="latex-completion.html" title="5 Latex Completion"></link><link rel="prev" href="ls-filename-completion.html" title="5.4 Latex-Suite filename completion"></link><link rel="next" href="latex-compiling.html" title="6 LaTeX Compiling"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">5.5 Custom command completion</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ls-filename-completion.html">Prev</a> </td><th width="60%" align="center">5 Latex Completion</th><td width="20%" align="right"> <a accesskey="n" href="latex-compiling.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="5.5 Custom command completion"><div class="titlepage"><div><div><h3 class="title"><a id="ls-completion-custom"></a>5.5 Custom command completion</h3></div></div></div><p> + Latex-Suite also recognizes certain commonly used LaTeX commands for the + <code class="literal">&lt;F9&gt;</code> key. At the moment, the + <code class="literal">\bibliographystyle</code>, <code class="literal">\addtocontents</code> + and the <code class="literal">\addcontentsline</code> commands are recognized, + although more will be added in the future. When you press the + <code class="literal">&lt;F9&gt;</code> after such a command, Latex-Suite will prompt + you with a list of arguments which make sense for the command. + </p><p> + This functionality is available for commands for which a global + variable of the form + <code class="literal">g:Tex_completion_{&lt;command&gt;}</code> is defined where + <code class="literal">&lt;command&gt;</code> is the command name. This variable + is a comma separated list of values which this command takes. For + example, the argument to the <code class="literal">\bibliographystyle</code> + command is commonly one of <code class="literal">abbr,alpha,plain,unsrt</code>. + Therefore, Latex-Suite defines + </p><pre class="programlisting">let g:Tex_completion_bibliographystyle = 'abbr,alpha,plain,unsrt'</pre><p> + You can define your own completion variables in a similar manner for + commands which you might use. + </p></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ls-filename-completion.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="latex-completion.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="latex-compiling.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">5.4 Latex-Suite filename completion </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 6 LaTeX Compiling</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite/ls-completion-ref.html b/.vim/doc/latex-suite/ls-completion-ref.html @@ -0,0 +1,63 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>5.2 Latex-Suite \ref completion</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="Latex-Suite Reference"></link><link rel="up" href="latex-completion.html" title="5 Latex Completion"></link><link rel="prev" href="ls-completion-usage.html" title="5.1 Latex-Suite completion example"></link><link rel="next" href="latex-completion-cite.html" title="5.3 Latex-Suite \cite completion"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">5.2 Latex-Suite \ref completion</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ls-completion-usage.html">Prev</a> </td><th width="60%" align="center">5 Latex Completion</th><td width="20%" align="right"> <a accesskey="n" href="latex-completion-cite.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="5.2 Latex-Suite \ref completion"><div class="titlepage"><div><div><h3 class="title"><a id="ls-completion-ref"></a>5.2 Latex-Suite \ref completion</h3></div></div></div><p> + Pressing <code class="literal">&lt;F9&gt;</code> when you are within a partially + completed <code class="literal">\ref</code> command will split open a window + (named <code class="literal">__OUTLINE__</code>) which contains a nicely + formatted list of all the <code class="literal">\label</code>s found in the + present project. The <code class="literal">\label</code>s are heirarchically + arranged according to which <code class="literal">\section</code>, + <code class="literal">\subsection</code> etc of the overall document structure + they are present in. For example, when you first press + <code class="literal">&lt;F9&gt;</code> after typing <code class="literal">\ref{</code>, + you should see something like: + </p><pre class="programlisting"> ++-- 54 lines: 2. Kinematics-------------------------------- ++-- 98 lines: 3. Aerodynamics of the MFI thorax------------ ++-- 40 lines: 4. Jump Resonance in Fourbar Mechanisms------ ++-- 28 lines: 5. Design and Fabrication Issues------------- + </pre><p> + Each chapter is |fold|ed away so that you can quickly jump to the + correct section/subsection in which the relevant equation is defined. + This makes inserting references significantly faster for large projects + with hundreds of equations. You can then open some of the folds to see + for example: + </p><pre class="programlisting"> ++-- 54 lines: 2. Kinematics-------------------------------- +3. Aerodynamics of the MFI thorax + 3.1. Aerodynamic modeling of the MFI wing forces + 3.1.1. Geometric Specification + eqn:wingnormal-pos + \nhat = T_z(\theta_2) T_y(\theta_y)T_x(\theta_x)\nhat_0, + eqn:T-1 + T_1(\theta_2) &amp;=&amp; T_z(\theta_2) + </pre><p> + The <code class="literal">&lt;Tab&gt;</code> key is mapped in this window to + toggle folds so that you can quickly open/close folds in order to + navigate the heirarchy faster. Once you are positioned on a + label, press <code class="literal">&lt;Enter&gt;</code>. This closes the + <code class="literal">__OUTLINE__</code> window, returns to the window in which + you pressed <code class="literal">&lt;F9&gt;</code> and inserts the reference + at the current cursor position. + </p><div class="note" title="Filtering labels by prefix" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Filtering labels by prefix</h3><p> + You can press <code class="literal">&lt;F9&gt;</code> after typing part of the + <code class="literal">\label</code>. In this case, Latex-Suite only presents + <code class="literal">\label</code>s which begin with the already filled + characters. You can use this to choose between equations, figures, + tables etc. if you consistently label equations to begin with + <code class="literal">eqn:</code>, figures to begin with <code class="literal">fig:</code> + etc. For example, with this scheme, pressing + <code class="literal">&lt;F9&gt;</code> after typing + <code class="literal">\ref{eqn:</code> will only list equations. + </p></div><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> + Latex-Suite works the same way if you press <code class="literal">&lt;F9&gt;</code> + after any command which contains the letters <code class="literal">ref</code>. + Thus you can complete <code class="literal">\eqref</code> in exactly the same + manner. + </p></div><div class="note" title="Requirements" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Requirements</h3><p> + This method of preseting the <code class="literal">\label</code>s depends on Vim + being compiled with python support. To check if you have this, see the + output of the <code class="literal">:ver</code> command. If you see something + like <code class="literal">+python</code>, you are all set. Failing this, you + will need to have <code class="literal">python</code> somewhere in your + <code class="literal">$PATH</code>. + </p></div></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ls-completion-usage.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="latex-completion.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="latex-completion-cite.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">5.1 Latex-Suite completion example </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 5.3 Latex-Suite <code class="literal">\cite</code> completion</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite/ls-completion-usage.html b/.vim/doc/latex-suite/ls-completion-usage.html @@ -0,0 +1,78 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>5.1 Latex-Suite completion example</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="Latex-Suite Reference"></link><link rel="up" href="latex-completion.html" title="5 Latex Completion"></link><link rel="prev" href="latex-completion.html" title="5 Latex Completion"></link><link rel="next" href="ls-completion-ref.html" title="5.2 Latex-Suite \ref completion"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">5.1 Latex-Suite completion example</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="latex-completion.html">Prev</a> </td><th width="60%" align="center">5 Latex Completion</th><td width="20%" align="right"> <a accesskey="n" href="ls-completion-ref.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="5.1 Latex-Suite completion example"><div class="titlepage"><div><div><h3 class="title"><a id="ls-completion-usage"></a>5.1 Latex-Suite completion example</h3></div></div></div><p> + Consider the situation where you are editing a file with two equations + labelled <code class="literal">eqn:euler</code> and <code class="literal">eqn:einstein</code>. + Now you want to insert a reference to one of these equations. To do this, + you type the <code class="literal">\ref{eqn:}</code> command and with the cursor + placed after <code class="literal">eqn:</code>, press <code class="literal">&lt;F9&gt;</code>. + This will bring up two new windows beneath the main window you were working + in as shown in the figure below. + </p><pre class="programlisting"> + 8 These are a couple of equations: + 9 +-- 4 lines: eqnarray (eqn:euler) : e^{j\pi} + 1 &amp;=&amp; 0--------------- + 13 +-- 4 lines: equation (eqn:einstein) : E = m c^2--------------------- + 17 + 18 These are a couple of figures: + 19 +-- 7 lines: figure (fig:monkeys) : Monkeys can Type------------------- + 26 +-- 7 lines: figure (fig:shakespeare) : Shakespeare could not type----- + 33 + 34 This is a reference to \ref{eqn:}&lt;++&gt; + 35 + 36 + 37 \end{document} + 38 +~ +~ +~ +newfile.tex 34,32 Bot +newfile.tex|11| \label{eqn:euler} +newfile.tex|15| \label{eqn:einstein} +~ +[Error List] 1,1 All + 7 + 8 These are a couple of equations: + 9 \begin{eqnarray} + 10 e^{j\pi} + 1 &amp;=&amp; 0 + 11 \label{eqn:euler} + 12 \end{eqnarray} + 13 \begin{equation} + 14 E = m c^2 + 15 \label{eqn:einstein} + 16 \end{equation} +newfile.tex [Preview] 11,3 21% + </pre><p> + </p><p> + The first window (shown as <code class="literal">[Error List]</code> above) is a + <code class="literal">|cwindow|</code> containing a list of possible matches for the + reference. The cursor will be located in the first line of this window. The + bottom window is a <code class="literal">preview-window</code> showing the context of + the <code class="literal">\label</code>. Moving around in the + <code class="literal">[Error List]</code> window automatically scrolls the + preview window so as to always keep showing the context of the + <code class="literal">\label</code> being viewed in the + <code class="literal">[Error List]</code> window. You can also press + <code class="literal">J</code> and <code class="literal">K</code> in the + <code class="literal">[ErrorList]</code> window to scroll the preview window up and + down. + </p><p> + To insert one of the labels, simply position the cursor in the correct line + in the <code class="literal">[Error List]</code> window and press + <code class="literal">&lt;enter&gt;</code>. This will immediately close the two newly + opened windows, get back to the correct location in the original file being + edited and insert the label into the <code class="literal">\ref</code> command. + </p><p> + If you notice carefully in the example above, the + <code class="literal">[Error List]</code> window only showed the matches for the + equations and did not list any of the figure labels. This is because we + pressed <code class="literal">&lt;F9&gt;</code> after <code class="literal">\ref{eqn:</code> + instead of simply after <code class="literal">\ref{</code>. This caused Latex-Suite to + search only for those labels which started with the string + <code class="literal">eqn:</code>. If you had pressed + <code class="literal">&lt;F9&gt;</code> after a <code class="literal">\ref{</code>, you would + have been shown matches from <span class="emphasis"><em>all</em></span> labels, not just + those starting with <code class="literal">eqn:</code>. + </p><p> + Thus prefixing all your labels with <code class="literal">eqn:</code>, + <code class="literal">fig:</code>, <code class="literal">tab:</code> etc. depending on what you + are labelling will lead to an easier time completing references. + </p></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="latex-completion.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="latex-completion.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ls-completion-ref.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">5 Latex Completion </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 5.2 Latex-Suite \ref completion</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite/ls-filename-completion.html b/.vim/doc/latex-suite/ls-filename-completion.html @@ -0,0 +1,21 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>5.4 Latex-Suite filename completion</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="Latex-Suite Reference"></link><link rel="up" href="latex-completion.html" title="5 Latex Completion"></link><link rel="prev" href="latex-completion-cite.html" title="5.3 Latex-Suite \cite completion"></link><link rel="next" href="ls-completion-custom.html" title="5.5 Custom command completion"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">5.4 Latex-Suite filename completion</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="latex-completion-cite.html">Prev</a> </td><th width="60%" align="center">5 Latex Completion</th><td width="20%" align="right"> <a accesskey="n" href="ls-completion-custom.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="5.4 Latex-Suite filename completion"><div class="titlepage"><div><div><h3 class="title"><a id="ls-filename-completion"></a>5.4 Latex-Suite filename completion</h3></div></div></div><p> + When you press <code class="literal">&lt;F9&gt;</code> at a location where Latex-Suite + guesses a filename needs to be typed, then a new explorer window will + open up with the list of files. You can use this window to change + directories etc. Pressing <code class="literal">&lt;enter&gt;</code> on a filename + in the explorer window will automatically close the explorer window, + return to the location where you pressed <code class="literal">&lt;F9&gt;</code> + from and insert the filename into that position. + </p><p> + Latex-Suite also tries to guess what kinds of files you might not want to + insert and hides those accordingly. For example, if you press + <code class="literal">&lt;F9&gt;</code> when you are located at + <code class="literal">\includegraphics{</code>, then Latex-Suite knows that you will not + want to insert <code class="literal">.tex</code> files. Therefore, the explorer + window will automatically hide these files. + </p><p> + As of now, Latex-Suite recognizes the following commands for filename + completion. Along with the commands, this table also lists the + files which Latex-Suite will not show for completing each command. + </p><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><thead><tr><th>command</th><th>hide pattern</th></tr></thead><tbody><tr><td><code class="literal">\bibliography</code></td><td><code class="literal">'^\.,\.[^b]..$'</code></td></tr><tr><td><code class="literal">\include</code> <code class="literal">\includeonly</code></td><td><code class="literal">'^\.,\.[^t]..$'</code></td></tr><tr><td><code class="literal">\includegraphics</code> <code class="literal">\psfig</code></td><td><code class="literal">'^\.,\.tex$,\.bib$,\.bbl$,\.zip$,\.gz$'</code></td></tr><tr><td><code class="literal">\input</code></td><td><code class="literal">''</code></td></tr></tbody></table></div></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="latex-completion-cite.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="latex-completion.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ls-completion-custom.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">5.3 Latex-Suite <code class="literal">\cite</code> completion </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 5.5 Custom command completion</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite/ls-general-purpose-settings.html b/.vim/doc/latex-suite/ls-general-purpose-settings.html @@ -0,0 +1,18 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>11.1 General Settings</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="Latex-Suite Reference"></link><link rel="up" href="customizing-latex-suite.html" title="11 Customizing Latex-Suite"></link><link rel="prev" href="customizing-latex-suite.html" title="11 Customizing Latex-Suite"></link><link rel="next" href="customizing-place-holders.html" title="11.2 Place-Holder Customization"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">11.1 General Settings</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="customizing-latex-suite.html">Prev</a> </td><th width="60%" align="center">11 Customizing Latex-Suite</th><td width="20%" align="right"> <a accesskey="n" href="customizing-place-holders.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="11.1 General Settings"><div class="titlepage"><div><div><h3 class="title"><a id="ls-general-purpose-settings"></a>11.1 General Settings</h3></div></div></div><div class="toc"><dl><dt><span class="section"><a href="ls-general-purpose-settings.html#Tex_Debug">11.1.1 Tex_Debug</a></span></dt><dt><span class="section"><a href="ls-general-purpose-settings.html#Tex_UsePython">11.1.2 Tex_UsePython</a></span></dt></dl></div><div class="section" title="11.1.1 Tex_Debug"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_Debug"></a>11.1.1 Tex_Debug</h4></div></div></div><p> + </p><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>boolean</td></tr><tr><td>Default Value</td><td><code class="literal">0</code></td></tr></tbody></table></div><p> + </p><p> + If set to 1, then Latex-Suite will create certain global debug + statements which can be printed by doing + </p><pre class="programlisting">:call Tex_PrintDebug()</pre><p> + </p><p> + </p></div><div class="section" title="11.1.2 Tex_UsePython"><div class="titlepage"><div><div><h4 class="title"><a id="Tex_UsePython"></a>11.1.2 Tex_UsePython</h4></div></div></div><p> + </p><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><tbody><tr><td>Type</td><td>boolean</td></tr><tr><td>Default Value</td><td><code class="literal">1</code></td></tr></tbody></table></div><p> + </p><p> + If Latex-Suite detects that your vim is python enabled (using + <code class="literal">has('python')</code>), then it tries to use python in + certain places to speed things up. If this misbehaves, you can set + this to zero, in which case, Latex-Suite will use vimscript to accomplish + the same. + </p><p> + </p></div></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="customizing-latex-suite.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="customizing-latex-suite.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="customizing-place-holders.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">11 Customizing Latex-Suite </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 11.2 Place-Holder Customization</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite/ls-new-macros.html b/.vim/doc/latex-suite/ls-new-macros.html @@ -0,0 +1,154 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>3.12 Making your own Macros via IMAP()</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="Latex-Suite Reference"></link><link rel="up" href="latex-macros.html" title="3 Latex-Suite Macros"></link><link rel="prev" href="custom-macros-menu.html" title="3.11 Custom Macros"></link><link rel="next" href="latex-packages.html" title="4 Package Handling"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">3.12 Making your own Macros via <code class="literal">IMAP()</code></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="custom-macros-menu.html">Prev</a> </td><th width="60%" align="center">3 Latex-Suite Macros</th><td width="20%" align="right"> <a accesskey="n" href="latex-packages.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="3.12 Making your own Macros via IMAP()"><div class="titlepage"><div><div><h3 class="title"><a id="ls-new-macros"></a>3.12 Making your own Macros via <code class="literal">IMAP()</code></h3></div></div></div><div class="toc"><dl><dt><span class="section"><a href="ls-new-macros.html#why-IMAP">3.12.1 Why use <code class="literal">IMAP()</code></a></span></dt><dt><span class="section"><a href="ls-new-macros.html#ls-imaps-syntax">3.12.2 IMAP() syntax</a></span></dt></dl></div><p> + If you find the need to create your own macros, then you can use the + <code class="literal">IMAP()</code> function provided with Latex-Suite. See <a class="link" href="ls-new-macros.html#why-IMAP" title="3.12.1 Why use IMAP()">Why use <code class="literal">IMAP()</code></a> for a short + explanation of why you might prefer <code class="literal">IMAP()</code> over + Vim's standard <code class="literal">:imap</code> command. An example best + explains the usage: + </p><pre class="programlisting">:call IMAP('NOM', '\nomenclature{&lt;++&gt;}&lt;++&gt;', 'tex')</pre><p> + This will create a Latex-Suite-style mapping, where if you type + <code class="literal">NOM</code> in insert mode, you will get + <code class="literal">\nomenclature{&lt;++&gt;}&lt;++&gt;</code> with the cursor left in + place of the first <code class="literal">&lt;++&gt;</code> characters. See <a class="link" href="ls-new-macros.html#ls-imaps-syntax" title="3.12.2 IMAP() syntax">IMAP() syntax</a> for + a detailed explanation of the <code class="literal">IMAP()</code> command. + </p><p> + For maps which are triggered for a given filetype, the + <code class="literal">IMAP()</code> command above should be put in the filetype + plugin script for that file. For example, for tex-specific mappings, + the <code class="literal">IMAP()</code> calls should go in + <code class="literal">$VIM/ftplugin/tex.vim</code>. For globally visible maps, + you will need to use the following in either your + <code class="literal">~/.vimrc</code> or a file in your + <code class="literal">$VIM/plugin</code> directory. + </p><pre class="programlisting">augroup MyIMAPs + au! + au VimEnter * call IMAP('Foo', 'foo', '') +augroup END</pre><p> + </p><div class="section" title="3.12.1 Why use IMAP()"><div class="titlepage"><div><div><h4 class="title"><a id="why-IMAP"></a>3.12.1 Why use <code class="literal">IMAP()</code></h4></div></div></div><p> + Using <code class="literal">IMAP</code> instead of Vim's built-in + <code class="literal">:imap</code> command has a couple of advantages: + </p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"> + The 'ttimeout' option will generally limit how easily you can type + the left hand side for a normal <code class="literal">:imap</code>. if you type + the left hand side too slowly, then the mapping will not be + activated. + </li><li class="listitem"> + If you mistype one of the letters of the lhs, then the mapping is + deactivated as soon as you backspace to correct the mistake. + </li><li class="listitem"> + The characters in lhs are shown on top of each other. This is fairly + distracting. This becomes a real annoyance when a lot of characters + initiate mappings. + </li></ol></div><p> + </p></div><div class="section" title="3.12.2 IMAP() syntax"><div class="titlepage"><div><div><h4 class="title"><a id="ls-imaps-syntax"></a>3.12.2 IMAP() syntax</h4></div></div></div><p> + Formally, the syntax which is used for the <code class="literal">IMAP</code> + function is: + </p><pre class="programlisting">call IMAP (lhs, rhs, ft [, phs, phe])</pre><p> + </p><p> + </p><div class="informaltable"><table border="1"><colgroup><col></col><col></col></colgroup><thead><tr><th>Argument</th><th>Explanation</th></tr></thead><tbody><tr><td>lhs</td><td> + <p> + This is the "left-hand-side" of the mapping. When you use + <code class="literal">IMAP</code>, only the last character of this word is + actually mapped, although the effect is that the whole word is + mapped. + </p> + <p> + If you have two mappings which end in a common + <code class="literal">lhs</code>, then the mapping with the longer + <code class="literal">lhs</code> is used. For example, if you do + </p><pre class="programlisting">call IMAP('BarFoo', 'something', 'tex') +call IMAP('Foo', 'something else', 'tex')</pre><p> + Then typing <code class="literal">BarFoo</code> inserts + <code class="literal">"something"</code>, whereas <code class="literal">Foo</code> by + itself inserts <code class="literal">"something else"</code>. + </p> + <p> + Also, the nature of <code class="literal">IMAP()</code> makes creating + certain combination of mappings impossible. For example if you + have + </p><pre class="programlisting">call IMAP('foo', 'something', 'tex') +call IMAP('foobar', 'something else', 'tex')</pre><p> + Then you will never be able to trigger <code class="literal">"foobar"</code> + because typing <code class="literal">"foo"</code> will immediately insert + <code class="literal">"something"</code>. This is the "cost" which you incur + over the normal <code class="literal">:imap</code> command for the + convenience of no 'timeout' problems, the ability to correct + <code class="literal">lhs</code> etc. + </p> + </td></tr><tr><td>rhs</td><td> + <p> + The "right-hand-side" of the mapping. This is the expansion you + will get when you type <code class="literal">lhs</code>. + </p> + <p> + This string can also contain special characters such as + <code class="literal">&lt;enter&gt;</code> etc. To do this, you will need + to specify the second argument in double-quotes as follows: + </p><pre class="programlisting">:call IMAP('EFE', "\\begin{figure}\&lt;CR&gt;&lt;++&gt;\\end{figure}&lt;++&gt;", 'tex')</pre><p> + With this, typing <code class="literal">EFE</code> is equivalent to typing + in the right-hand side with all the special characters in + insert-mode. This has the advantage that if you have filetype + indentation set up, then the right hand side will also be + indented just as if you had typed it in normally. + </p> + <a id="IMAP_PutTextWithMovement"></a> + <p> + You can also set up a Latex-Suite style mapping which calls a custom function + as follows: + </p><pre class="programlisting">:call IMAP('FOO', "\&lt;C-r&gt;=MyFoonction()\&lt;CR&gt;", 'tex')</pre><p> + where <code class="literal">MyFoonction</code> is a custom function you have + written. If <code class="literal">MyFoonction</code> also has to return a string + containing <code class="literal">&lt;++&gt;</code> characters, then you will need to + use the function <code class="literal">IMAP_PutTextWithMovement()</code>. An + example best explains the usage: + </p> + <pre class="programlisting">call IMAP('FOO', "\&lt;C-r&gt;=AskVimFunc()\&lt;CR&gt;", 'vim') +" Askvimfunc: Asks For Function Name And Sets Up Template +" Description: +function! AskVimFunc() + let name = input('Name of the function : ') + if name == '' + let name = "&lt;+Function Name+&gt;" + end + let islocal = input('Is this function scriptlocal ? [y]/n : ', 'y') + if islocal == 'y' + let sidstr = '&lt;SID&gt;' + else + let sidstr = '' + endif + return IMAP_PutTextWithMovement( + \ "\" ".name.": &lt;+short description+&gt; \&lt;cr&gt;" . + \ "Description: &lt;+long description+&gt;\&lt;cr&gt;" . + \ "\&lt;C-u&gt;function! ".name."(&lt;+arguments+&gt;)&lt;++&gt;\&lt;cr&gt;" . + \ "&lt;+function body+&gt;\&lt;cr&gt;" . + \ "endfunction \" " + \ ) +endfunction</pre> + <p> + </p> + </td></tr><tr><td>ft</td><td> + <p> + The file type for which this mapping is active. When this string + is left empty, the mapping applies for all file-types. A filetype + specific mapping will always take precedence. + </p> + </td></tr><tr><td>phs, phe</td><td> + <p> + If you prefer to write the <code class="literal">rhs</code> with characters + other than <code class="literal">&lt;+</code> and <code class="literal">+&gt;</code> + to denote place-holders, you can use the last 2 arguments to + specify which characters in the <code class="literal">rhs</code> specify + place-holders. By default, these are <code class="literal">&lt;+</code> and + <code class="literal">+&gt;</code> respectively. + </p> + <p> + Note that the <code class="literal">phs</code> and <code class="literal">phe</code> + arguments do not control what characters will be displayed for + the placeholders when the mapping is actually triggered. What + characters are used to display place-holders when you trigger an + <code class="literal">IMAP</code> are controlled by the <a class="link" href="customizing-place-holders.html#Imap_PlaceHolderStart" title="11.2.2 g:Imap_PlaceHolderStart &amp; g:Imap_PlaceHolderEnd"><code class="literal">Imap_PlaceHolderStart</code></a> + and <a class="link" href="customizing-place-holders.html#Imap_PlaceHolderEnd"><code class="literal">Imap_PlaceHolderEnd</code></a> + settings. + </p> + </td></tr></tbody></table></div><p> + </p></div></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="custom-macros-menu.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="latex-macros.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="latex-packages.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">3.11 Custom Macros </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 4 Package Handling</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite/package-actions.html b/.vim/doc/latex-suite/package-actions.html @@ -0,0 +1,38 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>4.2 Actions taken for supported packages</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="Latex-Suite Reference"></link><link rel="up" href="latex-packages.html" title="4 Package Handling"></link><link rel="prev" href="inserting-packages.html" title="4.1 Inserting package commands"></link><link rel="next" href="automatic-package-detection.html" title="4.3 Automatic Package detection"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">4.2 Actions taken for supported packages</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="inserting-packages.html">Prev</a> </td><th width="60%" align="center">4 Package Handling</th><td width="20%" align="right"> <a accesskey="n" href="automatic-package-detection.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="4.2 Actions taken for supported packages"><div class="titlepage"><div><div><h3 class="title"><a id="package-actions"></a>4.2 Actions taken for supported packages</h3></div></div></div><p> + Latex-Suite takes the following actions for packages detected when a file is + loaded, or a new <code class="literal">\usepackage</code> line is inserted using + one of the methods described in the <a class="link" href="inserting-packages.html" title="4.1 Inserting package commands">previous section</a>. + </p><p> + If you are using the GUI and you have <a class="link" href="customizing-menus.html#Tex_Menus" title="11.8.1 g:Tex_Menus">g:Tex_Menus</a> set to 1, Latex-Suite will create the + following sub-menus + </p><table border="0" summary="Simple list" class="simplelist"><tr><td><code class="literal">TeX-Suite &gt; Packages &gt; &lt;package&gt; Options</code></td></tr><tr><td><code class="literal">TeX-Suite &gt; Packages &gt; &lt;package&gt; Commands</code></td></tr></table><p> + </p><p> + where <code class="literal">&lt;package&gt;</code> is the package you just + inserted (or was detected). You can use these menus to insert commands, + environments and options which Latex-Suite recognizes as belonging to this + package. + </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> + While inserting an option, you need to position yourself in the + appropriate place in the document, most commonly inside the square + braces in the <code class="literal">\usepackage[]{packname}</code> command. Latex-Suite + will not navigate to that location. + </p></div><p> + In addition to creating these sub-menus, Latex-Suite will also scan the + <code class="literal">$VIM/ftplugin/latex-suite/dictionaries</code> directory and + if a dictionary file corresponding to the package file is found, then + it will add the file to the <code class="literal">'dict'</code> setting in Vim + so you can use the <code class="literal">&lt;C-X&gt;&lt;C-K&gt;</code> command to + complete words from that file. + </p><p> + For example, the <code class="literal">SIUnits</code> package has a custom + dictionary. + </p><a id="latex-package-scanning"></a><p> + If a package detected at startup is found by Latex-Suite in the current + directory or in a location specified by the <a class="link" href="customizing-packages.html#Tex_TEXINPUTS" title="11.10.1 g:Tex_TEXINPUTS">g:Tex_TEXINPUTS</a> variable, Latex-Suite will + scan the package for <code class="literal">\newenvironment</code> and + <code class="literal">newcommand</code> lines and also append any commands and + environments found to the list of commands and environments which you + are prompted with when you press <a class="link" href="environment-mappings.html#inserting-env-f5" title="3.1.1.1 Method 1: Pressing &lt;F5&gt;"><code class="literal">&lt;F5&gt;</code></a> or <a class="link" href="latex-command-maps.html#ls-imap-f7"><code class="literal">&lt;F7&gt;</code></a> in insert + mode. + </p></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="inserting-packages.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="latex-packages.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="automatic-package-detection.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">4.1 Inserting package commands </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 4.3 Automatic Package detection</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite/part-compiling.html b/.vim/doc/latex-suite/part-compiling.html @@ -0,0 +1,26 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>6.5 Compiling parts of a file</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="Latex-Suite Reference"></link><link rel="up" href="latex-compiling.html" title="6 LaTeX Compiling"></link><link rel="prev" href="compiler-output-customization.html" title="6.4 Customizing the compiler output"></link><link rel="next" href="latex-viewing.html" title="7 Latex Viewing and Searching"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">6.5 Compiling parts of a file</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="compiler-output-customization.html">Prev</a> </td><th width="60%" align="center">6 LaTeX Compiling</th><td width="20%" align="right"> <a accesskey="n" href="latex-viewing.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="6.5 Compiling parts of a file"><div class="titlepage"><div><div><h3 class="title"><a id="part-compiling"></a>6.5 Compiling parts of a file</h3></div></div></div><p> + Latex-Suite also provides a way to compile a fragment of a document. This can be + very useful while debugging a complex equation or one chapter in a book, + etc. + </p><p> + To do this, visually select a portion of the text and press + <code class="literal">\ll</code> while in visual mode. The visually selected portion + will be saved to a temporary file with the preamble from the current + document prepended. Latex-Suite will then switch focus to this temporary file and + compile it. Continue to debug this file as required and then replace the + portion of the original file with this one. + </p><p> + Pressing <code class="literal">\lv</code> while viewing the temporary file will + view the output file generated from the temporary file, not the original + file + </p><p> + Two commands |TPartComp| and |TPartView| are provided to be able to get + this functionality via the command line. + </p><p> + From release 1.6 onwards of Latex-Suite, the temporary file created + for part compilation will reside in the same directory as the file from + which the fragment is being created. This ensures that any relative + path-names defined in the fragment will still work. Latex-Suite will + attempt to clean the temporary file(s) created when Vim exits. + </p></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="compiler-output-customization.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="latex-compiling.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="latex-viewing.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">6.4 Customizing the compiler output </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 7 Latex Viewing and Searching</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite/recommended-settings.html b/.vim/doc/latex-suite/recommended-settings.html @@ -0,0 +1,42 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>1 Installation and recommended Settings</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="Latex-Suite Reference"></link><link rel="up" href="index.html" title="Latex-Suite Reference"></link><link rel="prev" href="index.html" title="Latex-Suite Reference"></link><link rel="next" href="latex-suite-templates.html" title="2 Inserting Templates"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">1 Installation and recommended Settings</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="index.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="latex-suite-templates.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="1 Installation and recommended Settings"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="recommended-settings"></a>1 Installation and recommended Settings</h2></div></div></div><p> + If you are reading this, it most probably means that you have already + installed Latex-Suite and the help files. If this is not the case, follow the + detailed instructions on <a class="ulink" href="http://vim-latex.sourceforge.net/index.php?subject=download" target="_top">Latex-Suite's + download page</a>. + </p><p> + Make sure that you create a few necessary settings in your + <code class="literal">~/.vimrc.</code> + </p><pre class="programlisting"> +" REQUIRED. This makes vim invoke Latex-Suite when you open a tex file. +filetype plugin on + +" IMPORTANT: win32 users will need to have 'shellslash' set so that latex +" can be called correctly. +set shellslash + +" IMPORTANT: grep will sometimes skip displaying the file name if you +" search in a singe file. This will confuse Latex-Suite. Set your grep +" program to always generate a file-name. +set grepprg=grep\ -nH\ $* + +" OPTIONAL: This enables automatic indentation as you type. +filetype indent on + +" OPTIONAL: Starting with Vim 7, the filetype of empty .tex files defaults to +" 'plaintex' instead of 'tex', which results in vim-latex not being loaded. +" The following changes the default filetype back to 'tex': +let g:tex_flavor='latex' +</pre><p> + </p><p> + In addition, the following settings could go in your ~/.vim/ftplugin/tex.vim + file: + </p><pre class="programlisting">" this is mostly a matter of taste. but LaTeX looks good with just a bit +" of indentation. +set sw=2 +" TIP: if you write your \label's as \label{fig:something}, then if you +" type in \ref{fig: and press &lt;C-n&gt; you will automatically cycle through +" all the figure labels. Very useful! +set iskeyword+=: +</pre><p> + </p></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="index.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="latex-suite-templates.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Latex-Suite Reference </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 2 Inserting Templates</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite/section-mappings.html b/.vim/doc/latex-suite/section-mappings.html @@ -0,0 +1,29 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>3.4 Section Mappings</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="Latex-Suite Reference"></link><link rel="up" href="latex-macros.html" title="3 Latex-Suite Macros"></link><link rel="prev" href="font-maps.html" title="3.3 Font Mappings"></link><link rel="next" href="greek-letter-mappings.html" title="3.5 Greek Letter Mappings"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">3.4 Section Mappings</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="font-maps.html">Prev</a> </td><th width="60%" align="center">3 Latex-Suite Macros</th><td width="20%" align="right"> <a accesskey="n" href="greek-letter-mappings.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="3.4 Section Mappings"><div class="titlepage"><div><div><h3 class="title"><a id="section-mappings"></a>3.4 Section Mappings</h3></div></div></div><p> + These maps insert LaTeX sections such as: + </p><pre class="programlisting">\section{&lt;++&gt;}&lt;++&gt;</pre><p> + etc. Just as in the case of environments and fonts, can be enclosed with a + visual selection. The enclosing is not sensitive to character or line-wise + selection. + </p><p> + Mnemonic: (make your own!) + </p><pre class="programlisting">SPA for part +SCH for chapter +SSE for section +SSS for subsection +SS2 for subsubsection +SPG for paragraph +SSP for subparagraph</pre><p> + </p><p> + Example: + SSE in insert mode inserts + </p><pre class="programlisting">\section{&lt;++&gt;}&lt;++&gt;</pre><p> + If you select a word or line and press <code class="literal">,se</code>, then you + get + </p><pre class="programlisting">\section{section name}</pre><p> + The menu item in Tex-Environments.Sections have a sub-menu called + 'Advanced'. Choosing an item from this sub-menu asks a couple of questions + (whether you want to include the section in the table of contents, whether + there is a shorter name for the table of contents) and then creates a more + intelligent template. + </p></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="font-maps.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="latex-macros.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="greek-letter-mappings.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">3.3 Font Mappings </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 3.5 Greek Letter Mappings</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite/smart-keys.html b/.vim/doc/latex-suite/smart-keys.html @@ -0,0 +1,24 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>3.9 Smart Key Mappings</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="Latex-Suite Reference"></link><link rel="up" href="latex-macros.html" title="3 Latex-Suite Macros"></link><link rel="prev" href="bibtex-bindings.html" title="3.8 BibTeX Shortcuts"></link><link rel="next" href="altkey-mappings.html" title="3.10 Alt Key Macros"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">3.9 Smart Key Mappings</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bibtex-bindings.html">Prev</a> </td><th width="60%" align="center">3 Latex-Suite Macros</th><td width="20%" align="right"> <a accesskey="n" href="altkey-mappings.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="3.9 Smart Key Mappings"><div class="titlepage"><div><div><h3 class="title"><a id="smart-keys"></a>3.9 Smart Key Mappings</h3></div></div></div><p> + Latex-Suite ships with the following smart keys: + </p><p title="Smart Backspace"><a id="smart-backspace"></a><b>Smart Backspace. </b> + Pressing <code class="literal">&lt;BS&gt;</code> in insert mode checks to see + whether we are just after something like <code class="literal">\'{a}</code> and + if so, deletes all of it. i.e, diacritics are treated as single + characters for backspacing. + </p><p title="Smart Quotes"><b>Smart Quotes. </b> + Pressing <code class="literal">"</code> (English double quote) will insert + <code class="literal">``</code> or <code class="literal">''</code> by making an + intelligent guess about whether we intended to open or close a quote. + </p><p title="Smart Space"><b>Smart Space. </b> + Latex-Suite maps the <code class="literal">&lt;space&gt;</code> key in such a + way that $ characters are not broken across lines. It does this by + first setting <code class="literal">tw=0</code> so that Vim will not + automatically break lines and then maps the + <code class="literal">&lt;space&gt;</code> key to insert newlines keeping + <code class="literal">$$</code>'s on the same line. + </p><p title="Smart Dots"><b>Smart Dots. </b> + Pressing <code class="literal">...</code> (3 dots) results in + <code class="literal">\ldots</code> outside math mode and + <code class="literal">\cdots</code> in math mode. + </p></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bibtex-bindings.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="latex-macros.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="altkey-mappings.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">3.8 BibTeX Shortcuts </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 3.10 Alt Key Macros</td></tr></table></div></body></html> diff --git a/.vim/doc/latex-suite/supporting-packages.html b/.vim/doc/latex-suite/supporting-packages.html @@ -0,0 +1,61 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>4.4 Writing supporting for a package</title><link rel="stylesheet" href="../latex-suite.css" type="text/css"></link><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"></meta><link rel="home" href="index.html" title="Latex-Suite Reference"></link><link rel="up" href="latex-packages.html" title="4 Package Handling"></link><link rel="prev" href="automatic-package-detection.html" title="4.3 Automatic Package detection"></link><link rel="next" href="latex-completion.html" title="5 Latex Completion"></link></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">4.4 Writing supporting for a package</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="automatic-package-detection.html">Prev</a> </td><th width="60%" align="center">4 Package Handling</th><td width="20%" align="right"> <a accesskey="n" href="latex-completion.html">Next</a></td></tr></table><hr></hr></div><div class="section" title="4.4 Writing supporting for a package"><div class="titlepage"><div><div><h3 class="title"><a id="supporting-packages"></a>4.4 Writing supporting for a package</h3></div></div></div><div class="toc"><dl><dt><span class="section"><a href="supporting-packages.html#id389896">4.4.1 <code class="literal">g:Tex_package_option_&lt;package&gt;</code></a></span></dt><dt><span class="section"><a href="supporting-packages.html#id389941">4.4.2 <code class="literal">g:Tex_package_&lt;package&gt;</code></a></span></dt></dl></div><p> + Supporting a package is easy and consists of writing a vim script with + the same name as the package and placing it in the + <code class="literal">$VIM/ftplugin/latex-suite/packages</code> directory. A + package script should define two variables as described in the next two + sections. In addition to these two variables, you can also define any + functions, environment definitions etc. in this file. + </p><div class="section" title="4.4.1 g:Tex_package_option_&lt;package&gt;"><div class="titlepage"><div><div><h4 class="title"><a id="id389896"></a>4.4.1 <code class="literal">g:Tex_package_option_&lt;package&gt;</code></h4></div></div></div><p> + This setting is a string containing a comma separated list of options + supported by this package. + </p><p> + Example: + </p><pre class="programlisting">g:Tex_package_option_mypack = 'opt1,opt2=,sbr:group1,opt3,opt4'</pre><p> + The <code class="literal">=</code> suffix means that the option takes a value. + Use <code class="literal">sbr:group name</code> to separate options into + sub-menus. All successive options will be clubbed into the + <code class="literal">group1</code> sub-menu till the next + <code class="literal">sbr:</code> option is encountered. + </p></div><div class="section" title="4.4.2 g:Tex_package_&lt;package&gt;"><div class="titlepage"><div><div><h4 class="title"><a id="id389941"></a>4.4.2 <code class="literal">g:Tex_package_&lt;package&gt;</code></h4></div></div></div><pre class="programlisting"> + g:TeX_package_&lt;package&gt; = "pre:Command,pre:Command1" +More detailed example is in latex-suite/packages/exmpl file (slightly +outdated). +Here is short summary of prefixes which can be used in package files: +(x - place with cursor, &lt;++&gt; - |placeholder|) + +{env:command} Environment: creates simple environment template + \begin{command} + x + \end{command}&lt;++&gt; +{eno:command} Environment with option: + \begin[x]{command} + &lt;++&gt; + \end{command}&lt;++&gt; +{ens:command[&lt;&lt;option&gt;&gt;]...} Environment special: + \begin[&lt;&lt;option&gt;&gt;]...{command} + &lt;++&gt; + \end{command}&lt;++&gt; +{bra:command} Brackets: + \command{x}&lt;++&gt; +{brd:command} Brackets double: + \command{x}{&lt;++&gt;}&lt;++&gt; +{brs:command[&lt;&lt;option&gt;&gt;]...} Brackets special (as environment special: + \command[&lt;+x+&gt;]{&lt;++&gt;}{&lt;++&gt;}&lt;++&gt; +{nor:command} Normal: + \command&lt;Space +{noo:command} Normal with option: + \command[x]&lt;++&gt; +{nob:command} Normal with option and brackets: + \command[x]{&lt;++&gt;}&lt;++&gt; +{pla:command} Plain: + command&lt;Space +{spe:command} Special: + command &lt;-literal insertion of command +{sep:command} creates separator. Good for aesthetics and usability :) +{sbr:command} Breaks menu into submenus. &lt;command&gt; will be title of submenu. + Can be used also in package variable. + +Command can be also given without prefix:. The result is + \command + </pre></div></div><div class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="automatic-package-detection.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="latex-packages.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="latex-completion.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">4.3 Automatic Package detection </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 5 Latex Completion</td></tr></table></div></body></html> diff --git a/.vim/doc/latexhelp.txt b/.vim/doc/latexhelp.txt @@ -0,0 +1,2430 @@ +*latexhelp.txt* For Vim version 6.0. Last change: 2001 Dec 20 + + + LATEX HELP 1.6 + translated (with minor changes) for vim + by Mikolaj Machowski + +This file documents LaTeX2e, a document preparation system. LaTeX2e is a +macro package for TeX. + + This is edition 1.6 of the LaTeX2e documentation, and is for the Texinfo +that is distributed as part of Version 19 of GNU Emacs. It uses version +2.134 or later of the texinfo.tex input file. + + This is translated from LATEX.HLP v1.0a in the VMS Help Library. The +pre-translation version was written by George D. Greenwade of Sam Houston +State University. + + The LaTeX 2.09 version was written by Stephen Gilmore <stg@dcs.ed.ac.uk>. + + The LaTeX2e version was adapted from this by Torsten Martinsen +<bullestock@dk-online.dk>. + + Version for vim of this manual was written by Mikolaj Machowski +<mikmach@wp.pl> + + Copyright 1988,1994 Free Software Foundation, Inc. Copyright 1994-1996 +Torsten Martinsen. Copyright for `translation' for vim Mikolaj Machowski 2001. + + Permission is granted to make and distribute verbatim copies of this manual +provided the copyright notice and this permission notice are preserved on +all copies. + + Permission is granted to copy and distribute modified versions of this +manual under the conditions for verbatim copying, provided that the entire +resulting derived work is distributed under the terms of a permission +notice identical to this one. + + Permission is granted to copy and distribute translations of this manual +into another language, under the above conditions for modified versions, +except that the sections entitled "Distribution" and "General Public +License" may be included in a translation approved by the author instead of +in the original English. + +============================================================================== +*LaTeX* *latex* + +The LaTeX command typesets a file of text using the TeX program and the LaTeX +Macro package for TeX. To be more specific, it processes an input file +containing the text of a document with interspersed commands that describe how +the text should be formatted. + +1. Commands |latex-commands| +2. Counters |latex-counters| +3. Cross References |latex-references| +4. Definitions |latex-definitions| +5. Document Classes |latex-classes| +6. Layout |latex-layout| +7. Environments |latex-environments| +8. Footnotes |latex-footnotes| +9. Lengths |latex-lengths| +10. Letters |latex-letters| +11. Line & Page Breaking |latex-breaking| +12. Making Paragraphs |latex-paragraphs| +13. Margin Notes |latex-margin-notes| +14. Math Formulae |latex-math| +15. Modes |latex-modes| +16. Page Styles |latex-page-styles| +17. Sectioning |latex-sectioning| +18. Spaces & Boxes |latex-spaces-boxes| +19. Special Characters |latex-special-char| +20. Splitting the Input |latex-inputting| +21. Starting & Ending |latex-start-end| +22. Table of Contents |latex-toc| +23. Terminal Input/Output |latex-terminal| +24. Typefaces |latex-typefaces| +25. Parameters |latex-parameters| + +============================================================================== +1. Commands *latex-commands* + +A LaTeX command begins with the command name, which consists of a \ followed +by either + (a) a string of letters or + (b) a single non-letter. + +Arguments contained in square brackets, [], are optional while arguments +contained in braces, {}, are required. + +NOTE: LaTeX is case sensitive. Enter all commands in lower case unless +explicitly directed to do otherwise. + +============================================================================== +2. Counters *latex-counters* + +|\addtocounter| Add a quantity to a counter +|\alph| Print value of a counter using letters +|\arabic| Print value of a counter using numerals +|\fnsymbol| Print value of a counter using symbols +|\newcounter| Define a new counter +|\refstepcounter| Add to counter, resetting subsidiary counters +|\roman| Print value of a counter using roman numerals +|\setcounter| Set the value of a counter +|\stepcounter| Add to counter, resetting subsidiary counters +|\usecounter| Use a specified counter in a list environment +|\value| Use the value of a counter in an expression + +Everything LaTeX numbers for you has a counter associated with it. The name of +the counter is the same as the name of the environment or command that +produces the number, except with no |\\|. (|lc-enumi| - |lc-enumiv| are used +for the nested |\enumerate| environment.) Below is a list of the counters +used in LaTeX's standard document classes to control numbering. + + |part| |paragraph| |figure| |enumi| |itemi| + |chapter| |subparagraph| |table| |enumii| |itemii| + |section| |page| |footnote| |enumiii| |itemiii| + |subsection| |equation| |mpfootnote| |enumiv| |itemiv| + |subsubsection| + + +\addtocounter{counter}{value} *\addtocounter* + Increments the {counter} by the amount specified by the + {value} argument. The {value} argument can be negative. + +\alph{counter} *\alph* *\Alph* +\Alph{counter} + This command causes the value of the counter to be printed in + alphabetic characters. |\alph| command uses lower case + alphabetic alphabetic characters, i.e., a, b, c... while the + |\Alph| command uses upper case alphabetic characters, i.e., + A, B, C.... + +\arabic{counter} *\arabic* + Causes the value of the {counter} to be printed in Arabic + numbers, i.e., 3. + +\fnsymbol{counter} *\fnsymbol* + Causes the value of the {counter} to be printed in a specific + sequence of nine symbols that can be used for numbering + footnotes. + Note: counter must have a value between 1 and 9 inclusive. + +\newcounter{foo}[counter] *\newcounter* + Defines a new counter named {foo}. The counter is initialized + to zero. The optional argument [counter] causes the counter + {foo} to be reset whenever the counter named in the optional + argument is incremented. + +\refstepcounter{counter} *\refstepcounter* + Command works like |\stepcounter|, except it also defines the + current |\ref| value to be the result of \thecounter. + +\roman{counter} *\roman* *\Roman* +\Roman{counter} + Causes the value of the {counter} to be printed in Roman + numerals. The |\roman| command uses lower case Roman numerals, + i.e., i, ii, iii..., while the |\Roman| command uses upper case + Roman numerals, i.e., I, II, III.... + +\stepcounter{counter} *\stepcounter* + Adds one to the {counter} and resets all subsidiary counters. + +\setcounter{counter}{value} *\setcounter* + Sets the value of the {counter} to that specified by the + {value} argument. + +\usecounter{counter} *\usecounter* + Command is used in the second argument of the |list| + environment to allow the {counter} specified to be used to + number the list items. + +\value{counter} *\value* + Produces the value of the {counter} named in the mandatory + argument. It can be used where LaTeX expects an integer or + number, such as the second argument of a |\setcounter| or + |\addtocounter| command, or in: > + \hspace{\value{foo}\parindent} +< It is useful for doing arithmetic with counters. + +============================================================================== +3. Cross References *latex-references* + +One reason for numbering things like figures and equations is to refer the +reader to them, as in "See Figure 3 for more details." + +|\label| Assign a symbolic name to a piece of text +|\pageref| Refer to a page number +|\ref| Refer to a section, figure or similar + + +\label{key} *\label* + Command appearing in ordinary text assigns to the {key} the + number of the current sectional unit; one appearing inside a + numbered environment assigns that number to the {key}. + + A {key} can consist of any sequence of letters, digits, or + punctuation characters. Upper and lowercase letters are + different. + + To avoid accidentally creating two labels with the same name, + it is common to use labels consisting of a prefix and a suffix + separated by a colon. The prefixes conventionally used are + * 'cha' for chapters + * 'sec' for lower-level sectioning commands + * 'fig' for figures + * 'tab' for tables + * 'eq' for equations + Thus, a label for a figure would look like: > + \label{fig:bandersnatch} + +\pageref{key} *\pageref* + Command produces the page number of the place in the text + where the corresponding |\label| command appears. ie. where + \label{key} appears. + +\ref{key} *\ref* + Command produces the number of the sectional unit, equation + number, ... of the corresponding |\label| command. + +============================================================================== +4. Definitions *latex-definitions* + +|\newcommand| Define a new command +|\newenvironment| Define a new environment +|\newtheorem| Define a new theorem-like environment +|\newfont| Define a new font name + + +\newcommand{cmd}[args]{definition} *\newcommand* *\renewcommand* +\newcommand{cmd}[args][default]{definition} +\renewcommand{cmd}[args]{definition} +\renewcommand{cmd}[args][default]{definition} + +These commands define (or redefine) a command. + +{cmd} A command name beginning with a |\\|. For |\newcommand| it must + not be already defined and must not begin with |\end|; for + |\renewcommand| it must already be defined. + +{args} An integer from 1 to 9 denoting the number of arguments of the + command being defined. The default is for the command to have + no arguments. + +{default} If this optional parameter is present, it means that the + command's first argument is optional. The default value of the + optional argument is default. + +{definition} The text to be substituted for every occurrence of {cmd}; a + parameter of the form #n in {cmd} is replaced by the text of + the nth argument when this substitution takes place. + + *\newenvironment* *\renewenvironment* +\newenvironment{nam}[args]{begdef}{enddef} +\newenvironment{nam}[args][default]{begdef}{enddef} +\renewenvironment{nam}[args]{begdef}{enddef} + +These commands define or redefine an environment. + +{nam} The name of the environment. For |\newenvironment| there must + be no currently defined environment by that name, and the + command \nam must be undefined. For |\renewenvironment| the + environment must already be defined. + +{args} An integer from 1 to 9 denoting the number of arguments of + the newly-defined environment. The default is no arguments. + +{default} If this is specified, the first argument is optional, and + default gives the default value for that argument. + +{begdef} The text substituted for every occurrence of \begin{nam}; a + parameter of the form #n in {cmd} is replaced by the text of + the nth argument when this substitution takes place. + +{enddef} The text substituted for every occurrence of \end{nam}. It + may not contain any argument parameters. + + +\newtheorem{envname}{caption}[within] *\newtheorem* +\newtheorem{envname}[numberedlike]{caption} + +This command defines a theorem-like environment. + +{envname} The name of the environment to be defined. A string of + letters. It must not be the name of an existing environment or + counter. + +{caption} The text printed at the beginning of the environment, right + before the number. This may simply say "Theorem", for example. + +{within} The name of an already defined counter, usually of a sectional + unit. Provides a means of resetting the new theorem counter + within the sectional unit. + +{numberedlike} The name of an already defined theorem-like environment. + +The |\newtheorem| command may have at most one optional argument. + + +\newfont{cmd}{fontname} *\newfont* + Defines the command name {cmd}, which must not be currently + defined, to be a declaration that selects the font named + {fontname} to be the current font. + +============================================================================== +5. Document Classes *latex-classes* + + +\documentclass[options]{class} *\documentclass* + +Valid LaTeX document classes include: + *article *article-class* + *report *report-class* + *letter *letter-class* + *book *book-class* + *slides *slides-class* + +All the standard classes (except slides) accept the following options for +selecting the typeface size (10 pt is default): + +10pt, 11pt, 12pt + +All classes accept these options for selecting the paper size (default is +letter): + +a4paper, a5paper, b5paper, letterpaper, legalpaper, executivepaper + +Miscellaneous options: + +landscape *landscape* + Selects landscape format. Default is portrait. + +titlepage, notitlepage *notitlepage* + Selects if there should be a separate title page. + +leqno *leqno* *rqno* + Equation number on left side of equations. Default is + right side. + +fleqn *fleqn* + Displayed formulas flush left. Default is centred. + +openbib *openbib* + Use "open" bibliography format. + +draft, final *draft* *final* + Mark/do not mark overfull boxes with a rule. Default is + final. + +These options are not available with the slides class: + +oneside, twoside *oneside* *twoside* + Selects one- or twosided layout. Default is oneside, + except for the book class. + +openright, openany *openright* *openany* + Determines if a chapter should start on a right-hand page. + Default is openright for book. + +onecolumn, twocolumn *onecolumn* *twocolumn* + One or two columns. Defaults to one column. + +The slides class offers the option clock for printing the time at the bottom +of each |\note|. + +If you specify more than one option, they must be separated by a comma. + +\usepackage[options]{pkg} *\usepackage* + Additional packages are loaded by this. If you + specify more than one package, they must be separated by a + comma. + +Any options given in the |\documentclass| command that are unknown by the +selected document class are passed on to the packages loaded with |\usepackage|. + +============================================================================== +6. Layout *latex-layout* + +Miscellaneous commands for controlling the general layout of the page. + +|\flushbottom| Make all text pages the same height. +|\onecolumn| Use one-column layout. +|\raggedbottom| Allow text pages of differing height. +|\twocolumn| Use two-column layout. + +\flushbottom *\flushbottom* + Makes all text pages the same height, adding extra vertical + space when necessary to fill out the page. This is the + standard if twocolumn mode is selected. + +\onecolumn *\onecolumn* + Starts a new page and produces single-column output. + +\raggedbottom *\raggedbottom* + Makes all pages the height of the text on that page. No extra + vertical space is added. + +\twocolumn[text] *\twocolumn* + Starts a new page and produces two-column output. If the + optional [text] argument is present, it is typeset in + one-column mode. + +============================================================================== +7. Environments *latex-environments* + + *\begin* *\end* +LaTeX provides a number of different paragraph-making environments. Each +environment begins and ends in the same manner: > + + \begin{environment-name} + . + . + . + \end{environment-name} +< +a. |array| Math arrays +b. |center| Centred lines +c. |description| Labelled lists +d. |enumerate| Numbered lists +e. |eqnarray| Sequences of aligned equations +f. |equation| Displayed equation +g. |figure| Floating figures +h. |flushleft| Flushed left lines +i. |flushright| Flushed right lines +j. |itemize| Bulleted lists +k. |letter| Letters +l. |list| Generic list environment +m. |minipage| Miniature page +n. |picture| Picture with text, arrows, lines and circles +o. |quotation| Indented environment with paragraph indentation +p. |quote-l| Indented environment with no paragraph indentation +q. |tabbing| Align text arbitrarily +r. |table| Floating tables +s. |tabular| Align text in columns +t. |thebibliography| Bibliography or reference list +u. |theorem| Theorems, lemmas, etc +v. |titlepage| For hand crafted title pages +x. |verbatim| Simulating typed input +y. |verse| For poetry and other things + +============================================================================== + a. array *array* +> + \begin{array}{col1col2...coln} + column 1 entry & column 2 entry ... & column n entry \\ + . + . + . + \end{array} + +Math arrays are produced with the |array| environment. It has a single mandatory +argument describing the number of columns and the alignment within them. Each +column, coln, is specified by a single letter that tells how items in that row +should be formatted. + * c -- for centred + * l -- for flush left + * r -- for flush right +Column entries must be separated by an |&|. Column entries may include other +LaTeX commands. Each row of the array must be terminated with the string |\\|. + +Note that the |array| environment can only be used in |math-mode|, so normally +it is used inside an |equation| environment. + +============================================================================== +b. center *center* +> + \begin{center} + Text on line 1 \\ + Text on line 2 \\ + . + . + . + \end{center} + +The |\center| environment allows you to create a paragraph consisting of lines +that are centred within the left and right margins on the current page. Each +line must be terminated with the string |\\|. + +\centering *\centering* + This declaration corresponds to the |center| environment. This + declaration can be used inside an environment such as + |quote-l| or in a |\parbox|. The text of a |figure| or |table| + can be centred on the page by putting a |\centering| command + at the beginning of the |figure| or |table| environment. + Unlike the |center| environment, the |\centering| command does + not start a new paragraph; it simply changes how LaTeX formats + paragraph units. To affect a paragraph unit's format, the + scope of the declaration must contain the blank line or |\end| + command (of an environment like |quote-l|) that ends the + paragraph unit. + +============================================================================== +c. description *description* +> + \begin{description} + \item [label] First item + \item [label] Second item + . + . + . + \end{description} + +The |description| environment is used to make labelled lists. The label is +bold face and flushed right. + +============================================================================== +d. enumerate *enumerate* +> + \begin{enumerate} + \item First item + \item Second item + . + . + . + \end{enumerate} + +The |enumerate| environment produces a numbered list. Enumerations can be +nested within one another, up to four levels deep. They can also be nested +within other paragraph-making environments. + +\item Each item of an enumerated list begins with an |\item| + command. There must be at least one |\item| command + within the environment. + +The |enumerate| environment uses the |\enumi| through |\enumiv| counters (see +section |latex-counters|). The type of numbering can be changed by redefining +\theenumi etc. + +============================================================================== +e. eqnarray *eqnarray* +> + \begin{eqnarray} + math formula 1 \\ + math formula 2 \\ + . + . + . + \end{eqnarray} + +The |eqnarray| environment is used to display a sequence of equations or +inequalities. It is very much like a three-column |array| environment, with +consecutive rows separated by |\\| and consecutive items within a row separated +by an |&|. + +\nonumber *\nonumber* + An equation number is placed on every line unless that + line has a |\nonumber| command. + +\lefteqn *\lefteqn* + The command |\lefteqn| is used for splitting long + formulas across lines. It typesets its argument in + display style flush left in a box of zero width. + +============================================================================== +f. equation *equation* +> + \begin{equation} + math formula + \end{equation} + +The |equation| environment centres your equation on the page and places the +equation number in the right margin. + +============================================================================== +g. figure *figure* +> + \begin{figure}[placement] + body of the figure + \caption{figure title} + \end{figure} + +Figures are objects that are not part of the normal text, and are usually +"floated" to a convenient place, like the top of a page. Figures will not be +split between two pages. + +The optional argument [placement] determines where LaTeX will try to place +your figure. There are four places where LaTeX can possibly put a float: + +h (Here) at the position in the text where the figure + environment appears. +t (Top) at the top of a text page. +b (Bottom) at the bottom of a text page. +p (Page of floats) on a separate float page, which is a page containing + no text, only floats. + +The standard |report-class| and |article-class| use the default placement +[tbp]. + +The body of the |figure| is made up of whatever text, LaTeX commands, etc. you +wish. + +The \caption command allows you to title your figure. + +============================================================================== +h. flushleft *flushleft* +> + \begin{flushleft} + Text on line 1 \\ + Text on line 2 \\ + . + . + . + \end{flushleft} + +The |flushleft| environment allows you to create a paragraph consisting of +lines that are flushed left, to the left-hand margin. Each line must be +terminated with the string |\\|. + +\raggedright *\raggedright* + This declaration corresponds to the |flushleft| environment. + This declaration can be used inside an environment such as + |quote-l| or in a |\parbox|. Unlike the |flushleft| + environment, the |\raggedright| command does not start a new + paragraph; it simply changes how LaTeX formats paragraph + units. To affect a paragraph unit's format, the scope of the + declaration must contain the blank line or |\end| command (of + an environment like |quote-l|) that ends the paragraph unit. + +============================================================================== +i. flushright *flushright* +> + \begin{flushright} + Text on line 1 \\ + Text on line 2 \\ + . + . + . + \end{flushright} + +The |flushright| environment allows you to create a paragraph consisting of +lines that are flushed right, to the right-hand margin. Each line must be +terminated with the string |\\|. + +\raggedleft *\raggedleft* + This declaration corresponds to the |flushright| environment. + This declaration can be used inside an environment such as + |quote-l| or in a |\parbox|. Unlike the |flushright| + environment, the |\raggedleft| command does not start a new + paragraph; it simply changes how LaTeX formats paragraph + units. To affect a paragraph unit's format, the scope of the + declaration must contain the blank line or |\end| command (of + an environment like |quote-l|) that ends the paragraph unit. + +============================================================================== +j. itemize *itemize* +> + \begin{itemize} + \item First item + \item Second item + . + . + . + \end{itemize} + +The |itemize| environment produces a "bulleted" list. Itemizations can be +nested within one another, up to four levels deep. They can also be nested +within other paragraph-making environments. + +\item *\item* + Each item of an itemized list begins with an |\item| command. + There must be at least one |\item| command within the + environment. + +The itemize environment uses the |\itemi| through |\itemiv| counters (see +section |latex-counters|). The type of numbering can be changed by redefining +\theitemi etc. + +============================================================================== +k. letter *\letter* + +This environment is used for creating letters. See section |latex-letters|. + +============================================================================== +l. list *list* + +The |list| environment is a generic environment which is used for defining many +of the more specific environments. It is seldom used in documents, but often +in macros. +> + \begin{list}{label}{spacing} + \item First item + \item Second item + . + . + . + \end{list} + +'label' The {label} argument specifies how items should be labelled. + This argument is a piece of text that is inserted in a box to + form the {label}. This argument can and usually does contain + other LaTeX commands. + +'spacing' The {spacing} argument contains commands to change the spacing + parameters for the |list|. This argument will most often be + null, i.e., {}. This will select all default spacing which + should suffice for most cases. + +============================================================================== +m. minipage *minipage* +> + \begin{minipage}[position]{width} + text + \end{minipage} + +The |minipage| environment is similar to a |\parbox| command. It takes the +same optional [position] argument and mandatory {width} argument. You may use +other paragraph-making environments inside a |minipage|. Footnotes in a +minipage environment are handled in a way that is particularly useful for +putting footnotes in figures or tables. A |\footnote| or |\footnotetext| +command puts the footnote at the bottom of the minipage instead of at the +bottom of the page, and it uses the |\mpfootnote| counter instead of the +ordinary footnote counter. See sections |latex-counters| and +|latex-footnotes|. + +NOTE: Don't put one |minipage| inside another if you are using footnotes; they +may wind up at the bottom of the wrong minipage. + +============================================================================== +n. picture *picture* +> + size position + \begin{picture}(width,height)(x offset,y offset) + . + . + picture commands + . + . + \end{picture} + +The |picture| environment allows you to create just about any kind of picture +you want containing text, lines, arrows and circles. You tell LaTeX where to +put things in the picture by specifying their coordinates. A coordinate is a +number that may have a decimal point and a minus sign -- a number like 5, 2.3 +or -3.1416. A coordinate specifies a length in multiples of the unit length +|\unitlength|, so if |\unitlength| has been set to 1cm, then the coordinate +2.54 specifies a length of 2.54 centimetres. You can change the value of +|\unitlength| anywhere you want, using the |\setlength| command, but strange +things will happen if you try changing it inside the |picture| environment. + +A position is a pair of coordinates, such as (2.4,-5), specifying the point +with x-coordinate 2.4 and y-coordinate -5. Coordinates are specified in the +usual way with respect to an origin, which is normally at the lower-left +corner of the |picture|. +Note that when a position appears as an argument, it is not enclosed in +braces; the parentheses serve to delimit the argument. + +The |picture| environment has one mandatory argument, which is a position. It +specifies the size of the picture. The environment produces a rectangular box +with width and height determined by this argument's x- and y-coordinates. + +The |picture| environment also has an optional position argument, following +the size argument, that can change the origin. (Unlike ordinary optional +arguments, this argument is not contained in square brackets.) The optional +argument gives the coordinates of the point at the lower-left corner of the +picture (thereby determining the origin). For example, if |\unitlength| has +been set to 1mm, the command: > + \begin{picture}(100,200)(10,20) +> +produces a picture of width 100 millimetres and height 200 millimetres, whose +lower-left corner is the point (10,20) and whose upper-right corner is +therefore the point (110,220). When you first draw a picture, you will omit +the optional argument, leaving the origin at the lower-left corner. If you +then want to modify your picture by shifting everything, you just add the +appropriate optional argument. + +The environment's mandatory argument determines the nominal size of the +picture. This need bear no relation to how large the picture really is; LaTeX +will happily allow you to put things outside the picture, or even off the +page. The picture's nominal size is used by LaTeX in determining how much room +to leave for it. + +Everything that appears in a picture is drawn by the |\put| command. The +command: > + \put (11.3,-.3){...} + +puts the object specified by ... in the picture, with its +reference point at coordinates (11.3,-.3). The reference points for various +objects will be described below. + +The |\put| creates an LR box (|lrbox|). You can put anything in the text +argument of the |\put| that you'd put into the argument of an |\mbox| and +related commands. When you do this, the reference point will be the lower left +corner of the box. + +Picture commands: +|\circle| Draw a circle +|\dashbox| Draw a dashed box +|\frame| Draw a frame around an object +|\framebox(picture)| Draw a box with a frame around it +|\line| Draw a straight line +|\linethickness| Set the line thickness +|\makebox(picture)| Draw a box of the specified size +|\multiput| Draw multiple instances of an object +|\oval| Draw an ellipse +|\put| Place an object at a specified place +|\shortstack| Make a pile of objects +|\vector| Draw a line with an arrow + +\circle[*]{diameter} *\circle* + Command produces a circle with a {diameter} as close to the + specified one as possible. If the *-form of the command is + used, LaTeX draws a solid circle. + Note: only circles up to 40 pt can be drawn. + + +\dashbox{dashlength}(width,height){...} *\dashbox* + Draws a box with a dashed line. The |\dashbox| has an extra + argument which specifies the width of each dash. A dashed box + looks best when the width and height are multiples of the + {dashlength}. + +\frame{...} *\frame* + Puts a rectangular frame around the object specified in the + argument. The reference point is the bottom left corner of the + frame. No extra space is put between the frame and the object. + +\framebox(width,height)[position]{...} *\picture-framebox* + The |\framebox| command is exactly the same as the + |picture-makebox| command, except that it puts a frame around + the outside of the box that it creates. The |\framebox| + command produces a rule of thickness |\fboxrule|, and leaves a + space |\fboxsep| between the rule and the contents of the box. + +\line(x slope,y slope){length} *\line* + Draws a line of the specified length and slope. + Note: LaTeX can only draw lines with slope = x/y, where x and + y have integer values from -6 through 6. + +\linethickness{dimension} *\linethickness* + Declares the thickness of horizontal and vertical lines in a + |picture| environment to be dimension, which must be a + positive length. It does not affect the thickness of slanted + lines (|\line|) and circles (|circle|), or the quarter circles + drawn by |\oval| to form the corners of an oval. + +\makebox(width,height)[position]{...} *picture-makebox* + The makebox command for the |picture| environment is similar + to the normal |\makebox| command except that you must specify + a width and height in multiples of |\unitlength|. + The optional argument, [position], specifies the quadrant that + your text appears in. You may select up to two of the + following: + t - Moves the item to the top of the rectangle + b - Moves the item to the bottom + l - Moves the item to the left + r - Moves the item to the right + + *\multiput* +\multiput(x coord,y coord)(delta x,delta y){no of copies}{object} + This command can be used when you are putting the same + object in a regular pattern across a picture. + +\oval(width,height)[portion] *\oval* + Produces a rectangle with rounded corners. The optional + argument, [portion], allows you to select part of the oval. + t - top portion + b - bottom portion + r - right portion + l - left portion + Note: the "corners" of the oval are made with quarter circles + with a maximum radius of 20 pt, so large "ovals" will look + more like boxes with rounded corners. + +\put(x coord,y coord){ ... } *\put* + Places the item specified by the mandatory argument at the + given coordinates. + +\shortstack[position]{... \\ ... \\ ...} *\shortstack* + The |\shortstack| command produces a stack of objects. + The valid positions are: + r - right of the stack + l - left of the stack + c - centre of the stack (default) + +\vector(x slope,y slope){length} *\vector* + Draws a line with an arrow of the specified length and slope. + The x and y values must lie between -4 and +4, inclusive. + +============================================================================== +o. quotation *quotation* + > + \begin{quotation} + text + \end{quotation} + +The margins of the |quotation| environment are indented on the left and the +right. The text is justified at both margins and there is paragraph +indentation. Leaving a blank line between text produces a new paragraph. + +============================================================================== +p. quote *quote-l* +> + \begin{quote} + text + \end{quote} + +The margins of the |quote-l| environment are indented on the left and the right. +The text is justified at both margins. Leaving a blank line between text +produces a new paragraph. + +============================================================================== +q. tabbing *tabbing* +> + \begin{tabbing} + text \= more text \= still more text \= last text \\ + second row \> \> more \\ + . + . + . + \end{tabbing} + +The |tabbing| environment provides a way to align text in columns. It works by +setting tab stops and tabbing to them much the way you do with an ordinary +typewriter. + +It is best suited for cases where the width of each column is constant and +known in advance. + +This environment can be broken across pages, unlike the |tabular| environment. +The following commands can be used inside a tabbing environment: + + *tab=* +\= Sets a tab stop at the current position. + + *tab>* +\> Advances to the next tab stop. + + *tab<* +\< This command allows you to put something to the left of the + local margin without changing the margin. Can only be used at + the start of the line. + + *tab+* +\+ Moves the left margin of the next and all the following + commands one tab stop to the right. + + *tab-* +\- Moves the left margin of the next and all the following + commands one tab stop to the left. + + *tab'* +\' Moves everything that you have typed so far in the current + column, i.e. everything from the most recent \> (|tab>|), \< + (|tab<|), \' (|tab'|), |\\|, or |\kill| command, to the right + of the previous column, flush against the current column's tab + stop. + + *tab`* +\` Allows you to put text flush right against any tab stop, + including tab stop 0. However, it can't move text to the right + of the last column because there's no tab stop there. The \` + (|tab`|) command moves all the text that follows it, up to the + |\\| or \end{tabbing} command that ends the line, to the right + margin of the tabbing environment. There must be no \> + (|tab>|) or \' (|tab'|) command between the \` (|tab`|) and + the command that ends the line. + + *\kill* +\kill Sets tab stops without producing text. Works just like |\\| + except that it throws away the current line instead of + producing output for it. The effect of any \= (|tab=|), \+ + (|tab+|) or \- (|tab-|) commands in that line remain in + effect. + + *\pushtabs* +\pushtabs Saves all current tab stop positions. Useful for temporarily + changing tab stop positions in the middle of a tabbing + environment. Also restores the tab stop positions saved by the + last |\pushtabs|. + + *taba* +\a In a tabbing environment, the commands \= (|tab=|), \' + (|tab'|) and \` (|tab`|) do not produce accents as normal. + Instead, the commands \a=, \a' and \a` are used. + +This example typesets a Pascal function in a traditional format: +> + \begin{tabbing} + function \= fact(n : integer) : integer;\\ + \> begin \= \+ \\ + \> if \= n $>$ 1 then \+ \\ + fact := n * fact(n-1) \- \\ + else \+ \\ + fact := 1; \-\- \\ + end;\\ + \end{tabbing} + +============================================================================== +r. table *\table* +> + \begin{table}[placement] + body of the table + \caption{table title} + \end{table} + +Tables are objects that are not part of the normal text, and are usually +"floated" to a convenient place, like the top of a page. Tables will not be +split between two pages. + +The optional argument [placement] determines where LaTeX will try to place +your table. There are four places where LaTeX can possibly put a float: + + h (Here) at the position in the text where the table + environment appears. + t (Top) at the top of a text page. + b (Bottom) at the bottom of a text page. + p (Page of floats) on a separate float page, which is a page + containing no text, only floats. + +The standard |report-class| and |article-class| use the default placement [tbp]. + +The body of the table is made up of whatever text, LaTeX commands, etc., you +wish. + +The \caption command allows you to title your table. + +============================================================================== +s. tabular *tabular* +> + \begin{tabular}[pos]{cols} + column 1 entry & column 2 entry ... & column n entry \\ + . + . + . + \end{tabular} + +or +> + \begin{tabular*}{width}[pos]{cols} + column 1 entry & column 2 entry ... & column n entry \\ + . + . + . + \end{tabular*} + +These environments produce a box consisting of a sequence of rows of items, +aligned vertically in columns. The mandatory and optional arguments consist +of: + +{width} Specifies the width of the tabular* environment. There must be + rubber space between columns that can stretch to fill out the + specified width. + +[pos] Specifies the vertical position; default is alignment on the + centre of the environment. + t - align on top row + b - align on bottom row + +{cols} Specifies the column formatting. It consists of a sequence of + the following specifiers, corresponding to the sequence of + columns and intercolumn material. + l - A column of left-aligned items. + + r - A column of right-aligned items. + + c - A column of centred items. + + | - A vertical line the full height and depth of the + environment. + + @{text} - This inserts text in every row. An @-expression + suppresses the intercolumn space normally inserted + between columns; any desired space between the + inserted text and the adjacent items must be included + in text. An \extracolsep{wd} command in an + @-expression causes an extra space of width {wd} to + appear to the left of all subsequent columns, until + countermanded by another |\extracolsep| command. Unlike + ordinary intercolumn space, this extra space is not + suppressed by an @-expression. An |\extracolsep| + command can be used only in an @-expression in the + cols argument. + + p{wd} - Produces a column with each item typeset in a |\parbox| + of width {wd}, as if it were the argument of a + \parbox[t]{wd} command. However, a |\\| may not appear + in the item, except in the following situations: + 1. inside an environment like |minipage|, |array|, or + |tabular|. + 2. inside an explicit |\parbox|. + 3. in the scope of a |\centering|, |\raggedright|, or + |\raggedleft| declaration. The latter declarations must + appear inside braces or an environment when used in a + p-column element. + + {num}{cols} - Equivalent to num copies of cols, where num is any positive + integer and cols is any list of column-specifiers, + which may contain another -expression. + +These commands can be used inside a tabular environment: + +|\cline| Draw a horizontal line spanning some columns. +|\hline| Draw a * horizontal line spanning all columns. +|\multicolumn| Make an item spanning * several columns. +|\vline| Draw a vertical line. + + +\cline{i-j} *\cline* + The |\cline| command draws horizontal lines across the columns + specified, beginning in column i and ending in column j, + which are identified in the mandatory argument. + +\hline *\hline* + The |\hline| command will draw a horizontal line the width of + the table. It's most commonly used to draw a line at the top, + bottom, and between the rows of the table. + +\multicolumn{cols}{pos}{text} *\multicolumn* + The |\multicolumn| is used to make an entry that spans several + columns. The first mandatory argument, {cols}, specifies the + number of columns to span. The second mandatory argument, + {pos}, specifies the formatting of the entry: + c - centered + l - flushleft + r - flushright. + The third mandatory argument, {text}, specifies what text is + to make up the entry. + +\vline *\vline* + The |\vline| command will draw a vertical line extending the + full height and depth of its row. An |\hfill| command can be + used to move the line to the edge of the column. It can also + be used in an @-expression. + +============================================================================== +t. thebibliography *\thebibliography* +> + \begin{thebibliography}{widestlabel} + \bibitem[label]{cite_key} + . + . + . + \end{thebibliography} + +The |\thebibliography| environment produces a bibliography or reference list. + +In the |article-class|, this reference list is labelled "References"; in the +|report-class|, it is labelled "Bibliography". + +{widestlabel} Text that, when printed, is approximately as wide as the + widest item label produces by the |\bibitem| commands. + +|\bibitem| Specify a bibliography item. +|\cite| Refer to a bibliography item. +|\nocite| Include an item in the bibliography. +|BibTeX| Automatic generation of bibliographies. + +\bibitem *\bibitem* +\bibitem[label]{citekey} + The |\bibitem| command generates an entry labelled by [label]. + If the [label] argument is missing, a number is generated as + the label, using the |\enumi| counter. The {citekey} is any + sequence of letters, numbers, and punctuation symbols not + containing a comma. This command writes an entry on the `.aux' + file containing {citekey} and the item's label. When this + `.aux' file is read by the \begin{document} command, the + item's label is associated with {citekey}, causing the + reference to {citekey} by a |\cite| command to produce the + associated label. + +\cite *\cite* +\cite[text]{keylist} + The {keylist} argument is a list of citation keys. This + command generates an in-text citation to the references + associated with the keys in {keylist} by entries on the `.aux' + file read by the \begin{document} command. + The optional text argument will appear after the + citation, i.e.: > + \cite[p.2]{knuth} +< might produce `[Knuth, p. 2]'. + +\nocite *\nocite* +\nocite{keylist} + The |\nocite| command produces no text, but writes + {keylist}, which is a list of one or more citation + keys, on the `.aux' file. + +BibTeX *BibTeX* *bibtex* + *\bibliographystyle* +If you use the BibTeX program by Oren Patashnik (highly recommended if you +need a bibliography of more than a couple of titles) to maintain your +bibliography, you don't use the |thebibliography| environment. Instead, you +include the lines: +> + \bibliographystyle{style} + \bibliography{bibfile} + +where {style} refers to a file style.bst, which defines how your citations +will look. The standard styles distributed with BibTeX are: + +{alpha} Sorted alphabetically. Labels are formed from name of author and year + of publication. +{plain} Sorted alphabetically. Labels are numeric. +{unsrt} Like plain, but entries are in order of citation. +{abbrv} Like plain, but more compact labels. + +In addition, numerous other BibTeX style files exist tailored to the demands +of various publications. + + *\bibliography* +The argument to |\bibliography| refers to the file bibfile.bib, which should +contain your database in BibTeX format. Only the entries referred to via +|\cite| and |\nocite| will be listed in the bibliography. + +============================================================================== +u. theorem *theorem* +> + \begin{theorem} + theorem text + \end{theorem} + +The |theorem| environment produces "Theorem x" in boldface followed by your +theorem text. + +============================================================================== +v. titlepage *titlepage* +> + \begin{titlepage} + text + \end{titlepage} + +The |titlepage| environment creates a title page, i.e. a page with no printed +page number or heading. It also causes the following page to be numbered page +one. Formatting the title page is left to you. The |\today| command comes in +handy for title pages. + +Note that you can use the |\maketitle| to produce a standard title page. + +============================================================================== +x. verbatim *verbatim* +> + \begin{verbatim} + text + \end{verbatim} + +The |verbatim| environment is a paragraph-making environment that gets LaTeX +to print exactly what you type in. It turns LaTeX into a typewriter with +carriage returns and blanks having the same effect that they would on a +typewriter. + +\verb *\verb* +\verb char literal_text char +\verb*char literal_text char + Typesets literal_text exactly as typed, including + special characters and spaces, using a typewriter |\tt| + type style. There may be no space between |\verb| or + |\verb|* and char (space is shown here only for + clarity). The *-form differs only in that spaces are + printed as `\verb*| |\'. + +============================================================================== +y. verse *verse* +> + \begin{verse} + text + \end{verse} + +The |verse| environment is designed for poetry, though you may find other uses +for it. + +The margins are indented on the left and the right. Separate the lines of each +stanza with |\\|, and use one or more blank lines to separate the stanzas. + +============================================================================== +8. Footnotes *latex-footnotes* + +Footnotes can be produced in one of two ways. They can be produced with one +command, the |\footnote| command. They can also be produced with two commands, +the |\footnotemark| and the |\footnotetext| commands. See the specific command for +information on why you would use one over the other. + +|\footnote| Insert a footnote +|\footnotemark| Insert footnote mark only +|\footnotetext| Insert footnote text only + +\footnote[number]{text} *\footnote* + Command places the numbered footnote text at the bottom of the + current page. The optional argument, number, is used to change + the default footnote number. This command can only be used in + outer paragraph mode; i.e., you cannot use it in sectioning + commands like |\chapter|, in |\figure|, |\table| or in a + |\tabular| environment. + +\footnotemark *\footnotemark* + Command puts the footnote number in the text. This command can + be used in inner paragraph mode. The text of the footnote is + supplied by the |\footnotetext| command. + This command can be used to produce several consecutive + footnote markers referring to the same footnote by using +> + \footnotemark[\value{footnote}] +< + after the first |\footnote| command. + +\footnotetext[number]{text} *\footnotetext* + Command produces the text to be placed at the bottom of the + page. This command can come anywhere after the |\footnotemark| + command. The |\footnotetext| command must appear in outer + paragraph mode. The optional argument, number, is used to + change the default footnote number. + +============================================================================== +9. Lengths *latex-lengths* + +A length is a measure of distance. Many LaTeX commands take a length as an +argument. + +|\newlength| Define a new length. +|\setlength| Set the value of a length. +|\addtolength| Add a quantity to a length. +|\settodepth| Set a length to the depth of something. +|\settoheight| Set a length to the height of something. +|\settowidth| Set a length to the width of something. +|pre-lengths| Lengths that are, like, predefined. + +\newlength{\gnat} *\newlength* + The |\newlength| command defines the mandatory argument, \gnat, + as a length command with a value of 0in. An error occurs if a + \gnat command already exists. + +\setlength{\gnat}{length} *\setlength* + The |\setlength| command is used to set the value of a \gnat + command. The {length} argument can be expressed in any terms + of length LaTeX understands, i.e., inches (in), millimetres + (mm), points (pt), etc. + +\addtolength{\gnat}{length} *\addtolength* + The |\addtolength| command increments a \gnat by the amount + specified in the {length} argument. It can be a negative + amount. + +\settodepth{\gnat}{text} *\settodepth* + The |\settodepth| command sets the value of a \gnat command + equal to the depth of the {text} argument. + +\settoheight{\gnat}{text} *\settoheight* + The |\settoheight| command sets the value of a \gnat command + equal to the height of the {text} argument. + +\settowidth{\gnat}{text} *\settowidth* + The |\settowidth| command sets the value of a \gnat command + equal to the width of the {text} argument. + +Predefined lengths *pre-lengths* + +\width *\width* +\height *\height* +\depth *\depth* +\totalheight *\totalheight* + These length parameters can be used in the arguments of the + box-making commands See section Spaces & Boxes. They specify + the natural width etc. of the text in the box. + \totalheight equals \height + \depth. + To make a box with the text stretched to double the natural + size, e.g., say: > + \makebox[2\width]{Get a stretcher} + +============================================================================== +10. Letters *latex-letters* + +You can use LaTeX to typeset letters, both personal and business. The letter +document class is designed to make a number of letters at once, although you +can make just one if you so desire. + +Your `.tex' source file has the same minimum commands as the other document +classes, i.e., you must have the following commands as a minimum: > + \documentclass{letter} + \begin{document} + ... + letters + ... + \end{document} + +Each letter is a letter environment, whose argument is the name and address of +the recipient. For example, you might have: > + \begin{letter} + {Mr. Joe Smith\\ + 2345 Princess St. \\ + Edinburgh, EH1 1AA} + ... + \end{letter} + +The letter itself begins with the |\opening| command. The text of the letter +follows. It is typed as ordinary LaTeX input. Commands that make no sense in +a letter, like |\chapter|, do not work. The letter closes with a |\closing| +command. + +After the closing, you can have additional material. The |\cc| command produces +the usual "cc: ...". There's also a similar |\encl| command for a list of +enclosures. With both these commands, use|\\| to separate the items. + +These commands are used with the letter class: +|\address| Your return address. +|\cc| Cc list. closing Saying goodbye. +|\encl| List of enclosed material. +|\location| Your organisation's address. +|\makelabels| Making address labels. +|\name| Your name, for the return address. +|\opening| Saying hello. +|\ps| Adding a postscript. +|\signature| Your signature. +|\startbreaks| Allow page breaks. +|\stopbreaks| Disallow page breaks. +|\telephone| Your phone number. + +\address{Return address} *\address* + The return address, as it should appear on the letter and the + envelope. Separate lines of the address should be separated + by |\\| commands. If you do not make an |\address| declaration, + then the letter will be formatted for copying onto your + organisation's standard letterhead. (See section Overview of + LaTeX and Local Guide, for details on your local + implementation). If you give an |\address| declaration, then + the letter will be formatted as a personal letter. + +\cc{Kate Schechter\\Rob McKenna} *\cc* + Generate a list of other persons the letter was sent to. Each + name is printed on a separate line. + +\closing{text} *\closing* + The letter closes with a |\closing| command, i.e., > + \closing{Best Regards,} \encl{CV\\Certificates} +< Generate a list of enclosed material. + +\location{address} *\location* + This modifies your organisation's standard address. This only + appears if the firstpage pagestyle is selected. + +\makelabels{number} *\makelabels* + If you issue this command in the preamble, LaTeX will create a + sheet of address labels. This sheet will be output before the + letters. + +\name{June Davenport} *\name* + Your name, used for printing on the envelope together with the + return address. + +\opening{text} *\opening* + The letter begins with the |\opening| command. The mandatory + argument, text, is whatever text you wish to start your + letter, i.e., > + \opening{Dear Joe,} + +\ps *\ps* + Use this command before a postscript. + +\signature{Harvey Swick} *\signature* + Your name, as it should appear at the end of the letter + underneath the space for your signature. Items that should go + on separate lines should be separated by |\\| commands. + +\startbreaks *\startbreaks* + Used after a |\stopbreaks| command to allow page breaks again. + +\stopbreaks *\stopbreaks* + Inhibit page breaks until a |\startbreaks| command occurs. + +\telephone{number} *\telephone* + This is your telephone number. This only appears if the + firstpage pagestyle is selected. + +============================================================================== +11. Line & Page Breaking *latex-breaking* + +The first thing LaTeX does when processing ordinary text is to translate your +input file into a string of glyphs and spaces. To produce a printed document, +this string must be broken into lines, and these lines must be broken into +pages. In some environments, you do the line breaking yourself with the |\\| +command, but LaTeX usually does it for you. + +|\\| Start a new line +|hyph-| Insert explicit hyphenation +|\cleardoublepage| Start a new right-hand page +|\clearpage| Start a new page +|\enlargethispage| Enlarge the current page a bit +|\fussy| Be fussy about line breaking +|\hyphenation| Tell LaTeX how to hyphenate a word +|\linebreak| Break the line +|\newline| Break the line prematurely +|\newpage| Start a new page +|\nolinebreak| Don't break the current line +|\nopagebreak| Don't make a page break here +|\pagebreak| Please make a page break here +|\sloppy| Be sloppy about line breaking + +\\[*][extraspace] *\\* *\\\\* + The |\\| command tells LaTeX to start a new line. It has an + optional argument, [extraspace], that specifies how much extra + vertical space is to be inserted before the next line. This + can be a negative amount. + The \\* command is the same as the ordinary |\\| command + except that it tells LaTeX not to start a new page after the + line. + +\- *hyph-* + The \- command tells LaTeX that it may hyphenate the word at + that point. LaTeX is very good at hyphenating, and it will + usually find all correct hyphenation points. The \- command is + used for the exceptional cases. + Note: when you insert \- commands in a word, the word will + only be hyphenated at those points and not at any of the + hyphenation points that LaTeX might otherwise have chosen. + +\cleardoublepage *\cleardoublepage* + The |\cleardoublepage| command ends the current page and causes + all figures and tables that have so far appeared in the input + to be printed. In a two-sided printing style (|twoside|), it + also makes the next page a right-hand (odd-numbered) page, + producing a blank page if necessary. + +\clearpage *\clearpage* + The |\clearpage| command ends the current page and causes all + figures and tables that have so far appeared in the input to + be printed. + +\enlargethispage{size} *\enlargethispage* +\enlargethispage*{size} + Enlarge the textheight for the current page by the + specified amount; e.g.: > + + \enlargethispage{\baselineskip} +< + will allow one additional line. The starred form + tries to squeeze the material together on the page as + much as possible. This is normally used together with + an explicit |\pagebreak|. + +\fussy *\fussy* + This declaration (which is the default) makes TeX more fussy + about line breaking. This can avoids too much space between + words, but may produce overfull boxes. This command cancels + the effect of a previous |\sloppy| command. + +\hyphenation{words} *\hyphenation* + The |\hyphenation| command declares allowed hyphenation points, + where words is a list of words, separated by spaces, in which + each hyphenation point is indicated by a - character. + +\linebreak[number] *\linebreak* + The |\linebreak| command tells LaTeX to break the current line + at the point of the command. With the optional argument, + number, you can convert the |\linebreak| command from a demand + to a request. The [number] must be a number from 0 to 4. The + higher the number, the more insistent the request is. The + |\linebreak| command causes LaTeX to stretch the line so it + extends to the right margin. + +\newline *\newline* + The |\newline| command breaks the line right where it is. It + can only be used in paragraph mode. + +\newpage *\newpage* + The |\newpage| command ends the current page. + +\nolinebreak[number] *\nolinebreak* + The |\nolinebreak| command prevents LaTeX from breaking the + current line at the point of the command. With the optional + argument, [number], you can convert the |\nolinebreak| command + from a demand to a request. The [number] must be a number from 0 + to 4. The higher the number, the more insistent the request + is. + +\nopagebreak[number] *\nopagebreak* + The |\nopagebreak| command prevents LaTeX from breaking the + current page at the point of the command. With the optional + argument, [number], you can convert the |\nopagebreak| command + from a demand to a request. The [number] must be a number from + 0 to 4. The higher the number, the more insistent the request + is. + +\pagebreak[number] *\pagebreak* + The |\pagebreak| command tells LaTeX to break the current page + at the point of the command. With the optional argument, + [number], you can convert the |\pagebreak| command from a + demand to a request. The [number] must be a number from 0 to + 4. The higher the number, the more insistent the request is. + +\sloppy *\sloppy* + This declaration makes TeX less fussy about line breaking. + This can prevent overfull boxes, but may leave too much space + between words. + Lasts until a |\fussy| command is issued. + +============================================================================== +12. Making Paragraphs *latex-paragraphs* + +A paragraph is ended by one or more completely blank lines -- lines not +containing even a |\%|. A blank line should not appear where a new paragraph +cannot be started, such as in math mode or in the argument of a sectioning +command. + +|\indent| Indent this paragraph. +|\noindent| Do not indent this paragraph. +|\par| Another way of writing a blank line. + +\indent *\indent* + This produces a horizontal space whose width equals the width + of the paragraph indentation. It is used to add paragraph + indentation where it would otherwise be suppressed. + +\noindent *\noindent* + When used at the beginning of the paragraph, it suppresses the + paragraph indentation. It has no effect when used in the + middle of a paragraph. + +\par *\par* + Equivalent to a blank line; often used to make command or + environment definitions easier to read. + +============================================================================== +13. Margin Notes *latex-margin-notes* + +\marginpar[left]{right} *\marginpar* + This command creates a note in the margin. The first line will + be at the same height as the line in the text where the + |\marginpar| occurs. + + When you only specify the mandatory argument {right}, the text + will be placed: + * in the right margin for one-sided layout + * in the outside margin for two-sided layout (|twoside|) + * in the nearest margin for two-column layout (|twocolumn|) + +\reversemarginpar *\reversemarginpar* + By issuing the command |\reversemarginpar|, you can force the + marginal notes to go into the opposite (inside) margin. + +When you specify both arguments, left is used for the left margin, and right +is used for the right margin. + +The first word will normally not be hyphenated; you can enable hyphenation by +prefixing the first word with a \hspace{0pt} command (|hspace|). + +============================================================================== +14. Math Formulae *latex-math* + *displaymath* +There are three environments (|latex-environments|) that put LaTeX in math +mode: +|math| For Formulae that appear right in the text. +|displaymath| For Formulae that appear on their own line. +|equation| The same as the displaymath environment except that it adds an + equation number in the right margin. + +The |math| environment can be used in both paragraph and LR mode, but the +|displaymath| and |equation| environments can be used only in paragraph mode. The +|math| and |displaymath| environments are used so often that they have the +following short forms: + \(...\) instead of \begin{math}...\end{math} + \[...\] instead of \begin{displaymath}...\end{displaymath} + +In fact, the math environment is so common that it has an even shorter form: + $ ... $ instead of \(...\) + +|sub-sup| Also known as exponent or index. +|math-symbols| Various mathematical squiggles. +|math-spacing| Thick, medium, thin and negative spaces. +|math-misc| Stuff that doesn't fit anywhere else. + +========== +Subscripts & Superscripts *sub-sup* + *subscripts* *superscripts* + +To get an expression exp to appear as a subscript, you just type _{exp}. To +get exp to appear as a superscript, you type ^{exp}. LaTeX handles +superscripted superscripts and all of that stuff in the natural way. It even +does the right thing when something has both a subscript and a superscript. + +========== +Math Symbols *math-symbols* + +LaTeX provides almost any mathematical symbol you're likely to need. The +commands for generating them can be used only in math mode. For example, if +you include > + $\pi$ +in your source, you will get the symbol in your output. + +========== +Spacing in Math Mode *math-spacing* + +In a math environment, LaTeX ignores the spaces you type and puts in the +spacing that it thinks is best. LaTeX formats mathematics the way it's done in +mathematics texts. If you want different spacing, LaTeX provides the following +four commands for use in math mode: + \; - a thick space *math;* + \: - a medium space *math:* + \, - a thin space *math,* + \! - a negative thin space *matn!* + +========== +Math Miscellany *math-misc* + +\cdots *\cdots* + Produces a horizontal ellipsis where the dots are raised to + the centre of the line. +\ddots *\ddots* + Produces a diagonal ellipsis. +\frac{num}{den} *\frac* + Produces the fraction num divided by den. +\ldots *\ldots* + Produces an ellipsis. This command works in any mode, not just + math mode. +\overbrace{text} *\overbrace* + Generates a brace over text. +\overline{text} *\overline* + Causes the argument text to be overlined. +\sqrt[root]{arg} *\sqrt* + Produces the square root of its argument. The optional + argument, [root], determines what root to produce, i.e., the + cube root of x+y would be typed as: > + $\sqrt[3]{x+y}$. +\underbrace{text} *\underbrace* + Generates text with a brace underneath. +\underline{text} *\underline* + Causes the argument text to be underlined. This command can + also be used in paragraph and LR mode. +\vdots *\vdots* + Produces a vertical ellipsis. + +============================================================================== +15. Modes *latex-modes* + +When LaTeX is processing your input text, it is always in one of three modes: + Paragraph mode *paragraph-mode* + Math mode *math-mode* + Left-to-right mode, called LR mode for short. *lr-mode* + +LaTeX changes mode only when it goes up or down a staircase to a different +level, though not all level changes produce mode changes. Mode changes occur +only when entering or leaving an environment, or when LaTeX is processing the +argument of certain text-producing commands. + +|paragraph-mode| is the most common; it's the one LaTeX is in when processing +ordinary text. In that mode, LaTeX breaks your text into lines and breaks the +lines into pages. LaTeX is in |math-mode| when it's generating a mathematical +formula. In |lr-mode|, as in |paragraph-mode|, LaTeX considers the output that +it produces to be a string of words with spaces between them. However, unlike +|paragraph-mode|, LaTeX keeps going from left to right; it never starts a new +line in |lr-mode|. Even if you put a hundred words into an |\mbox|, LaTeX would +keep typesetting them from left to right inside a single box, and then +complain because the resulting box was too wide to fit on the line. + +LaTeX is in |lr-mode| when it starts making a box with an |\mbox| command. You +can get it to enter a different mode inside the box - for example, you can +make it enter |math-mode| to put a formula in the box. There are also several +text-producing commands and environments for making a box that put LaTeX in +|paragraph-mode|. The box make by one of these commands or environments will be +called a |\parbox|. When LaTeX is in |paragraph-mode| while making a box, it is +said to be in "inner paragraph mode". Its normal |paragraph-mode|, which it +starts out in, is called "outer paragraph mode". + +============================================================================== +16. Page Styles *latex-page-styles* + +The |\documentclass| command determines the size and position of the page's head +and foot. The page style determines what goes in them. + +|\maketitle| Generate a title page. +|\pagenumbering| Set the style used for page numbers. +|\pagestyle| Change the headings/footings style. +|\thispagestyle| Change the headings/footings style for this page. + +\maketitle *\maketitle* + The |\maketitle| command generates a title on a separate title + page - except in the |\article| class, where the title normally + goes at the top of the first page. Information used to + produce the title is obtained from the following declarations: + + |\author| Who wrote this stuff? + |\date| The date the document was created. + |\thanks| A special form of footnote. + |\title| How to set the document title. + + \author{names} *\author* *\and* + The |\author| command declares the author(s), where + names is a list of authors separated by \and commands. + Use |\\| to separate lines within a single author's + entry -- for example, to give the author's institution + or address. + + \date{text} *\date* + The |\date| command declares text to be the document's + date. With no |\date| command, the current date is + used. + + \thanks{text} *\thanks* + The |\thanks| command produces a |\footnote| to the + title. + + \title{text} *\title* + The |\title| command declares text to be the title. Use + |\\| to tell LaTeX where to start a new line in a long + title. + +\pagenumbering{numstyle} *\pagenumbering* + Specifies the style of page numbers. Possible values of + 'numstyle' are: + arabic - Arabic numerals *arabic* + roman - Lowercase Roman numerals *roman* + Roman - Uppercase Roman numerals *Roman* + alph - Lowercase letters *alph* + Alph - Uppercase letters *Alph* + +\pagestyle{option} *\pagestyle* + *plain* *empty* *headings* + The |\pagestyle| command changes the style from the current + page on throughout the remainder of your document. + The valid options are: + plain - Just a plain page number. + empty - Produces empty heads and feet no page numbers. + headings - Puts running headings on each page. The document + style specifies what goes in the headings. + myheadings - You specify what is to go in the heading with the + |\markboth| or the |\markright| commands. + + |\markboth| Set left and right headings. + |\markright| Set right heading only. + + \markboth{left head}{right head} *\markboth* + The |\markboth| command is used in conjunction with the + page style myheadings for setting both the left and + the right heading. + Note that a "left-hand heading" is generated by the + last |\markboth| command before the end of the page, + while a "right-hand heading" is generated by the first + |\markboth| or |\markright| that comes on the page if + there is one, otherwise by the last one before the + page. + + + \markright{right head} *\markright* + The |\markright| command is used in conjunction with + the page style |\myheadings| for setting the right + heading, leaving the left heading unchanged. + Note that a "left-hand heading" is generated by the + last |\markboth| command before the end of the page, + while a "right-hand heading" is generated by the first + |\markboth| or |\markright| that comes on the page if + there is one, otherwise by the last one before the + page. + +\thispagestyle{option} *\thispagestyle* + The |\thispagestyle| command works in the same manner as the + |\pagestyle| command except that it changes the style for the + current page only. + +============================================================================== +17. Sectioning *latex-sectioning* + +Sectioning commands provide the means to structure your text into units. +|\part| +|\chapter| (report and book class only) +|\section| +|\subsection| +|\subsubsection| +|\paragraph| +|\subparagraph| + +All sectioning commands take the same general form, i.e., + + *\part* + *\chapter* (report and book class only) + *\section* *\subsection* *\subsubsection* + *\paragraph* *\subparagraph* +\chapter[optional]{title} + In addition to providing the heading in the text, the + mandatory argument of the sectioning command can appear in two + other places: + 1. The table of contents + 2. The running head at the top of the page. You may not want + the same thing to appear in these other two places as + appears in the text heading. To handle this situation, the + sectioning commands have an optional argument that provides + the text for these other two purposes. + +All sectioning commands have *\-forms that print a title, but do not include a +number and do not make an entry in the table of contents. + +\appendix *\appendix* + The |\appendix| command changes the way sectional units are + numbered. The |\appendix| command generates no text and does + not affect the numbering of parts. The normal use of this + command is something like: > + \chapter{The First Chapter} + ... + \appendix \chapter{The First Appendix} + + +============================================================================== +18. Spaces & Boxes *latex-spaces-boxes* + +All the predefined length parameters See section Predefined lengths can be +used in the arguments of the box-making commands. + + Horizontal space: + +|\dotfill| Stretchable horizontal dots. +|\hfill| Stretchable horizontal space. +|\hrulefill| Stretchable horizontal rule. +|\hspace| Fixed horizontal space. + + Vertical space: + +|\addvspace| Fixed vertical space. +|\bigskip| Fixed vertical space. +|\medskip| Fixed vertical space. +|\smallskip| Fixed vertical space. +|\vfill| Stretchable vertical space. +|\vspace| Fixed vertical space. + + Boxes: + +|\fbox| Framebox. +|\framebox| Framebox, adjustable position. +|\lrbox| An environment like |\sbox|. +|\makebox| Box, adjustable position. +|\mbox| Box. +|\newsavebox| Declare a name for saving a box. +|\parbox| Box with text in paragraph mode. +|\raisebox| Raise or lower text. +|\rule| Lines and squares. +|\savebox| Like |\makebox|, but save the text for later use. +|\sbox| Like |\mbox|, but save the text for later use. +|\usebox| Print saved text. + +Horizontal space: *latex-hor-space* + +LaTeX removes horizontal space that comes at the end of a line. If you don't +want LaTeX to remove this space, include the optional * argument. Then the +space is never removed. + +\dotfill *\dotfill* + The |\dotfill| command produces a "rubber length" that produces + dots instead of just spaces. + +\hfill *\hfill* + The |\hfill| fill command produces a "rubber length" which can + stretch or shrink horizontally. It will be filled with spaces. + +\hrulefill *\hrulefill* + The |\hrulefill| fill command produces a "rubber length" which + can stretch or shrink horizontally. It will be filled with a + horizontal rule. + +\hspace[*]{length} *\hspace* + The |\hspace| command adds horizontal space. The length of the + space can be expressed in any terms that LaTeX understands, + i.e., points, inches, etc. You can add negative as well as + positive space with an |\hspace| command. Adding negative space + is like backspacing. + + +Vertical space: *latex-ver-space* + +LaTeX removes vertical space that comes at the end of a page. If you don't +want LaTeX to remove this space, include the optional * argument. Then the +space is never removed. + +\addvspace{length} *\addvspace* + The |\addvspace| command normally adds a vertical space of + height length. However, if vertical space has already been + added to the same point in the output by a previous + |\addvspace| command, then this command will not add more space + than needed to make the natural length of the total vertical + space equal to length. + +\bigskip *\bigskip* + The |\bigskip| command is equivalent to \vspace{bigskipamount} + where bigskipamount is determined by the document class. + +\medskip *\medskip* + The |\medskip| command is equivalent to \vspace{medskipamount} + where medskipamount is determined by the document class. + +\smallskip *\smallskip* + The |\smallskip| command is equivalent to + \vspace{smallskipamount} where smallskipamount is determined + by the document class. + +\vfill *\vfill* + The |\vfill| fill command produces a rubber length which can + stretch or shrink vertically. + +\vspace[*]{length} *\vspace* + The |\vspace| command adds vertical space. The length of the + space can be expressed in any terms that LaTeX understands, + i.e., points, inches, etc. You can add negative as well as + positive space with an |\vspace| command. + + +Boxes: *latex-boxes* + +\fbox{text} *\fbox* + The |\fbox| command is exactly the same as the |\mbox| command, + except that it puts a frame around the outside of the box that + it creates. + +\framebox[width][position]{text} *\framebox* + The |\framebox| command is exactly the same as the |\makebox| + command, except that it puts a frame around the outside of the + box that it creates. + The |\framebox| command produces a rule of thickness + |\fboxrule|, and leaves a space |\fboxsep| between the rule and + the contents of the box. + +lrbox *\lrbox* +\begin{lrbox}{cmd} text \end{lrbox} + This is the environment form of |\sbox|. + The text inside the environment is saved in the box cmd, which + must have been declared with |\newsavebox|. + +\makebox[width][position]{text} *\makebox* + The |\makebox| command creates a box just wide enough to + contain the text specified. The width of the box is specified + by the optional [width] argument. The position of the text + within the box is determined by the optional [position] + argument. + c -- centred (default) + l -- flushleft + r -- flushright + s -- stretch from left to right margin. The text must + contain stretchable space for this to work. + See section |\picture-makebox|. + +\mbox{text} *\mbox* + The |\mbox| command creates a box just wide enough to hold the + text created by its argument. + Use this command to prevent text from being split across + lines. + +\newsavebox{cmd} *\newsavebox* + Declares {cmd}, which must be a command name that is not + already defined, to be a bin for saving boxes. + + +\parbox[position][height][innerpos]{width}{text} *\parbox* + A parbox is a box whose contents are created in + |\paragraph-mode|. The |\parbox| has two + + Mandatory arguments: +'width' specifies the width of the parbox +'text' the text that goes inside the parbox. + + Optional arguments: +'position' LaTeX will position a parbox so its centre lines up with the + centre of the text line. The optional position argument allows + you to line up either the top or bottom line in the parbox + (default is top). + +'height' If the height argument is not given, the box will have the + natural height of the text. + +'innerpos' The inner-pos argument controls the placement of the text + inside the box. If it is not specified, position is used. + t -- text is placed at the top of the box + c -- text is centred in the box + b -- text is placed at the bottom of the box + s -- stretch vertically. The text must contain + vertically stretchable space for this to work. + + A |\parbox| command is used for a parbox containing a small + piece of text, with nothing fancy inside. In particular, you + shouldn't use any of the paragraph-making environments inside + a |\parbox| argument. For larger pieces of text, including ones + containing a paragraph-making environment, you should use a + |\minipage| environment. + +\raisebox{distance}[extendabove][extendbelow]{text} *\raisebox* + The |\raisebox| command is used to raise or lower text. The + first mandatory argument specifies how high the text is to be + raised (or lowered if it is a negative amount). The text + itself is processed in LR mode. + Sometimes it's useful to make LaTeX think something has a + different size than it really does - or a different size than + LaTeX would normally think it has. The |\raisebox| command + lets you tell LaTeX how tall it is. + The first optional argument, extend-above, makes LaTeX think + that the text extends above the line by the amount specified. + The second optional argument, extend-below, makes LaTeX think + that the text extends below the line by the amount specified. + +\rule[raiseheight]{width}{thickness} *\rule* + The |\rule| command is used to produce horizontal lines. The + arguments are defined as follows: +'raiseheight' specifies how high to raise the rule (optional) +'width' specifies the length of the rule (mandatory) +'thickness' specifies the thickness of the rule (mandatory) + +\savebox{cmd}[width][pos]{text} *\savebox* + This command typeset text in a box just as for |\makebox|. + However, instead of printing the resulting box, it saves it in + bin cmd, which must have been declared with |\newsavebox|. + +\sbox{text} *\sbox* + This commands typeset text in a box just as for |\mbox|. + However, instead of printing the resulting box, it saves it in + bin cmd, which must have been declared with |\newsavebox|. + +\usebox{cmd} *\usebox* + Prints the box most recently saved in bin cmd by a |\savebox| + command. + +============================================================================== +19. Special Characters *latex-special* + +The following characters play a special role in LaTeX and are called "special +printing characters", or simply "special characters". > + # $ % & ~ _ ^ \ { } +Whenever you put one of these special characters into your file, you are doing +something special. If you simply want the character to be printed just as any +other letter, include a \ in front of the character. For example, \$ will +produce $ in your output. + +One exception to this rule is the \ itself because |\\| has its own special +meaning. A \ is produced by typing $\backslash$ in your file. + +Also, \~ means `place a tilde accent over the following letter', so you will +probably want to use |\verb| instead. + *\symbol* +In addition, you can access any character of a font once you know its number +by using the |\symbol| command. For example, the character used for displaying +spaces in the |\verb|* command has the code decimal 32, so it can be typed as +\symbol{32}. + +You can also specify octal numbers with ' or hexadecimal numbers with ", so +the previous example could also be written as \symbol{'40} or \symbol{"20}. + +============================================================================== +20. Splitting the Input *latex-inputting* + +A large document requires a lot of input. Rather than putting the whole input +in a single large file, it's more efficient to split it into several smaller +ones. Regardless of how many separate files you use, there is one that is the +root file; it is the one whose name you type when you run LaTeX. + +|\include| Conditionally include a file +|\includeonly| Determine which files are included +|\input| Unconditionally include a file + +\include{file} *\include* + The \include command is used in conjunction with the + |\includeonly| command for selective inclusion of + files. The file argument is the first name of a file, + denoting `file.tex' . If file is one the file names in + the file list of the |\includeonly| command or if there + is no |\includeonly| command, the \include command is + equivalent to: > + \clearpage \input{file} \clearpage +< + except that if the file `file.tex' does not exist, + then a warning message rather than an error is + produced. If the file is not in the file list, the + \include command is equivalent to |\clearpage|. + + The |\include| command may not appear in the preamble or in a + file read by another |\include| command. + +\includeonly{filelist} *\includeonly* + The |\includeonly| command controls which files will be read in + by an |\include| command. {filelist} should be a + comma-separated list of filenames. Each filename must match + exactly a filename specified in a |\include| command. This + command can only appear in the preamble. + +\input{file} *\input* + The |\input| command causes the indicated file to be read and + processed, exactly as if its contents had been inserted in the + current file at that point. The file name may be a complete + file name with extension or just a first name, in which case + the file `file.tex' is used. +============================================================================== +21. Starting & Ending *latex-start-end* + +Your input file must contain the following commands as a minimum: +\documentclass{class} |\documentclass| +\begin{document} |\begin| +... your text goes here ... +\end{document} |\end| + +where the class selected is one of the valid classes for LaTeX. +See |\classes|for details of the various document classes. + +You may include other LaTeX commands between the |\documentclass| and the +\begin{document} commands (i.e., in the `preamble'). +============================================================================== +22. Table of Contents *latex-toc* + + *\tableofcontents* +A table of contents is produced with the |\tableofcontents| command. You put +the command right where you want the table of contents to go; LaTeX does the +rest for you. It produces a heading, but it does not automatically start a new +page. If you want a new page after the table of contents, include a |\newpage| +command after the |\tableofcontents| command. + + *\listoffigures* *\listoftables* +There are similar commands |\listoffigures| and |\listoftables| for producing a +list of figures and a list of tables, respectively. Everything works exactly +the same as for the table of contents. + + *\nofiles* +NOTE: If you want any of these items to be generated, you cannot have the +\nofiles command in your document. + +|\addcontentsline| Add an entry to table of contents etc. +|\addtocontents| Add text directly to table of contents file etc. + +\addcontentsline{file}{secunit}{entry} *\addcontentsline* + The |\addcontentsline| command adds an entry to the specified + list or table where: +{file} is the extension of the file on which information is to be + written: + toc (table of contents), + lof (list of figures), + lot (list of tables). +{secunit} controls the formatting of the entry. It should be one of the + following, depending upon the value of the file argument: + toc -- the name of the sectional unit, such as part or + subsection. + lof -- figure + lot -- table +{entry} is the text of the entry. + +\addtocontents{file}{text} *\addtocontents* + The |\addtocontents| command adds text (or formatting commands) + directly to the file that generates the table of contents or + list of figures or tables. +{file} is the extension of the file on which information is to be written: + toc (table of contents), + lof (list of figures), + lot (list of tables). +{text} is the information to be written. + +============================================================================== +23. Terminal Input/Output *latex-terminal* + +|\typein| Read text from the terminal. +|\typeout| Write text to the terminal. + +\typein[cmd]{msg} *\typein* + Prints {msg} on the terminal and causes LaTeX to stop and wait + for you to type a line of input, ending with return. If the + [cmd] argument is missing, the typed input is processed as if + it had been included in the input file in place of the + |\typein| command. If the [cmd] argument is present, it must be + a command name. This command name is then defined or redefined + to be the typed input. + +\typeout{msg} *\typeout* + Prints {msg} on the terminal and in the `.log' file. Commands + in {msg} that are defined with |\newcommand| or |\renewcommand| + are replaced by their definitions before being printed. + + *\space* +LaTeX's usual rules for treating multiple spaces as a single space and +ignoring spaces after a command name apply to {msg}. A |\space| command in {msg} +causes a single space to be printed. A ^^J in {msg} prints a newline. + +============================================================================== +24. Typefaces *latex-typefaces* + +The typeface is specified by giving the "size" and "style". A typeface is also +called a "font". +|font-styles| Select roman, italics etc. +|font-size| Select point size. +|font-lowlevelcommands| Commands for wizards. + +Styles *font-styles* + +The following type style commands are supported by LaTeX. + +These commands are used like: > + \textit{italics text}. +The corresponding command in parenthesis is the "declaration form", which +takes no arguments. The scope of the declaration form lasts until the next +type style command or the end of the current group. + +The declaration forms are cumulative; i.e., you can say: > + \sffamily\bfseries +to get sans serif boldface. + +You can also use the environment form of the declaration forms; e.g.: > + \begin{ttfamily}...\end{ttfamily}. +< +\textrm (\rmfamily) *\textrm* *\rmfamily* + Roman + +\textit (\itshape) *\textit* *\itshape* *\emph* + Emphasis (toggles between |\textit| and |\textrm|). + +\textmd (\mdseries) *\textmd* *\mdseries* + Medium weight (default). The opposite of boldface. + +\textbf (\bfseries) *\textbf* *\bfseries* + Boldface. + +\textup (\upshape) *\textup* *\upshape* + Upright (default). The opposite of slanted. + +\textsl (\slshape) *\textsl* *\slshape* + Slanted. + +\textsf (\sffamily) *\textsf* *\sffamily* + Sans serif. + +\textsc (\scshape) *\textsc* *\scshape* + Small caps. + +\texttt (\ttfamily) *\texttt* *\ttfamily* + Typewriter. + +\textnormal (\normalfont) *\textnormal* *\normalfont* + Main document font. + +\mathrm *\mathrm* + Roman, for use in math mode. + +\mathbf *\mathbf* + Boldface, for use in math mode. + +\mathsf *\mathsf* + Sans serif, for use in math mode. + +\mathtt *\mathtt* + Typewriter, for use in math mode. + +\mathit *\mathit* + Italics, for use in math mode, e.g. variable names with + several letters. + +\mathnormal *\mathnormal* + For use in math mode, e.g. inside another type style + declaration. + +\mathcal *\mathcal* + `Calligraphic' letters, for use in math mode. + + *\mathversion* +In addition, the command \mathversion{bold} can be used for switching to bold +letters and symbols in formulas. \mathversion{normal} restores the default. + +========== +Sizes *font-size* + +The following standard type size commands are supported by LaTeX. + +The commands as listed here are "declaration forms". The scope of the +declaration form lasts until the next type style command or the end of the +current group. + +You can also use the environment form of these commands; e.g. > + \begin{tiny}...\end{tiny} + +\tiny *\tiny* +\scriptsize *\scriptsize* +\footnotesize *\footnotesize* +\small *\small* +\normalsize(default) *\normalsize* +\large *\large* +\Large *\Large* +\LARGE *\LARGE* +\huge *\huge* +\Huge *\Huge* + +========== +Low-level font commands *font-lowlevelcommands* + +These commands are primarily intended for writers of macros and packages. The +commands listed here are only a subset of the available ones. For full +details, you should consult Chapter 7 of The LaTeX Companion. + +\fontencoding{enc} *\fontencoding* + Select font encoding. Valid encodings include OT1 and T1. + +\fontfamily{family} *\fontfamily* + Select font family. Valid families include: + cmr for Computer Modern Roman + cmss for Computer Modern Sans Serif + cmtt for Computer Modern Typewriter + and numerous others. + +\fontseries{series} *\fontseries* + Select font series. Valid series include: + m Medium (normal) + b Bold + c Condensed + bc Bold condensed + bx Bold extended + and various other combinations. + +\fontshape{shape} *\fontshape* + Select font shape. Valid shapes are: + n Upright (normal) + it Italic + sl Slanted (oblique) + sc Small caps + ui Upright italics + ol Outline + The two last shapes are not available for most font families. + +\fontsize{size}{skip} *\fontsize* + Set font size. The first parameter is the font size to switch + to; the second is the \baselineskip to use. The unit of both + parameters defaults to pt. A rule of thumb is that the + baselineskip should be 1.2 times the font size. + +\selectfont *\selectfont* + The changes made by calling the four font commands described + above do not come into effect until |\selectfont| is called. + +\usefont{enc}{family}{series}{shape} *\usefont* + Equivalent to calling |\fontencoding|, |\fontfamily|, + |\fontseries| and |\fontshape| with the given parameters, + followed by |\selectfont|. + +============================================================================== +25. Parameters *latex-parameters* + +The input file specification indicates the file to be formatted; TeX uses +`.tex' as a default file extension. If you omit the input file entirely, TeX +accepts input from the terminal. You specify command options by supplying a +string as a parameter to the command; e.g. > + + latex "\scrollmode\input foo.tex" + +will process `foo.tex' without pausing after every error. + +Output files are always created in the current directory. When you fail to +specify an input file name, TeX bases the output names on the file +specification associated with the logical name TEX_OUTPUT, typically +texput.log. + + vim:tw=78:ts=8:ft=help:norl: diff --git a/.vim/doc/matlab.txt b/.vim/doc/matlab.txt @@ -0,0 +1,111 @@ +MatlabEditionFiles *matlab* *MatlabEditionFiles* +A set of files useful to edit Matlab files. + +Included is : +1. Syntax highlighting |matlab-syntax| +2. Using the matchit.vim script |matlab-matchit| +3. Correct indentation |matlab-indent| +4. Integration of the mlint Matlab code checker |matlab-compiler| +5. Tag support |matlab-tags| +6. Installation details |matlab-instal| + +================================================================================ +1. Syntax highlighting *matlab-syntax* + +syntax/matlab.vim : Updates the matlab.vim syntax file provided in the vim +distribution : +- highlights keywords dealing with exceptions : try / catch / rethrow +- highlights keywords dealing with class definitions : classdef / properties / + methods / events + +================================================================================ +2. Correct settings in order to use the matchit.vim script *matlab-matchit* + +The matchit.vim extends the % matching and enables to jump through matching +groups such as "if/end" or "switch/end" blocks (see :help matchit in vim) + +ftplugin/matlab.m provides the suitable definition for b:match_words in order +to jump between if/end, classdef/end, methods/end, events/end, properties/end, +while/end, for/end, switch/end, try/end, function/end blocks + +================================================================================ +3. Correct indentation *matlab-indent* + + indent/matlab.vim : Updates the matlab.vim indention file +provided in the vim distribution. This script provides a correct indentation +for : +- switch / end, try / catch blocks +- classdef / methods / properties / events +- mutli-line (lines with line continuation operator (...)) + +This script has been tested with the Matlab R2008a release on many files and +the result of indentation compared to the one provided by the Matlab Editor +(using the 'indent all functions' option). + +NOTE : to work correctly, this script need the matchit.vim (vimscript#39) to +be installed. (see also |matchit|) + +================================================================================ +4. Integration of the mlint Matlab code checker *matlab-compiler* + +compiler/mlint.m provides the settings to use mlint (Matlab code ckecker) and +puts the messages reported in the quickfix buffer. + +Whenever you want to check your code, just type :make and then :copen and vim +opens a quickfix buffer which enables to jump to errors (using :cn, :cp or +Enter to jump to the error under the cursor : see |quickfix| in vim) + +================================================================================ +5. Tag support *matlab-tags* +The .ctags file (in the matlab.zip) defines the Matlab language so that the +exuberant ctags (http://ctags.sourceforge.net ) can construct the tag file : +you can now jump to tags (using CTRL-] (or CTRL-$ if using Windows) and go +back again (CTRL-T) See |tags| in vim. + +These scripts have been tested using gvim 7.2 and Matlab R2008a on Windows. + +================================================================================ +6. Installation details *matlab-instal* + +The package is matlab.zip : just unzip it to extract the files. + +- help file + + Copy doc/matlab.txt to your $HOME/vimfiles/doc directory. + And then run the command to create help for matlab : > + :helptags $HOME/vimfiles/doc +< Then the command > + :help matlab +< is available + +- Syntax highlighting + Copy syntax/matlab.vim to your $HOME/vimfiles/syntax + directory + +- Correct settings in order to use the matchit.vim script + In your vimrc file, add the following line : > + source $VIMRUNTIME/macros/matchit.vim +< + And copy ftplugin/matlab.vim to your $HOME/vimfiles/ftplugin directory + +- Correct indentation + In your vimrc file, add the following lines : > + source $VIMRUNTIME/macros/matchit.vim + filetype indent on +< + And copy indent/matlab.vim to your $HOME/vimfiles/indent directory + +- Integration of the mlint Matlab code checker with the :make command + + Add the following line to your vimrc file : > + autocmd BufEnter *.m compiler mlint +< + And copy compiler/mlint.vim to your $HOME/vimfiles/compiler directory + +- Tag support + + Copy the .ctags to your $HOME directory. And then run the + command to create your tags file : for example : > + ctags -R * + + diff --git a/.vim/doc/tags b/.vim/doc/tags @@ -0,0 +1,1001 @@ +:CVSEdit vcscommand.txt /*:CVSEdit* +:CVSEditors vcscommand.txt /*:CVSEditors* +:CVSUnedit vcscommand.txt /*:CVSUnedit* +:CVSWatch vcscommand.txt /*:CVSWatch* +:CVSWatchAdd vcscommand.txt /*:CVSWatchAdd* +:CVSWatchOff vcscommand.txt /*:CVSWatchOff* +:CVSWatchOn vcscommand.txt /*:CVSWatchOn* +:CVSWatchRemove vcscommand.txt /*:CVSWatchRemove* +:CVSWatchers vcscommand.txt /*:CVSWatchers* +:VCSAdd vcscommand.txt /*:VCSAdd* +:VCSAnnotate vcscommand.txt /*:VCSAnnotate* +:VCSBlame vcscommand.txt /*:VCSBlame* +:VCSCommit vcscommand.txt /*:VCSCommit* +:VCSDelete vcscommand.txt /*:VCSDelete* +:VCSDiff vcscommand.txt /*:VCSDiff* +:VCSGotoOriginal vcscommand.txt /*:VCSGotoOriginal* +:VCSInfo vcscommand.txt /*:VCSInfo* +:VCSLock vcscommand.txt /*:VCSLock* +:VCSLog vcscommand.txt /*:VCSLog* +:VCSRemove vcscommand.txt /*:VCSRemove* +:VCSRevert vcscommand.txt /*:VCSRevert* +:VCSReview vcscommand.txt /*:VCSReview* +:VCSStatus vcscommand.txt /*:VCSStatus* +:VCSUnlock vcscommand.txt /*:VCSUnlock* +:VCSUpdate vcscommand.txt /*:VCSUpdate* +:VCSVimDiff vcscommand.txt /*:VCSVimDiff* +Alph latexhelp.txt /*Alph* +Alt-B latex-suite.txt /*Alt-B* +Alt-C latex-suite.txt /*Alt-C* +Alt-I latex-suite.txt /*Alt-I* +Alt-L latex-suite.txt /*Alt-L* +BibTeX latexhelp.txt /*BibTeX* +IMAP_PutTextWithMovement latex-suite.txt /*IMAP_PutTextWithMovement* +Imap_DeleteEmptyPlaceHolders latex-suite.txt /*Imap_DeleteEmptyPlaceHolders* +Imap_FreezeImap latex-suite.txt /*Imap_FreezeImap* +Imap_PlaceHolderEnd latex-suite.txt /*Imap_PlaceHolderEnd* +Imap_PlaceHolderStart latex-suite.txt /*Imap_PlaceHolderStart* +Imap_StickyPlaceHolders latex-suite.txt /*Imap_StickyPlaceHolders* +Imap_UsePlaceHolders latex-suite.txt /*Imap_UsePlaceHolders* +LaTeX latexhelp.txt /*LaTeX* +MatlabEditionFiles matlab.txt /*MatlabEditionFiles* +Plug_IMAP_DeleteAndJumBack latex-suite.txt /*Plug_IMAP_DeleteAndJumBack* +Plug_IMAP_DeleteAndJumpForward latex-suite.txt /*Plug_IMAP_DeleteAndJumpForward* +Plug_IMAP_JumpBack latex-suite.txt /*Plug_IMAP_JumpBack* +Plug_IMAP_JumpForward latex-suite.txt /*Plug_IMAP_JumpForward* +Plug_Tex_InsertItemOnThisLine latex-suite.txt /*Plug_Tex_InsertItemOnThisLine* +Plug_Tex_LeftRight latex-suite.txt /*Plug_Tex_LeftRight* +Plug_Tex_MathBF latex-suite.txt /*Plug_Tex_MathBF* +Plug_Tex_MathCal latex-suite.txt /*Plug_Tex_MathCal* +Roman latexhelp.txt /*Roman* +TClearCiteHist latex-suite.txt /*TClearCiteHist* +TLook latex-suite.txt /*TLook* +TLookAll latex-suite.txt /*TLookAll* +TLookBib latex-suite.txt /*TLookBib* +TMacro latex-suite.txt /*TMacro* +TMacroDelete latex-suite.txt /*TMacroDelete* +TMacroEdit latex-suite.txt /*TMacroEdit* +TMacroNew latex-suite.txt /*TMacroNew* +TPackage latex-suite.txt /*TPackage* +TPackageUpdate latex-suite.txt /*TPackageUpdate* +TPackageUpdateAll latex-suite.txt /*TPackageUpdateAll* +TPartComp latex-suite.txt /*TPartComp* +TPartView latex-suite.txt /*TPartView* +TSection latex-suite.txt /*TSection* +TSectionAdvanced latex-suite.txt /*TSectionAdvanced* +TTemplate latex-suite.txt /*TTemplate* +Tex_AutoFolding latex-suite.txt /*Tex_AutoFolding* +Tex_BIBINPUTS latex-suite.txt /*Tex_BIBINPUTS* +Tex_CatchVisMapErrors latex-suite.txt /*Tex_CatchVisMapErrors* +Tex_Com_name latex-suite.txt /*Tex_Com_name* +Tex_CompileRule_format latex-suite.txt /*Tex_CompileRule_format* +Tex_Debug latex-suite.txt /*Tex_Debug* +Tex_DefaultTargetFormat latex-suite.txt /*Tex_DefaultTargetFormat* +Tex_Diacritics latex-suite.txt /*Tex_Diacritics* +Tex_Env_name latex-suite.txt /*Tex_Env_name* +Tex_EnvironmentMaps latex-suite.txt /*Tex_EnvironmentMaps* +Tex_EnvironmentMenus latex-suite.txt /*Tex_EnvironmentMenus* +Tex_ExplorerHeight latex-suite.txt /*Tex_ExplorerHeight* +Tex_FoldedCommands latex-suite.txt /*Tex_FoldedCommands* +Tex_FoldedEnvironments latex-suite.txt /*Tex_FoldedEnvironments* +Tex_FoldedMisc latex-suite.txt /*Tex_FoldedMisc* +Tex_FoldedSections latex-suite.txt /*Tex_FoldedSections* +Tex_Folding latex-suite.txt /*Tex_Folding* +Tex_FontMaps latex-suite.txt /*Tex_FontMaps* +Tex_FontMenus latex-suite.txt /*Tex_FontMenus* +Tex_GotoError latex-suite.txt /*Tex_GotoError* +Tex_HotKeyMappings latex-suite.txt /*Tex_HotKeyMappings* +Tex_IgnoreLevel latex-suite.txt /*Tex_IgnoreLevel* +Tex_IgnoredWarnings latex-suite.txt /*Tex_IgnoredWarnings* +Tex_ImageDir latex-suite.txt /*Tex_ImageDir* +Tex_ItemStyle_environment latex-suite.txt /*Tex_ItemStyle_environment* +Tex_Leader latex-suite.txt /*Tex_Leader* +Tex_Leader2 latex-suite.txt /*Tex_Leader2* +Tex_MainFileExpression latex-suite.txt /*Tex_MainFileExpression* +Tex_MainMenuLocation latex-suite.txt /*Tex_MainMenuLocation* +Tex_MathMenus latex-suite.txt /*Tex_MathMenus* +Tex_Menus latex-suite.txt /*Tex_Menus* +Tex_MultipleCompileFormats latex-suite.txt /*Tex_MultipleCompileFormats* +Tex_NestElementMenus latex-suite.txt /*Tex_NestElementMenus* +Tex_NestPackagesMenu latex-suite.txt /*Tex_NestPackagesMenu* +Tex_PackagesMenu latex-suite.txt /*Tex_PackagesMenu* +Tex_ProjectSourceFiles latex-suite.txt /*Tex_ProjectSourceFiles* +Tex_PromptedCommands latex-suite.txt /*Tex_PromptedCommands* +Tex_PromptedEnvironments latex-suite.txt /*Tex_PromptedEnvironments* +Tex_RememberCiteSearch latex-suite.txt /*Tex_RememberCiteSearch* +Tex_SectionMaps latex-suite.txt /*Tex_SectionMaps* +Tex_SectionMenus latex-suite.txt /*Tex_SectionMenus* +Tex_SmartKeyBS latex-suite.txt /*Tex_SmartKeyBS* +Tex_SmartKeyQuote latex-suite.txt /*Tex_SmartKeyQuote* +Tex_TEXINPUTS latex-suite.txt /*Tex_TEXINPUTS* +Tex_UseMakefile latex-suite.txt /*Tex_UseMakefile* +Tex_UseMenuWizard latex-suite.txt /*Tex_UseMenuWizard* +Tex_UsePython latex-suite.txt /*Tex_UsePython* +Tex_UseSimpleLabelSearch latex-suite.txt /*Tex_UseSimpleLabelSearch* +Tex_UseUtfMenus latex-suite.txt /*Tex_UseUtfMenus* +Tex_ViewRuleComplete_format latex-suite.txt /*Tex_ViewRuleComplete_format* +Tex_ViewRule_format latex-suite.txt /*Tex_ViewRule_format* +Tex_ViewerCwindowHeight latex-suite.txt /*Tex_ViewerCwindowHeight* +Tex_ViewerPreviewHeight latex-suite.txt /*Tex_ViewerPreviewHeight* +Tshortcuts latex-suite.txt /*Tshortcuts* +VCSCommandCVSDiffOpt vcscommand.txt /*VCSCommandCVSDiffOpt* +VCSCommandCVSExec vcscommand.txt /*VCSCommandCVSExec* +VCSCommandCommitOnWrite vcscommand.txt /*VCSCommandCommitOnWrite* +VCSCommandDeleteOnHide vcscommand.txt /*VCSCommandDeleteOnHide* +VCSCommandDiffSplit vcscommand.txt /*VCSCommandDiffSplit* +VCSCommandDisableAll vcscommand.txt /*VCSCommandDisableAll* +VCSCommandDisableExtensionMappings vcscommand.txt /*VCSCommandDisableExtensionMappings* +VCSCommandDisableMappings vcscommand.txt /*VCSCommandDisableMappings* +VCSCommandDisableMenu vcscommand.txt /*VCSCommandDisableMenu* +VCSCommandEdit vcscommand.txt /*VCSCommandEdit* +VCSCommandEnableBufferSetup vcscommand.txt /*VCSCommandEnableBufferSetup* +VCSCommandMapPrefix vcscommand.txt /*VCSCommandMapPrefix* +VCSCommandMappings vcscommand.txt /*VCSCommandMappings* +VCSCommandMenuPriority vcscommand.txt /*VCSCommandMenuPriority* +VCSCommandMenuRoot vcscommand.txt /*VCSCommandMenuRoot* +VCSCommandResultBufferNameExtension vcscommand.txt /*VCSCommandResultBufferNameExtension* +VCSCommandResultBufferNameFunction vcscommand.txt /*VCSCommandResultBufferNameFunction* +VCSCommandSVKExec vcscommand.txt /*VCSCommandSVKExec* +VCSCommandSVNDiffExt vcscommand.txt /*VCSCommandSVNDiffExt* +VCSCommandSVNDiffOpt vcscommand.txt /*VCSCommandSVNDiffOpt* +VCSCommandSVNExec vcscommand.txt /*VCSCommandSVNExec* +VCSCommandSplit vcscommand.txt /*VCSCommandSplit* +VCSCommandVCSTypeOverride vcscommand.txt /*VCSCommandVCSTypeOverride* +VCSCommandVCSTypePreference vcscommand.txt /*VCSCommandVCSTypePreference* +\Alph latexhelp.txt /*\\Alph* +\Huge latexhelp.txt /*\\Huge* +\LARGE latexhelp.txt /*\\LARGE* +\Large latexhelp.txt /*\\Large* +\Roman latexhelp.txt /*\\Roman* +\\ latexhelp.txt /*\\\\* +\\\\ latexhelp.txt /*\\\\\\\\* +\addcontentsline latexhelp.txt /*\\addcontentsline* +\address latexhelp.txt /*\\address* +\addtocontents latexhelp.txt /*\\addtocontents* +\addtocounter latexhelp.txt /*\\addtocounter* +\addtolength latexhelp.txt /*\\addtolength* +\addvspace latexhelp.txt /*\\addvspace* +\alph latexhelp.txt /*\\alph* +\and latexhelp.txt /*\\and* +\appendix latexhelp.txt /*\\appendix* +\arabic latexhelp.txt /*\\arabic* +\author latexhelp.txt /*\\author* +\begin latexhelp.txt /*\\begin* +\bfseries latexhelp.txt /*\\bfseries* +\bibitem latexhelp.txt /*\\bibitem* +\bibliography latexhelp.txt /*\\bibliography* +\bibliographystyle latexhelp.txt /*\\bibliographystyle* +\bigskip latexhelp.txt /*\\bigskip* +\cc latexhelp.txt /*\\cc* +\cdots latexhelp.txt /*\\cdots* +\centering latexhelp.txt /*\\centering* +\chapter latexhelp.txt /*\\chapter* +\circle latexhelp.txt /*\\circle* +\cite latexhelp.txt /*\\cite* +\cleardoublepage latexhelp.txt /*\\cleardoublepage* +\clearpage latexhelp.txt /*\\clearpage* +\cline latexhelp.txt /*\\cline* +\closing latexhelp.txt /*\\closing* +\dashbox latexhelp.txt /*\\dashbox* +\date latexhelp.txt /*\\date* +\ddots latexhelp.txt /*\\ddots* +\depth latexhelp.txt /*\\depth* +\documentclass latexhelp.txt /*\\documentclass* +\dotfill latexhelp.txt /*\\dotfill* +\emph latexhelp.txt /*\\emph* +\end latexhelp.txt /*\\end* +\enlargethispage latexhelp.txt /*\\enlargethispage* +\fbox latexhelp.txt /*\\fbox* +\flushbottom latexhelp.txt /*\\flushbottom* +\fnsymbol latexhelp.txt /*\\fnsymbol* +\fontencoding latexhelp.txt /*\\fontencoding* +\fontfamily latexhelp.txt /*\\fontfamily* +\fontseries latexhelp.txt /*\\fontseries* +\fontshape latexhelp.txt /*\\fontshape* +\fontsize latexhelp.txt /*\\fontsize* +\footnote latexhelp.txt /*\\footnote* +\footnotemark latexhelp.txt /*\\footnotemark* +\footnotesize latexhelp.txt /*\\footnotesize* +\footnotetext latexhelp.txt /*\\footnotetext* +\frac latexhelp.txt /*\\frac* +\frame latexhelp.txt /*\\frame* +\framebox latexhelp.txt /*\\framebox* +\fussy latexhelp.txt /*\\fussy* +\height latexhelp.txt /*\\height* +\hfill latexhelp.txt /*\\hfill* +\hline latexhelp.txt /*\\hline* +\hrulefill latexhelp.txt /*\\hrulefill* +\hspace latexhelp.txt /*\\hspace* +\huge latexhelp.txt /*\\huge* +\hyphenation latexhelp.txt /*\\hyphenation* +\include latexhelp.txt /*\\include* +\includeonly latexhelp.txt /*\\includeonly* +\indent latexhelp.txt /*\\indent* +\input latexhelp.txt /*\\input* +\item latexhelp.txt /*\\item* +\itshape latexhelp.txt /*\\itshape* +\kill latexhelp.txt /*\\kill* +\label latexhelp.txt /*\\label* +\large latexhelp.txt /*\\large* +\ldots latexhelp.txt /*\\ldots* +\lefteqn latexhelp.txt /*\\lefteqn* +\letter latexhelp.txt /*\\letter* +\line latexhelp.txt /*\\line* +\linebreak latexhelp.txt /*\\linebreak* +\linethickness latexhelp.txt /*\\linethickness* +\listoffigures latexhelp.txt /*\\listoffigures* +\listoftables latexhelp.txt /*\\listoftables* +\location latexhelp.txt /*\\location* +\lrbox latexhelp.txt /*\\lrbox* +\makebox latexhelp.txt /*\\makebox* +\makelabels latexhelp.txt /*\\makelabels* +\maketitle latexhelp.txt /*\\maketitle* +\marginpar latexhelp.txt /*\\marginpar* +\markboth latexhelp.txt /*\\markboth* +\markright latexhelp.txt /*\\markright* +\mathbf latexhelp.txt /*\\mathbf* +\mathcal latexhelp.txt /*\\mathcal* +\mathit latexhelp.txt /*\\mathit* +\mathnormal latexhelp.txt /*\\mathnormal* +\mathrm latexhelp.txt /*\\mathrm* +\mathsf latexhelp.txt /*\\mathsf* +\mathtt latexhelp.txt /*\\mathtt* +\mathversion latexhelp.txt /*\\mathversion* +\mbox latexhelp.txt /*\\mbox* +\mdseries latexhelp.txt /*\\mdseries* +\medskip latexhelp.txt /*\\medskip* +\multicolumn latexhelp.txt /*\\multicolumn* +\multiput latexhelp.txt /*\\multiput* +\name latexhelp.txt /*\\name* +\newcommand latexhelp.txt /*\\newcommand* +\newcounter latexhelp.txt /*\\newcounter* +\newenvironment latexhelp.txt /*\\newenvironment* +\newfont latexhelp.txt /*\\newfont* +\newlength latexhelp.txt /*\\newlength* +\newline latexhelp.txt /*\\newline* +\newpage latexhelp.txt /*\\newpage* +\newsavebox latexhelp.txt /*\\newsavebox* +\newtheorem latexhelp.txt /*\\newtheorem* +\nocite latexhelp.txt /*\\nocite* +\nofiles latexhelp.txt /*\\nofiles* +\noindent latexhelp.txt /*\\noindent* +\nolinebreak latexhelp.txt /*\\nolinebreak* +\nonumber latexhelp.txt /*\\nonumber* +\nopagebreak latexhelp.txt /*\\nopagebreak* +\normalfont latexhelp.txt /*\\normalfont* +\normalsize latexhelp.txt /*\\normalsize* +\onecolumn latexhelp.txt /*\\onecolumn* +\opening latexhelp.txt /*\\opening* +\oval latexhelp.txt /*\\oval* +\overbrace latexhelp.txt /*\\overbrace* +\overline latexhelp.txt /*\\overline* +\pagebreak latexhelp.txt /*\\pagebreak* +\pagenumbering latexhelp.txt /*\\pagenumbering* +\pageref latexhelp.txt /*\\pageref* +\pagestyle latexhelp.txt /*\\pagestyle* +\par latexhelp.txt /*\\par* +\paragraph latexhelp.txt /*\\paragraph* +\parbox latexhelp.txt /*\\parbox* +\part latexhelp.txt /*\\part* +\picture-framebox latexhelp.txt /*\\picture-framebox* +\ps latexhelp.txt /*\\ps* +\pushtabs latexhelp.txt /*\\pushtabs* +\put latexhelp.txt /*\\put* +\raggedbottom latexhelp.txt /*\\raggedbottom* +\raggedleft latexhelp.txt /*\\raggedleft* +\raggedright latexhelp.txt /*\\raggedright* +\raisebox latexhelp.txt /*\\raisebox* +\ref latexhelp.txt /*\\ref* +\refstepcounter latexhelp.txt /*\\refstepcounter* +\renewcommand latexhelp.txt /*\\renewcommand* +\renewenvironment latexhelp.txt /*\\renewenvironment* +\reversemarginpar latexhelp.txt /*\\reversemarginpar* +\rmfamily latexhelp.txt /*\\rmfamily* +\roman latexhelp.txt /*\\roman* +\rule latexhelp.txt /*\\rule* +\savebox latexhelp.txt /*\\savebox* +\sbox latexhelp.txt /*\\sbox* +\scriptsize latexhelp.txt /*\\scriptsize* +\scshape latexhelp.txt /*\\scshape* +\section latexhelp.txt /*\\section* +\selectfont latexhelp.txt /*\\selectfont* +\setcounter latexhelp.txt /*\\setcounter* +\setlength latexhelp.txt /*\\setlength* +\settodepth latexhelp.txt /*\\settodepth* +\settoheight latexhelp.txt /*\\settoheight* +\settowidth latexhelp.txt /*\\settowidth* +\sffamily latexhelp.txt /*\\sffamily* +\shortstack latexhelp.txt /*\\shortstack* +\signature latexhelp.txt /*\\signature* +\sloppy latexhelp.txt /*\\sloppy* +\slshape latexhelp.txt /*\\slshape* +\small latexhelp.txt /*\\small* +\smallskip latexhelp.txt /*\\smallskip* +\space latexhelp.txt /*\\space* +\sqrt latexhelp.txt /*\\sqrt* +\startbreaks latexhelp.txt /*\\startbreaks* +\stepcounter latexhelp.txt /*\\stepcounter* +\stopbreaks latexhelp.txt /*\\stopbreaks* +\subparagraph latexhelp.txt /*\\subparagraph* +\subsection latexhelp.txt /*\\subsection* +\subsubsection latexhelp.txt /*\\subsubsection* +\symbol latexhelp.txt /*\\symbol* +\table latexhelp.txt /*\\table* +\tableofcontents latexhelp.txt /*\\tableofcontents* +\telephone latexhelp.txt /*\\telephone* +\textbf latexhelp.txt /*\\textbf* +\textit latexhelp.txt /*\\textit* +\textmd latexhelp.txt /*\\textmd* +\textnormal latexhelp.txt /*\\textnormal* +\textrm latexhelp.txt /*\\textrm* +\textsc latexhelp.txt /*\\textsc* +\textsf latexhelp.txt /*\\textsf* +\textsl latexhelp.txt /*\\textsl* +\texttt latexhelp.txt /*\\texttt* +\textup latexhelp.txt /*\\textup* +\thanks latexhelp.txt /*\\thanks* +\thebibliography latexhelp.txt /*\\thebibliography* +\thispagestyle latexhelp.txt /*\\thispagestyle* +\tiny latexhelp.txt /*\\tiny* +\title latexhelp.txt /*\\title* +\totalheight latexhelp.txt /*\\totalheight* +\ttfamily latexhelp.txt /*\\ttfamily* +\twocolumn latexhelp.txt /*\\twocolumn* +\typein latexhelp.txt /*\\typein* +\typeout latexhelp.txt /*\\typeout* +\underbrace latexhelp.txt /*\\underbrace* +\underline latexhelp.txt /*\\underline* +\upshape latexhelp.txt /*\\upshape* +\usebox latexhelp.txt /*\\usebox* +\usecounter latexhelp.txt /*\\usecounter* +\usefont latexhelp.txt /*\\usefont* +\usepackage latexhelp.txt /*\\usepackage* +\value latexhelp.txt /*\\value* +\vdots latexhelp.txt /*\\vdots* +\vector latexhelp.txt /*\\vector* +\verb latexhelp.txt /*\\verb* +\vfill latexhelp.txt /*\\vfill* +\vline latexhelp.txt /*\\vline* +\vspace latexhelp.txt /*\\vspace* +\width latexhelp.txt /*\\width* +adding-bib-options latex-suite.txt /*adding-bib-options* +alph latexhelp.txt /*alph* +altkey-mappings latex-suite.txt /*altkey-mappings* +arabic latexhelp.txt /*arabic* +array latexhelp.txt /*array* +article-class latexhelp.txt /*article-class* +auc-tex-mappings latex-suite.txt /*auc-tex-mappings* +automatic-package-detection latex-suite.txt /*automatic-package-detection* +b:VCSCommandCommand vcscommand.txt /*b:VCSCommandCommand* +b:VCSCommandOriginalBuffer vcscommand.txt /*b:VCSCommandOriginalBuffer* +b:VCSCommandSourceFile vcscommand.txt /*b:VCSCommandSourceFile* +b:VCSCommandVCSType vcscommand.txt /*b:VCSCommandVCSType* +bibtex latexhelp.txt /*bibtex* +bibtex-bindings latex-suite.txt /*bibtex-bindings* +book-class latexhelp.txt /*book-class* +center latexhelp.txt /*center* +changing-commands latex-suite.txt /*changing-commands* +changing-environments latex-suite.txt /*changing-environments* +cite-search-caching latex-suite.txt /*cite-search-caching* +compiler-dependency latex-suite.txt /*compiler-dependency* +compiler-output-customization latex-suite.txt /*compiler-output-customization* +compiler-rules latex-suite.txt /*compiler-rules* +compiling-multiple latex-suite.txt /*compiling-multiple* +completion-window-preferences latex-suite.txt /*completion-window-preferences* +custom-macros-menu latex-suite.txt /*custom-macros-menu* +custom-packages latex-suite.txt /*custom-packages* +customize-alt-key-maps latex-suite.txt /*customize-alt-key-maps* +customize-imap-maps latex-suite.txt /*customize-imap-maps* +customizing-compiling latex-suite.txt /*customizing-compiling* +customizing-folding latex-suite.txt /*customizing-folding* +customizing-latex-completion latex-suite.txt /*customizing-latex-completion* +customizing-latex-suite latex-suite.txt /*customizing-latex-suite* +customizing-macros latex-suite.txt /*customizing-macros* +customizing-menus latex-suite.txt /*customizing-menus* +customizing-packages latex-suite.txt /*customizing-packages* +customizing-place-holders latex-suite.txt /*customizing-place-holders* +customizing-smart-keys latex-suite.txt /*customizing-smart-keys* +customizing-viewing latex-suite.txt /*customizing-viewing* +customizing-what-to-fold latex-suite.txt /*customizing-what-to-fold* +cvscommand-changes vcscommand.txt /*cvscommand-changes* +default-folding latex-suite.txt /*default-folding* +description latexhelp.txt /*description* +diacritic-mappings latex-suite.txt /*diacritic-mappings* +displaymath latexhelp.txt /*displaymath* +draft latexhelp.txt /*draft* +editing-folding latex-suite.txt /*editing-folding* +empty latexhelp.txt /*empty* +enabling-searching latex-suite.txt /*enabling-searching* +enclosing-commands latex-suite.txt /*enclosing-commands* +enclosing-env-f5 latex-suite.txt /*enclosing-env-f5* +enclosing-env-threeletter latex-suite.txt /*enclosing-env-threeletter* +enclosing-environments latex-suite.txt /*enclosing-environments* +enumerate latexhelp.txt /*enumerate* +environment-mappings latex-suite.txt /*environment-mappings* +eqnarray latexhelp.txt /*eqnarray* +equation latexhelp.txt /*equation* +figure latexhelp.txt /*figure* +final latexhelp.txt /*final* +fleqn latexhelp.txt /*fleqn* +flushleft latexhelp.txt /*flushleft* +flushright latexhelp.txt /*flushright* +fold-setting-adding latex-suite.txt /*fold-setting-adding* +fold-setting-advanced latex-suite.txt /*fold-setting-advanced* +font-lowlevelcommands latexhelp.txt /*font-lowlevelcommands* +font-maps latex-suite.txt /*font-maps* +font-size latexhelp.txt /*font-size* +font-styles latexhelp.txt /*font-styles* +forward-searching latex-suite.txt /*forward-searching* +greek-letter-mappings latex-suite.txt /*greek-letter-mappings* +headings latexhelp.txt /*headings* +hyph- latexhelp.txt /*hyph-* +im_1 imaps.txt /*im_1* +imaps-usage imaps.txt /*imaps-usage* +imaps.txt imaps.txt /*imaps.txt* +imaps.txt-toc imaps.txt /*imaps.txt-toc* +inserting-commands latex-suite.txt /*inserting-commands* +inserting-env-f5 latex-suite.txt /*inserting-env-f5* +inserting-env-shift-f1 latex-suite.txt /*inserting-env-shift-f1* +inserting-env-threeletter latex-suite.txt /*inserting-env-threeletter* +inserting-environments latex-suite.txt /*inserting-environments* +inserting-packages latex-suite.txt /*inserting-packages* +inverse-searching latex-suite.txt /*inverse-searching* +itemize latexhelp.txt /*itemize* +landscape latexhelp.txt /*landscape* +latex latexhelp.txt /*latex* +latex-boxes latexhelp.txt /*latex-boxes* +latex-breaking latexhelp.txt /*latex-breaking* +latex-classes latexhelp.txt /*latex-classes* +latex-command-maps latex-suite.txt /*latex-command-maps* +latex-commands latexhelp.txt /*latex-commands* +latex-compiling latex-suite.txt /*latex-compiling* +latex-completion latex-suite.txt /*latex-completion* +latex-completion-cite latex-suite.txt /*latex-completion-cite* +latex-counters latexhelp.txt /*latex-counters* +latex-definitions latexhelp.txt /*latex-definitions* +latex-environments latexhelp.txt /*latex-environments* +latex-folding latex-suite.txt /*latex-folding* +latex-footnotes latexhelp.txt /*latex-footnotes* +latex-hor-space latexhelp.txt /*latex-hor-space* +latex-inputting latexhelp.txt /*latex-inputting* +latex-layout latexhelp.txt /*latex-layout* +latex-lengths latexhelp.txt /*latex-lengths* +latex-letters latexhelp.txt /*latex-letters* +latex-macros latex-suite.txt /*latex-macros* +latex-margin-notes latexhelp.txt /*latex-margin-notes* +latex-master-file latex-suite.txt /*latex-master-file* +latex-master-file-specification latex-suite.txt /*latex-master-file-specification* +latex-math latexhelp.txt /*latex-math* +latex-modes latexhelp.txt /*latex-modes* +latex-package-scanning latex-suite.txt /*latex-package-scanning* +latex-packages latex-suite.txt /*latex-packages* +latex-page-styles latexhelp.txt /*latex-page-styles* +latex-paragraphs latexhelp.txt /*latex-paragraphs* +latex-parameters latexhelp.txt /*latex-parameters* +latex-project latex-suite.txt /*latex-project* +latex-project-example latex-suite.txt /*latex-project-example* +latex-project-settings latex-suite.txt /*latex-project-settings* +latex-references latexhelp.txt /*latex-references* +latex-sectioning latexhelp.txt /*latex-sectioning* +latex-spaces-boxes latexhelp.txt /*latex-spaces-boxes* +latex-special latexhelp.txt /*latex-special* +latex-start-end latexhelp.txt /*latex-start-end* +latex-suite-commands latex-suite.txt /*latex-suite-commands* +latex-suite-commands-maps latex-suite.txt /*latex-suite-commands-maps* +latex-suite-credits latex-suite.txt /*latex-suite-credits* +latex-suite-maintainer latex-suite.txt /*latex-suite-maintainer* +latex-suite-maps latex-suite.txt /*latex-suite-maps* +latex-suite-quickstart.txt latex-suite-quickstart.txt /*latex-suite-quickstart.txt* +latex-suite-quickstart.txt-toc latex-suite-quickstart.txt /*latex-suite-quickstart.txt-toc* +latex-suite-templates latex-suite.txt /*latex-suite-templates* +latex-suite.txt latex-suite.txt /*latex-suite.txt* +latex-suite.txt-toc latex-suite.txt /*latex-suite.txt-toc* +latex-terminal latexhelp.txt /*latex-terminal* +latex-toc latexhelp.txt /*latex-toc* +latex-typefaces latexhelp.txt /*latex-typefaces* +latex-ver-space latexhelp.txt /*latex-ver-space* +latex-viewing latex-suite.txt /*latex-viewing* +latex-viewing-rules latex-suite.txt /*latex-viewing-rules* +latexhelp.txt latexhelp.txt /*latexhelp.txt* +leqno latexhelp.txt /*leqno* +letter-class latexhelp.txt /*letter-class* +list latexhelp.txt /*list* +lq_1 latex-suite-quickstart.txt /*lq_1* +lq_10 latex-suite-quickstart.txt /*lq_10* +lq_2 latex-suite-quickstart.txt /*lq_2* +lq_3 latex-suite-quickstart.txt /*lq_3* +lq_4 latex-suite-quickstart.txt /*lq_4* +lq_5 latex-suite-quickstart.txt /*lq_5* +lq_6 latex-suite-quickstart.txt /*lq_6* +lq_7 latex-suite-quickstart.txt /*lq_7* +lq_8 latex-suite-quickstart.txt /*lq_8* +lq_8_1 latex-suite-quickstart.txt /*lq_8_1* +lq_9 latex-suite-quickstart.txt /*lq_9* +lq_9_1 latex-suite-quickstart.txt /*lq_9_1* +lq_9_2 latex-suite-quickstart.txt /*lq_9_2* +lq_a_bc latex-suite-quickstart.txt /*lq_a_bc* +lq_a_bd latex-suite-quickstart.txt /*lq_a_bd* +lq_a_be latex-suite-quickstart.txt /*lq_a_be* +lq_a_bf latex-suite-quickstart.txt /*lq_a_bf* +lq_a_bg latex-suite-quickstart.txt /*lq_a_bg* +lq_a_bh latex-suite-quickstart.txt /*lq_a_bh* +lq_a_bi latex-suite-quickstart.txt /*lq_a_bi* +lq_a_bj latex-suite-quickstart.txt /*lq_a_bj* +lq_a_bk latex-suite-quickstart.txt /*lq_a_bk* +lq_a_bl latex-suite-quickstart.txt /*lq_a_bl* +lq_a_bm latex-suite-quickstart.txt /*lq_a_bm* +lq_a_bn latex-suite-quickstart.txt /*lq_a_bn* +lq_a_bo latex-suite-quickstart.txt /*lq_a_bo* +lq_u_1 latex-suite-quickstart.txt /*lq_u_1* +lq_u_2 latex-suite-quickstart.txt /*lq_u_2* +lq_u_3 latex-suite-quickstart.txt /*lq_u_3* +lq_u_4 latex-suite-quickstart.txt /*lq_u_4* +lq_u_5 latex-suite-quickstart.txt /*lq_u_5* +lq_u_6 latex-suite-quickstart.txt /*lq_u_6* +lq_u_7 latex-suite-quickstart.txt /*lq_u_7* +lq_u_8 latex-suite-quickstart.txt /*lq_u_8* +lq_u_9 latex-suite-quickstart.txt /*lq_u_9* +lr-mode latexhelp.txt /*lr-mode* +ls-completion-custom latex-suite.txt /*ls-completion-custom* +ls-completion-ref latex-suite.txt /*ls-completion-ref* +ls-completion-usage latex-suite.txt /*ls-completion-usage* +ls-filename-completion latex-suite.txt /*ls-filename-completion* +ls-general-purpose-settings latex-suite.txt /*ls-general-purpose-settings* +ls-imap-f7 latex-suite.txt /*ls-imap-f7* +ls-imap-s-f7 latex-suite.txt /*ls-imap-s-f7* +ls-imaps-syntax latex-suite.txt /*ls-imaps-syntax* +ls-new-macros latex-suite.txt /*ls-new-macros* +ls-set-grepprg latex-suite.txt /*ls-set-grepprg* +ls-vmap-f7 latex-suite.txt /*ls-vmap-f7* +ls_1 latex-suite.txt /*ls_1* +ls_10 latex-suite.txt /*ls_10* +ls_10_1 latex-suite.txt /*ls_10_1* +ls_10_1_1 latex-suite.txt /*ls_10_1_1* +ls_10_1_2 latex-suite.txt /*ls_10_1_2* +ls_10_2 latex-suite.txt /*ls_10_2* +ls_10_2_1 latex-suite.txt /*ls_10_2_1* +ls_10_2_10 latex-suite.txt /*ls_10_2_10* +ls_10_2_11 latex-suite.txt /*ls_10_2_11* +ls_10_2_12 latex-suite.txt /*ls_10_2_12* +ls_10_2_13 latex-suite.txt /*ls_10_2_13* +ls_10_2_14 latex-suite.txt /*ls_10_2_14* +ls_10_2_15 latex-suite.txt /*ls_10_2_15* +ls_10_2_16 latex-suite.txt /*ls_10_2_16* +ls_10_2_2 latex-suite.txt /*ls_10_2_2* +ls_10_2_3 latex-suite.txt /*ls_10_2_3* +ls_10_2_4 latex-suite.txt /*ls_10_2_4* +ls_10_2_5 latex-suite.txt /*ls_10_2_5* +ls_10_2_6 latex-suite.txt /*ls_10_2_6* +ls_10_2_7 latex-suite.txt /*ls_10_2_7* +ls_10_2_8 latex-suite.txt /*ls_10_2_8* +ls_10_2_9 latex-suite.txt /*ls_10_2_9* +ls_11 latex-suite.txt /*ls_11* +ls_11_1 latex-suite.txt /*ls_11_1* +ls_11_10 latex-suite.txt /*ls_11_10* +ls_11_10_1 latex-suite.txt /*ls_11_10_1* +ls_11_1_1 latex-suite.txt /*ls_11_1_1* +ls_11_1_2 latex-suite.txt /*ls_11_1_2* +ls_11_2 latex-suite.txt /*ls_11_2* +ls_11_2_1 latex-suite.txt /*ls_11_2_1* +ls_11_2_2 latex-suite.txt /*ls_11_2_2* +ls_11_2_3 latex-suite.txt /*ls_11_2_3* +ls_11_2_4 latex-suite.txt /*ls_11_2_4* +ls_11_3 latex-suite.txt /*ls_11_3* +ls_11_3_1 latex-suite.txt /*ls_11_3_1* +ls_11_3_10 latex-suite.txt /*ls_11_3_10* +ls_11_3_11 latex-suite.txt /*ls_11_3_11* +ls_11_3_12 latex-suite.txt /*ls_11_3_12* +ls_11_3_13 latex-suite.txt /*ls_11_3_13* +ls_11_3_2 latex-suite.txt /*ls_11_3_2* +ls_11_3_3 latex-suite.txt /*ls_11_3_3* +ls_11_3_4 latex-suite.txt /*ls_11_3_4* +ls_11_3_5 latex-suite.txt /*ls_11_3_5* +ls_11_3_6 latex-suite.txt /*ls_11_3_6* +ls_11_3_7 latex-suite.txt /*ls_11_3_7* +ls_11_3_8 latex-suite.txt /*ls_11_3_8* +ls_11_3_9 latex-suite.txt /*ls_11_3_9* +ls_11_4 latex-suite.txt /*ls_11_4* +ls_11_4_1 latex-suite.txt /*ls_11_4_1* +ls_11_4_2 latex-suite.txt /*ls_11_4_2* +ls_11_5 latex-suite.txt /*ls_11_5* +ls_11_5_1 latex-suite.txt /*ls_11_5_1* +ls_11_5_2 latex-suite.txt /*ls_11_5_2* +ls_11_5_3 latex-suite.txt /*ls_11_5_3* +ls_11_5_4 latex-suite.txt /*ls_11_5_4* +ls_11_5_5 latex-suite.txt /*ls_11_5_5* +ls_11_6 latex-suite.txt /*ls_11_6* +ls_11_6_1 latex-suite.txt /*ls_11_6_1* +ls_11_6_2 latex-suite.txt /*ls_11_6_2* +ls_11_6_3 latex-suite.txt /*ls_11_6_3* +ls_11_6_4 latex-suite.txt /*ls_11_6_4* +ls_11_6_5 latex-suite.txt /*ls_11_6_5* +ls_11_6_6 latex-suite.txt /*ls_11_6_6* +ls_11_6_7 latex-suite.txt /*ls_11_6_7* +ls_11_6_8 latex-suite.txt /*ls_11_6_8* +ls_11_7 latex-suite.txt /*ls_11_7* +ls_11_7_1 latex-suite.txt /*ls_11_7_1* +ls_11_7_2 latex-suite.txt /*ls_11_7_2* +ls_11_8 latex-suite.txt /*ls_11_8* +ls_11_8_1 latex-suite.txt /*ls_11_8_1* +ls_11_8_2 latex-suite.txt /*ls_11_8_2* +ls_11_8_3 latex-suite.txt /*ls_11_8_3* +ls_11_8_4 latex-suite.txt /*ls_11_8_4* +ls_11_8_5 latex-suite.txt /*ls_11_8_5* +ls_11_8_6 latex-suite.txt /*ls_11_8_6* +ls_11_8_7 latex-suite.txt /*ls_11_8_7* +ls_11_9 latex-suite.txt /*ls_11_9* +ls_11_9_1 latex-suite.txt /*ls_11_9_1* +ls_11_9_2 latex-suite.txt /*ls_11_9_2* +ls_12 latex-suite.txt /*ls_12* +ls_2 latex-suite.txt /*ls_2* +ls_3 latex-suite.txt /*ls_3* +ls_3_1 latex-suite.txt /*ls_3_1* +ls_3_10 latex-suite.txt /*ls_3_10* +ls_3_10_1 latex-suite.txt /*ls_3_10_1* +ls_3_10_2 latex-suite.txt /*ls_3_10_2* +ls_3_10_3 latex-suite.txt /*ls_3_10_3* +ls_3_10_4 latex-suite.txt /*ls_3_10_4* +ls_3_11 latex-suite.txt /*ls_3_11* +ls_3_12 latex-suite.txt /*ls_3_12* +ls_3_12_1 latex-suite.txt /*ls_3_12_1* +ls_3_12_2 latex-suite.txt /*ls_3_12_2* +ls_3_1_1 latex-suite.txt /*ls_3_1_1* +ls_3_1_1_1 latex-suite.txt /*ls_3_1_1_1* +ls_3_1_1_2 latex-suite.txt /*ls_3_1_1_2* +ls_3_1_1_3 latex-suite.txt /*ls_3_1_1_3* +ls_3_1_2 latex-suite.txt /*ls_3_1_2* +ls_3_1_2_1 latex-suite.txt /*ls_3_1_2_1* +ls_3_1_2_2 latex-suite.txt /*ls_3_1_2_2* +ls_3_1_3 latex-suite.txt /*ls_3_1_3* +ls_3_2 latex-suite.txt /*ls_3_2* +ls_3_2_1 latex-suite.txt /*ls_3_2_1* +ls_3_2_2 latex-suite.txt /*ls_3_2_2* +ls_3_2_3 latex-suite.txt /*ls_3_2_3* +ls_3_3 latex-suite.txt /*ls_3_3* +ls_3_4 latex-suite.txt /*ls_3_4* +ls_3_5 latex-suite.txt /*ls_3_5* +ls_3_6 latex-suite.txt /*ls_3_6* +ls_3_7 latex-suite.txt /*ls_3_7* +ls_3_8 latex-suite.txt /*ls_3_8* +ls_3_8_1 latex-suite.txt /*ls_3_8_1* +ls_3_9 latex-suite.txt /*ls_3_9* +ls_4 latex-suite.txt /*ls_4* +ls_4_1 latex-suite.txt /*ls_4_1* +ls_4_2 latex-suite.txt /*ls_4_2* +ls_4_3 latex-suite.txt /*ls_4_3* +ls_4_3_1 latex-suite.txt /*ls_4_3_1* +ls_4_4 latex-suite.txt /*ls_4_4* +ls_4_4_1 latex-suite.txt /*ls_4_4_1* +ls_4_4_2 latex-suite.txt /*ls_4_4_2* +ls_5 latex-suite.txt /*ls_5* +ls_5_1 latex-suite.txt /*ls_5_1* +ls_5_2 latex-suite.txt /*ls_5_2* +ls_5_3 latex-suite.txt /*ls_5_3* +ls_5_3_1 latex-suite.txt /*ls_5_3_1* +ls_5_4 latex-suite.txt /*ls_5_4* +ls_5_5 latex-suite.txt /*ls_5_5* +ls_6 latex-suite.txt /*ls_6* +ls_6_1 latex-suite.txt /*ls_6_1* +ls_6_2 latex-suite.txt /*ls_6_2* +ls_6_3 latex-suite.txt /*ls_6_3* +ls_6_4 latex-suite.txt /*ls_6_4* +ls_6_5 latex-suite.txt /*ls_6_5* +ls_7 latex-suite.txt /*ls_7* +ls_7_1 latex-suite.txt /*ls_7_1* +ls_7_2 latex-suite.txt /*ls_7_2* +ls_7_3 latex-suite.txt /*ls_7_3* +ls_8 latex-suite.txt /*ls_8* +ls_8_1 latex-suite.txt /*ls_8_1* +ls_8_2 latex-suite.txt /*ls_8_2* +ls_8_2_1 latex-suite.txt /*ls_8_2_1* +ls_8_2_2 latex-suite.txt /*ls_8_2_2* +ls_8_2_3 latex-suite.txt /*ls_8_2_3* +ls_8_2_4 latex-suite.txt /*ls_8_2_4* +ls_8_2_5 latex-suite.txt /*ls_8_2_5* +ls_8_3 latex-suite.txt /*ls_8_3* +ls_9 latex-suite.txt /*ls_9* +ls_9_1 latex-suite.txt /*ls_9_1* +ls_9_2 latex-suite.txt /*ls_9_2* +ls_a_bA latex-suite.txt /*ls_a_bA* +ls_a_bB latex-suite.txt /*ls_a_bB* +ls_a_bC latex-suite.txt /*ls_a_bC* +ls_a_bD latex-suite.txt /*ls_a_bD* +ls_a_bE latex-suite.txt /*ls_a_bE* +ls_a_bF latex-suite.txt /*ls_a_bF* +ls_a_bG latex-suite.txt /*ls_a_bG* +ls_a_bH latex-suite.txt /*ls_a_bH* +ls_a_bI latex-suite.txt /*ls_a_bI* +ls_a_bJ latex-suite.txt /*ls_a_bJ* +ls_a_bK latex-suite.txt /*ls_a_bK* +ls_a_bL latex-suite.txt /*ls_a_bL* +ls_a_bM latex-suite.txt /*ls_a_bM* +ls_a_bN latex-suite.txt /*ls_a_bN* +ls_a_bO latex-suite.txt /*ls_a_bO* +ls_a_bP latex-suite.txt /*ls_a_bP* +ls_a_bQ latex-suite.txt /*ls_a_bQ* +ls_a_bR latex-suite.txt /*ls_a_bR* +ls_a_bS latex-suite.txt /*ls_a_bS* +ls_a_bT latex-suite.txt /*ls_a_bT* +ls_a_bU latex-suite.txt /*ls_a_bU* +ls_a_bV latex-suite.txt /*ls_a_bV* +ls_a_bW latex-suite.txt /*ls_a_bW* +ls_a_bX latex-suite.txt /*ls_a_bX* +ls_a_bY latex-suite.txt /*ls_a_bY* +ls_a_bZ latex-suite.txt /*ls_a_bZ* +ls_a_bc latex-suite.txt /*ls_a_bc* +ls_a_bd latex-suite.txt /*ls_a_bd* +ls_a_be latex-suite.txt /*ls_a_be* +ls_a_bf latex-suite.txt /*ls_a_bf* +ls_a_bg latex-suite.txt /*ls_a_bg* +ls_a_bh latex-suite.txt /*ls_a_bh* +ls_a_bi latex-suite.txt /*ls_a_bi* +ls_a_bj latex-suite.txt /*ls_a_bj* +ls_a_bk latex-suite.txt /*ls_a_bk* +ls_a_bl latex-suite.txt /*ls_a_bl* +ls_a_bm latex-suite.txt /*ls_a_bm* +ls_a_bn latex-suite.txt /*ls_a_bn* +ls_a_bo latex-suite.txt /*ls_a_bo* +ls_a_bp latex-suite.txt /*ls_a_bp* +ls_a_bq latex-suite.txt /*ls_a_bq* +ls_a_br latex-suite.txt /*ls_a_br* +ls_a_bs latex-suite.txt /*ls_a_bs* +ls_a_bt latex-suite.txt /*ls_a_bt* +ls_a_bu latex-suite.txt /*ls_a_bu* +ls_a_bv latex-suite.txt /*ls_a_bv* +ls_a_bw latex-suite.txt /*ls_a_bw* +ls_a_bx latex-suite.txt /*ls_a_bx* +ls_a_by latex-suite.txt /*ls_a_by* +ls_a_bz latex-suite.txt /*ls_a_bz* +ls_a_cA latex-suite.txt /*ls_a_cA* +ls_a_cB latex-suite.txt /*ls_a_cB* +ls_a_cC latex-suite.txt /*ls_a_cC* +ls_a_cD latex-suite.txt /*ls_a_cD* +ls_a_cE latex-suite.txt /*ls_a_cE* +ls_a_cF latex-suite.txt /*ls_a_cF* +ls_a_cG latex-suite.txt /*ls_a_cG* +ls_a_cH latex-suite.txt /*ls_a_cH* +ls_a_cI latex-suite.txt /*ls_a_cI* +ls_a_cJ latex-suite.txt /*ls_a_cJ* +ls_a_cK latex-suite.txt /*ls_a_cK* +ls_a_cL latex-suite.txt /*ls_a_cL* +ls_a_cM latex-suite.txt /*ls_a_cM* +ls_a_cN latex-suite.txt /*ls_a_cN* +ls_a_cO latex-suite.txt /*ls_a_cO* +ls_a_cP latex-suite.txt /*ls_a_cP* +ls_a_cQ latex-suite.txt /*ls_a_cQ* +ls_a_cR latex-suite.txt /*ls_a_cR* +ls_a_cS latex-suite.txt /*ls_a_cS* +ls_a_cT latex-suite.txt /*ls_a_cT* +ls_a_cU latex-suite.txt /*ls_a_cU* +ls_a_cV latex-suite.txt /*ls_a_cV* +ls_a_cW latex-suite.txt /*ls_a_cW* +ls_a_cX latex-suite.txt /*ls_a_cX* +ls_a_cY latex-suite.txt /*ls_a_cY* +ls_a_cZ latex-suite.txt /*ls_a_cZ* +ls_a_ca latex-suite.txt /*ls_a_ca* +ls_a_cb latex-suite.txt /*ls_a_cb* +ls_a_cc latex-suite.txt /*ls_a_cc* +ls_a_cd latex-suite.txt /*ls_a_cd* +ls_a_ce latex-suite.txt /*ls_a_ce* +ls_a_cf latex-suite.txt /*ls_a_cf* +ls_a_cg latex-suite.txt /*ls_a_cg* +ls_a_ch latex-suite.txt /*ls_a_ch* +ls_a_ci latex-suite.txt /*ls_a_ci* +ls_a_cj latex-suite.txt /*ls_a_cj* +ls_a_ck latex-suite.txt /*ls_a_ck* +ls_a_cl latex-suite.txt /*ls_a_cl* +ls_a_cm latex-suite.txt /*ls_a_cm* +ls_a_cn latex-suite.txt /*ls_a_cn* +ls_a_co latex-suite.txt /*ls_a_co* +ls_a_cp latex-suite.txt /*ls_a_cp* +ls_a_cq latex-suite.txt /*ls_a_cq* +ls_a_cr latex-suite.txt /*ls_a_cr* +ls_a_cs latex-suite.txt /*ls_a_cs* +ls_a_ct latex-suite.txt /*ls_a_ct* +ls_a_cu latex-suite.txt /*ls_a_cu* +ls_a_cv latex-suite.txt /*ls_a_cv* +ls_a_cw latex-suite.txt /*ls_a_cw* +ls_a_cx latex-suite.txt /*ls_a_cx* +ls_a_cy latex-suite.txt /*ls_a_cy* +ls_a_cz latex-suite.txt /*ls_a_cz* +ls_a_dA latex-suite.txt /*ls_a_dA* +ls_a_dB latex-suite.txt /*ls_a_dB* +ls_a_dC latex-suite.txt /*ls_a_dC* +ls_a_dD latex-suite.txt /*ls_a_dD* +ls_a_dE latex-suite.txt /*ls_a_dE* +ls_a_dF latex-suite.txt /*ls_a_dF* +ls_a_dG latex-suite.txt /*ls_a_dG* +ls_a_dH latex-suite.txt /*ls_a_dH* +ls_a_dI latex-suite.txt /*ls_a_dI* +ls_a_dJ latex-suite.txt /*ls_a_dJ* +ls_a_dK latex-suite.txt /*ls_a_dK* +ls_a_dL latex-suite.txt /*ls_a_dL* +ls_a_dM latex-suite.txt /*ls_a_dM* +ls_a_dN latex-suite.txt /*ls_a_dN* +ls_a_dO latex-suite.txt /*ls_a_dO* +ls_a_dP latex-suite.txt /*ls_a_dP* +ls_a_dQ latex-suite.txt /*ls_a_dQ* +ls_a_dR latex-suite.txt /*ls_a_dR* +ls_a_dS latex-suite.txt /*ls_a_dS* +ls_a_dT latex-suite.txt /*ls_a_dT* +ls_a_dU latex-suite.txt /*ls_a_dU* +ls_a_dV latex-suite.txt /*ls_a_dV* +ls_a_dW latex-suite.txt /*ls_a_dW* +ls_a_dX latex-suite.txt /*ls_a_dX* +ls_a_dY latex-suite.txt /*ls_a_dY* +ls_a_dZ latex-suite.txt /*ls_a_dZ* +ls_a_da latex-suite.txt /*ls_a_da* +ls_a_db latex-suite.txt /*ls_a_db* +ls_a_dc latex-suite.txt /*ls_a_dc* +ls_a_dd latex-suite.txt /*ls_a_dd* +ls_a_de latex-suite.txt /*ls_a_de* +ls_a_df latex-suite.txt /*ls_a_df* +ls_a_dg latex-suite.txt /*ls_a_dg* +ls_a_dh latex-suite.txt /*ls_a_dh* +ls_a_di latex-suite.txt /*ls_a_di* +ls_a_dj latex-suite.txt /*ls_a_dj* +ls_a_dk latex-suite.txt /*ls_a_dk* +ls_a_dl latex-suite.txt /*ls_a_dl* +ls_a_dm latex-suite.txt /*ls_a_dm* +ls_a_dn latex-suite.txt /*ls_a_dn* +ls_a_do latex-suite.txt /*ls_a_do* +ls_a_dp latex-suite.txt /*ls_a_dp* +ls_a_dq latex-suite.txt /*ls_a_dq* +ls_a_dr latex-suite.txt /*ls_a_dr* +ls_a_ds latex-suite.txt /*ls_a_ds* +ls_a_dt latex-suite.txt /*ls_a_dt* +ls_a_du latex-suite.txt /*ls_a_du* +ls_a_dv latex-suite.txt /*ls_a_dv* +ls_a_dw latex-suite.txt /*ls_a_dw* +ls_a_dx latex-suite.txt /*ls_a_dx* +ls_a_dy latex-suite.txt /*ls_a_dy* +ls_a_dz latex-suite.txt /*ls_a_dz* +ls_a_eA latex-suite.txt /*ls_a_eA* +ls_a_eB latex-suite.txt /*ls_a_eB* +ls_a_eC latex-suite.txt /*ls_a_eC* +ls_a_eD latex-suite.txt /*ls_a_eD* +ls_a_eE latex-suite.txt /*ls_a_eE* +ls_a_eF latex-suite.txt /*ls_a_eF* +ls_a_eG latex-suite.txt /*ls_a_eG* +ls_a_ea latex-suite.txt /*ls_a_ea* +ls_a_eb latex-suite.txt /*ls_a_eb* +ls_a_ec latex-suite.txt /*ls_a_ec* +ls_a_ed latex-suite.txt /*ls_a_ed* +ls_a_ee latex-suite.txt /*ls_a_ee* +ls_a_ef latex-suite.txt /*ls_a_ef* +ls_a_eg latex-suite.txt /*ls_a_eg* +ls_a_eh latex-suite.txt /*ls_a_eh* +ls_a_ei latex-suite.txt /*ls_a_ei* +ls_a_ej latex-suite.txt /*ls_a_ej* +ls_a_ek latex-suite.txt /*ls_a_ek* +ls_a_el latex-suite.txt /*ls_a_el* +ls_a_em latex-suite.txt /*ls_a_em* +ls_a_en latex-suite.txt /*ls_a_en* +ls_a_eo latex-suite.txt /*ls_a_eo* +ls_a_ep latex-suite.txt /*ls_a_ep* +ls_a_eq latex-suite.txt /*ls_a_eq* +ls_a_er latex-suite.txt /*ls_a_er* +ls_a_es latex-suite.txt /*ls_a_es* +ls_a_et latex-suite.txt /*ls_a_et* +ls_a_eu latex-suite.txt /*ls_a_eu* +ls_a_ev latex-suite.txt /*ls_a_ev* +ls_a_ew latex-suite.txt /*ls_a_ew* +ls_a_ex latex-suite.txt /*ls_a_ex* +ls_a_ey latex-suite.txt /*ls_a_ey* +ls_a_ez latex-suite.txt /*ls_a_ez* +ls_u_1 latex-suite.txt /*ls_u_1* +ls_u_10 latex-suite.txt /*ls_u_10* +ls_u_11 latex-suite.txt /*ls_u_11* +ls_u_12 latex-suite.txt /*ls_u_12* +ls_u_13 latex-suite.txt /*ls_u_13* +ls_u_14 latex-suite.txt /*ls_u_14* +ls_u_2 latex-suite.txt /*ls_u_2* +ls_u_3 latex-suite.txt /*ls_u_3* +ls_u_4 latex-suite.txt /*ls_u_4* +ls_u_5 latex-suite.txt /*ls_u_5* +ls_u_6 latex-suite.txt /*ls_u_6* +ls_u_7 latex-suite.txt /*ls_u_7* +ls_u_8 latex-suite.txt /*ls_u_8* +ls_u_9 latex-suite.txt /*ls_u_9* +lsq-compiling latex-suite-quickstart.txt /*lsq-compiling* +lsq-conclusions latex-suite-quickstart.txt /*lsq-conclusions* +lsq-debugging latex-suite-quickstart.txt /*lsq-debugging* +lsq-folding latex-suite-quickstart.txt /*lsq-folding* +lsq-insert-environment latex-suite-quickstart.txt /*lsq-insert-environment* +lsq-inserting-reference latex-suite-quickstart.txt /*lsq-inserting-reference* +lsq-inserting-template latex-suite-quickstart.txt /*lsq-inserting-template* +lsq-keyboard-shortcuts latex-suite-quickstart.txt /*lsq-keyboard-shortcuts* +lsq-lsq-inserting-package latex-suite-quickstart.txt /*lsq-lsq-inserting-package* +lsq-quick-forward-searching latex-suite-quickstart.txt /*lsq-quick-forward-searching* +lsq-quick-inverse-searching latex-suite-quickstart.txt /*lsq-quick-inverse-searching* +lsq-using-tutorial latex-suite-quickstart.txt /*lsq-using-tutorial* +lsq-viewing-dvi latex-suite-quickstart.txt /*lsq-viewing-dvi* +macro-enabling latex-suite.txt /*macro-enabling* +math, latexhelp.txt /*math,* +math-misc latexhelp.txt /*math-misc* +math-mode latexhelp.txt /*math-mode* +math-spacing latexhelp.txt /*math-spacing* +math-symbols latexhelp.txt /*math-symbols* +math: latexhelp.txt /*math:* +math; latexhelp.txt /*math;* +matlab matlab.txt /*matlab* +matlab-compiler matlab.txt /*matlab-compiler* +matlab-indent matlab.txt /*matlab-indent* +matlab-instal matlab.txt /*matlab-instal* +matlab-matchit matlab.txt /*matlab-matchit* +matlab-syntax matlab.txt /*matlab-syntax* +matlab-tags matlab.txt /*matlab-tags* +matn! latexhelp.txt /*matn!* +minipage latexhelp.txt /*minipage* +notitlepage latexhelp.txt /*notitlepage* +onecolumn latexhelp.txt /*onecolumn* +oneside latexhelp.txt /*oneside* +openany latexhelp.txt /*openany* +openbib latexhelp.txt /*openbib* +openright latexhelp.txt /*openright* +overriding-macros latex-suite.txt /*overriding-macros* +package-actions latex-suite.txt /*package-actions* +paragraph-mode latexhelp.txt /*paragraph-mode* +part-compiling latex-suite.txt /*part-compiling* +pausing-imaps latex-suite.txt /*pausing-imaps* +picture latexhelp.txt /*picture* +picture-makebox latexhelp.txt /*picture-makebox* +place-holder latex-suite.txt /*place-holder* +place-holders latex-suite.txt /*place-holders* +plain latexhelp.txt /*plain* +pre-lengths latexhelp.txt /*pre-lengths* +quotation latexhelp.txt /*quotation* +quote-l latexhelp.txt /*quote-l* +recommended-settings latex-suite.txt /*recommended-settings* +remapping-latex-suite-keys latex-suite.txt /*remapping-latex-suite-keys* +report-class latexhelp.txt /*report-class* +roman latexhelp.txt /*roman* +rqno latexhelp.txt /*rqno* +section-mappings latex-suite.txt /*section-mappings* +slides-class latexhelp.txt /*slides-class* +smart-backspace latex-suite.txt /*smart-backspace* +smart-keys latex-suite.txt /*smart-keys* +sub-sup latexhelp.txt /*sub-sup* +subscripts latexhelp.txt /*subscripts* +superscripts latexhelp.txt /*superscripts* +supporting-packages latex-suite.txt /*supporting-packages* +tab' latexhelp.txt /*tab'* +tab+ latexhelp.txt /*tab+* +tab- latexhelp.txt /*tab-* +tab< latexhelp.txt /*tab<* +tab= latexhelp.txt /*tab=* +tab> latexhelp.txt /*tab>* +tab` latexhelp.txt /*tab`* +taba latexhelp.txt /*taba* +tabbing latexhelp.txt /*tabbing* +tabular latexhelp.txt /*tabular* +theorem latexhelp.txt /*theorem* +titlepage latexhelp.txt /*titlepage* +twocolumn latexhelp.txt /*twocolumn* +twoside latexhelp.txt /*twoside* +vcscommand vcscommand.txt /*vcscommand* +vcscommand-buffer-management vcscommand.txt /*vcscommand-buffer-management* +vcscommand-buffer-variables vcscommand.txt /*vcscommand-buffer-variables* +vcscommand-bugs vcscommand.txt /*vcscommand-bugs* +vcscommand-commands vcscommand.txt /*vcscommand-commands* +vcscommand-config vcscommand.txt /*vcscommand-config* +vcscommand-contents vcscommand.txt /*vcscommand-contents* +vcscommand-customize vcscommand.txt /*vcscommand-customize* +vcscommand-events vcscommand.txt /*vcscommand-events* +vcscommand-install vcscommand.txt /*vcscommand-install* +vcscommand-intro vcscommand.txt /*vcscommand-intro* +vcscommand-manual vcscommand.txt /*vcscommand-manual* +vcscommand-mappings vcscommand.txt /*vcscommand-mappings* +vcscommand-mappings-override vcscommand.txt /*vcscommand-mappings-override* +vcscommand-naming vcscommand.txt /*vcscommand-naming* +vcscommand-options vcscommand.txt /*vcscommand-options* +vcscommand-ssh vcscommand.txt /*vcscommand-ssh* +vcscommand-ssh-config vcscommand.txt /*vcscommand-ssh-config* +vcscommand-ssh-env vcscommand.txt /*vcscommand-ssh-env* +vcscommand-ssh-other vcscommand.txt /*vcscommand-ssh-other* +vcscommand-ssh-wrapper vcscommand.txt /*vcscommand-ssh-wrapper* +vcscommand-statusline vcscommand.txt /*vcscommand-statusline* +vcscommand.txt vcscommand.txt /*vcscommand.txt* +verbatim latexhelp.txt /*verbatim* +verse latexhelp.txt /*verse* +why-IMAP latex-suite.txt /*why-IMAP* diff --git a/.vim/doc/vcscommand.txt b/.vim/doc/vcscommand.txt @@ -0,0 +1,843 @@ +*vcscommand.txt* vcscommand +Copyright (c) Bob Hiestand + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. + +For instructions on installing this file, type + :help add-local-help +inside Vim. + +Author: Bob Hiestand <bob.hiestand@gmail.com> +Credits: Benji Fisher's excellent MatchIt documentation + +============================================================================== +1. Contents *vcscommand-contents* + + Installation : |vcscommand-install| + vcscommand Intro : |vcscommand| + vcscommand Manual : |vcscommand-manual| + Customization : |vcscommand-customize| + SSH "integration" : |vcscommand-ssh| + Changes from cvscommand : |cvscommand-changes| + Bugs : |vcscommand-bugs| + +============================================================================== + +2. vcscommand Installation *vcscommand-install* + +The vcscommand plugin comprises five files: vcscommand.vim, vcssvn.vim, +vcscvs.vim, vcssvk.vim and vcscommand.txt (this file). In order to install +the plugin, place the vcscommand.vim, vcssvn.vim, vcssvk.vim, and vcscvs.vim +files into a plugin directory in your runtime path (please see +|add-global-plugin| and |'runtimepath'|. + +This help file can be included in the VIM help system by copying it into a +'doc' directory in your runtime path and then executing the |:helptags| +command, specifying the full path of the 'doc' directory. Please see +|add-local-help| for more details. + +vcscommand may be customized by setting variables, creating maps, and +specifying event handlers. Please see |vcscommand-customize| for more +details. + +============================================================================== + +3. vcscommand Intro *vcscommand* + *vcscommand-intro* + +The vcscommand plugin provides global ex commands for manipulating +version-controlled source files, currently those controlled either by CVS or +Subversion. In general, each command operates on the current buffer and +accomplishes a separate source control function, such as update, commit, log, +and others (please see |vcscommand-commands| for a list of all available +commands). The results of each operation are displayed in a scratch buffer. +Several buffer variables are defined for those scratch buffers (please see +|vcscommand-buffer-variables|). + +The notion of "current file" means either the current buffer, or, in the case +of a directory buffer (such as Explorer or netrw buffers), the directory (and +all subdirectories) represented by the the buffer. + +For convenience, any vcscommand invoked on a vcscommand scratch buffer acts as +though it was invoked on the original file and splits the screen so that the +output appears in a new window. + +Many of the commands accept revisions as arguments. By default, most operate +on the most recent revision on the current branch if no revision is specified. + +Each vcscommand is mapped to a key sequence starting with the |<Leader>| +keystroke. The default mappings may be overridden by supplying different +mappings before the plugin is loaded, such as in the vimrc, in the standard +fashion for plugin mappings. For examples, please see +|vcscommand-mappings-override|. + +The vcscommand plugin may be configured in several ways. For more details, +please see |vcscommand-customize|. + +============================================================================== + +4. vcscommand Manual *vcscommand-manual* + +4.1 vcscommand commands *vcscommand-commands* + +vcscommand defines the following commands: + +|:VCSAdd| +|:VCSAnnotate| +|:VCSBlame| +|:VCSCommit| +|:VCSDelete| +|:VCSDiff| +|:VCSGotoOriginal| +|:VCSLog| +|:VCSRemove| +|:VCSRevert| +|:VCSReview| +|:VCSStatus| +|:VCSUpdate| +|:VCSVimDiff| + +The following commands are specific to CVS files: + +|:CVSEdit| +|:CVSEditors| +|:CVSUnedit| +|:CVSWatch| +|:CVSWatchAdd| +|:CVSWatchOn| +|:CVSWatchOff| +|:CVSWatchRemove| +|:CVSWatchers| + +:VCSAdd *:VCSAdd* + +This command adds the current file to source control. Please note, this does +not commit the newly-added file. All parameters to the command are passed to +the underlying VCS. + +:VCSAnnotate[!] *:VCSAnnotate* + +This command displays the current file with each line annotated with the +version in which it was most recently changed. If an argument is given, the +argument is used as a revision number to display. If not given an argument, +it uses the most recent version of the file (on the current branch, if under +CVS control). Additionally, if the current buffer is a VCSAnnotate buffer +already, the version number on the current line is used. + +If '!' is used, the view of the annotated buffer is split so that the +annotation is in a separate window from the content, and each is highlighted +separately. + +For CVS buffers, the 'VCSCommandCVSAnnotateParent' option, if set to non-zero, +will cause the above behavior to change. Instead of annotating the version on +the current line, the parent revision is used instead, crossing branches if +necessary. + +With no arguments the cursor will jump to the line in the annotated buffer +corresponding to the current line in the source buffer. + +:VCSBlame[!] *:VCSBlame* + +Alias for |:VCSAnnotate|. + +:VCSCommit[!] *:VCSCommit* + +This command commits changes to the current file to source control. + +If called with arguments, the arguments are the log message. + +If '!' is used, an empty log message is committed. + +If called with no arguments, this is a two-step command. The first step opens +a buffer to accept a log message. When that buffer is written, it is +automatically closed and the file is committed using the information from that +log message. The commit can be abandoned if the log message buffer is deleted +or wiped before being written. + +Alternatively, the mapping that is used to invoke :VCSCommit (by default +|<Leader>|cc, please see |vcscommand-mappings|) can be used in the log message +buffer in Normal mode to immediately commit. This is useful if the +|VCSCommandCommitOnWrite| variable is set to 0 to disable the normal +commit-on-write behavior. + +:VCSDelete *:VCSDelete* + +Deletes the current file and removes it from source control. All parameters +to the command are passed to the underlying VCS. + +:VCSDiff *:VCSDiff* + +With no arguments, this displays the differences between the current file and +its parent version under source control in a new scratch buffer. + +With one argument, the diff is performed on the current file against the +specified revision. + +With two arguments, the diff is performed between the specified revisions of +the current file. + +For CVS, this command uses the |VCSCommandCVSDiffOpt| variable to specify diff +options. If that variable does not exist, a plugin-specific default is used. +If you wish to have no options, then set it to the empty string. + +For SVN, this command uses the |VCSCommandSVNDiffOpt| variable to specify diff +options. If that variable does not exist, the SVN default is used. +Additionally, |VCSCommandSVNDiffExt| can be used to select an external diff +application. + +:VCSGotoOriginal *:VCSGotoOriginal* + +This command jumps to the source buffer if the current buffer is a VCS scratch +buffer. + +:VCSGotoOriginal! + +Like ":VCSGotoOriginal" but also executes :bufwipeout on all VCS scrach +buffers associated with the original file. + +:VCSInfo *:VCSInfo* + +This command displays extended information about the current file in a new +scratch buffer. + +:VCSLock *:VCSLock* + +This command locks the current file in order to prevent other users from +concurrently modifying it. The exact semantics of this command depend on the +underlying VCS. This does nothing in CVS. All parameters are passed to the +underlying VCS. + +:VCSLog *:VCSLog* + +Displays the version history of the current file in a new scratch buffer. If +there is one parameter supplied, it is taken as as a revision parameters to be +passed through to the underlying VCS. Otherwise, all parameters are passed to +the underlying VCS. + +:VCSRemove *:VCSRemove* + +Alias for |:VCSDelete|. + +:VCSRevert *:VCSRevert* + +This command replaces the current file with the most recent version from the +repository in order to wipe out any undesired changes. + +:VCSReview *:VCSReview* + +Displays a particular version of the current file in a new scratch buffer. If +no argument is given, the most recent version of the file on the current +branch is retrieved. + +:VCSStatus *:VCSStatus* + +Displays versioning information about the current file in a new scratch +buffer. All parameters are passed to the underlying VCS. + + +:VCSUnlock *:VCSUnlock* + +Unlocks the current file in order to allow other users from concurrently +modifying it. The exact semantics of this command depend on the underlying +VCS. All parameters are passed to the underlying VCS. + +:VCSUpdate *:VCSUpdate* + +Updates the current file with any relevant changes from the repository. This +intentionally does not automatically reload the current buffer, though vim +should prompt the user to do so if the underlying file is altered by this +command. + +:VCSVimDiff *:VCSVimDiff* + +Uses vimdiff to display differences between versions of the current file. + +If no revision is specified, the most recent version of the file on the +current branch is used. With one argument, that argument is used as the +revision as above. With two arguments, the differences between the two +revisions is displayed using vimdiff. + +With either zero or one argument, the original buffer is used to perform the +vimdiff. When the scratch buffer is closed, the original buffer will be +returned to normal mode. + +Once vimdiff mode is started using the above methods, additional vimdiff +buffers may be added by passing a single version argument to the command. +There may be up to 4 vimdiff buffers total. + +Using the 2-argument form of the command resets the vimdiff to only those 2 +versions. Additionally, invoking the command on a different file will close +the previous vimdiff buffers. + +:CVSEdit *:CVSEdit* + +This command performs "cvs edit" on the current file. Yes, the output buffer +in this case is almost completely useless. + +:CVSEditors *:CVSEditors* + +This command performs "cvs edit" on the current file. + +:CVSUnedit *:CVSUnedit* + +Performs "cvs unedit" on the current file. Again, yes, the output buffer here +is basically useless. + +:CVSWatch *:CVSWatch* + +This command takes an argument which must be one of [on|off|add|remove]. The +command performs "cvs watch" with the given argument on the current file. + +:CVSWatchAdd *:CVSWatchAdd* + +This command is an alias for ":CVSWatch add" + +:CVSWatchOn *:CVSWatchOn* + +This command is an alias for ":CVSWatch on" + +:CVSWatchOff *:CVSWatchOff* + +This command is an alias for ":CVSWatch off" + +:CVSWatchRemove *:CVSWatchRemove* + +This command is an alias for ":CVSWatch remove" + +:CVSWatchers *:CVSWatchers* + +This command performs "cvs watchers" on the current file. + +4.2 Mappings *vcscommand-mappings* + +By default, a mapping is defined for each command. These mappings execute the +default (no-argument) form of each command. + +|<Leader>|ca VCSAdd +|<Leader>|cn VCSAnnotate +|<Leader>|cN VCSAnnotate! +|<Leader>|cc VCSCommit +|<Leader>|cD VCSDelete +|<Leader>|cd VCSDiff +|<Leader>|cg VCSGotoOriginal +|<Leader>|cG VCSGotoOriginal! +|<Leader>|ci VCSInfo +|<Leader>|cl VCSLog +|<Leader>|cL VCSLock +|<Leader>|cr VCSReview +|<Leader>|cs VCSStatus +|<Leader>|cu VCSUpdate +|<Leader>|cU VCSUnlock +|<Leader>|cv VCSVimDiff + +Only for CVS buffers: + +|<Leader>|ce CVSEdit +|<Leader>|cE CVSEditors +|<Leader>|ct CVSUnedit +|<Leader>|cwv CVSWatchers +|<Leader>|cwa CVSWatchAdd +|<Leader>|cwn CVSWatchOn +|<Leader>|cwf CVSWatchOff +|<Leader>|cwf CVSWatchRemove + + *vcscommand-mappings-override* + +The default mappings can be overridden by user-provided instead by mapping to +<Plug>CommandName. This is especially useful when these mappings collide with +other existing mappings (vim will warn of this during plugin initialization, +but will not clobber the existing mappings). + +There are three methods for controlling mapping: + +First, maps can be overriden for individual commands. For instance, to +override the default mapping for :VCSAdd to set it to '\add', add the +following to the vimrc: + +nmap \add <Plug>VCSAdd + +Second, the default map prefix ('<Leader>c') can be overridden by defining the +|VCSCommandMapPrefix| variable. + +Third, the entire set of default maps can be overridden by defining the +|VCSCommandMappings| variable. + + +4.3 Automatic buffer variables *vcscommand-buffer-variables* + +Several buffer variables are defined in each vcscommand result buffer. These +may be useful for additional customization in callbacks defined in the event +handlers (please see |vcscommand-events|). + +The following variables are automatically defined: + +b:VCSCommandOriginalBuffer *b:VCSCommandOriginalBuffer* + +This variable is set to the buffer number of the source file. + +b:VCSCommandCommand *b:VCSCommandCommand* + +This variable is set to the name of the vcscommand that created the result +buffer. + +b:VCSCommandSourceFile *b:VCSCommandSourceFile* + +This variable is set to the name of the original file under source control. + +b:VCSCommandVCSType *b:VCSCommandVCSType* + +This variable is set to the type of the source control. This variable is also +set on the original file itself. +============================================================================== + +5. Configuration and customization *vcscommand-customize* + *vcscommand-config* + +The vcscommand plugin can be configured in several ways: by setting +configuration variables (see |vcscommand-options|) or by defining vcscommand +event handlers (see |vcscommand-events|). Additionally, the vcscommand plugin +supports a customized status line (see |vcscommand-statusline| and +|vcscommand-buffer-management|). + +5.1 vcscommand configuration variables *vcscommand-options* + +Several variables affect the plugin's behavior. These variables are checked +at time of execution, and may be defined at the window, buffer, or global +level and are checked in that order of precedence. + + +The following variables are available: + +|VCSCommandCommitOnWrite| +|VCSCommandCVSDiffOpt| +|VCSCommandCVSExec| +|VCSCommandDeleteOnHide| +|VCSCommandDiffSplit| +|VCSCommandDisableAll| +|VCSCommandDisableMappings| +|VCSCommandDisableExtensionMappings| +|VCSCommandDisableMenu| +|VCSCommandEdit| +|VCSCommandEnableBufferSetup| +|VCSCommandMappings| +|VCSCommandMapPrefix| +|VCSCommandMenuPriority| +|VCSCommandMenuRoot| +|VCSCommandResultBufferNameExtension| +|VCSCommandResultBufferNameFunction| +|VCSCommandSplit| +|VCSCommandSVKExec| +|VCSCommandSVNDiffExt| +|VCSCommandSVNDiffOpt| +|VCSCommandSVNExec| +|VCSCommandVCSTypeOverride| +|VCSCommandVCSTypePreference| + +VCSCommandCommitOnWrite *VCSCommandCommitOnWrite* + +This variable, if set to a non-zero value, causes the pending commit +to take place immediately as soon as the log message buffer is written. +If set to zero, only the VCSCommit mapping will cause the pending commit to +occur. If not set, it defaults to 1. + +VCSCommandCVSExec *VCSCommandCVSExec* + +This variable controls the executable used for all CVS commands If not set, +it defaults to "cvs". + +VCSCommandDeleteOnHide *VCSCommandDeleteOnHide* + +This variable, if set to a non-zero value, causes the temporary result buffers +to automatically delete themselves when hidden. + +VCSCommandCVSDiffOpt *VCSCommandCVSDiffOpt* + +This variable, if set, determines the options passed to the diff command of +CVS. If not set, it defaults to 'u'. + +VCSCommandDiffSplit *VCSCommandDiffSplit* + +This variable overrides the |VCSCommandSplit| variable, but only for buffers +created with |:VCSVimDiff|. + +VCSCommandDisableAll *VCSCommandDisableAll* + +This variable, if set, prevents the plugin or any extensions from loading at +all. This is useful when a single runtime distribution is used on multiple +systems with varying versions. + +VCSCommandDisableMappings *VCSCommandDisableMappings* + +This variable, if set to a non-zero value, prevents the default command +mappings from being set. This supercedes +|VCSCommandDisableExtensionMappings|. + +VCSCommandDisableExtensionMappings *VCSCommandDisableExtensionMappings* + +This variable, if set to a non-zero value, prevents the default command +mappings from being set for commands specific to an individual VCS. + +VCSCommandEdit *VCSCommandEdit* + +This variable controls whether the original buffer is replaced ('edit') or +split ('split'). If not set, it defaults to 'split'. + +VCSCommandDisableMenu *VCSCommandDisableMenu* + +This variable, if set to a non-zero value, prevents the default command menu +from being set. + +VCSCommandEnableBufferSetup *VCSCommandEnableBufferSetup* + +This variable, if set to a non-zero value, activates VCS buffer management +mode see (|vcscommand-buffer-management|). This mode means that the +'VCSCommandBufferInfo' variable is filled with version information if the file +is VCS-controlled. This is useful for displaying version information in the +status bar. + +VCSCommandMappings *VCSCommandMappings* + +This variable, if set, overrides the default mappings used for shortcuts. It +should be a List of 2-element Lists, each containing a shortcut and function +name pair. The value of the '|VCSCommandMapPrefix|' variable will be added to +each shortcut. + +VCSCommandMapPrefix *VCSCommandMapPrefix* + +This variable, if set, overrides the default mapping prefix ('<Leader>c'). +This allows customization of the mapping space used by the vcscommand +shortcuts. + +VCSCommandMenuPriority *VCSCommandMenuPriority* + +This variable, if set, overrides the default menu priority '' (empty) + +VCSCommandMenuRoot *VCSCommandMenuRoot* + +This variable, if set, overrides the default menu root 'Plugin.VCS' + +VCSCommandResultBufferNameExtension *VCSCommandResultBufferNameExtension* + +This variable, if set to a non-blank value, is appended to the name of the VCS +command output buffers. For example, '.vcs'. Using this option may help +avoid problems caused by autocommands dependent on file extension. + +VCSCommandResultBufferNameFunction *VCSCommandResultBufferNameFunction* + +This variable, if set, specifies a custom function for naming VCS command +output buffers. This function is expected to return the new buffer name, and +will be passed the following arguments: + + command - name of the VCS command being executed (such as 'Log' or + 'Diff'). + + originalBuffer - buffer number of the source file. + + vcsType - type of VCS controlling this file (such as 'CVS' or 'SVN'). + + statusText - extra text associated with the VCS action (such as version + numbers). + +VCSCommandSplit *VCSCommandSplit* + +This variable controls the orientation of the various window splits that +may occur. + +If set to 'horizontal', the resulting windows will be on stacked on top of +one another. If set to 'vertical', the resulting windows will be +side-by-side. If not set, it defaults to 'horizontal' for all but +VCSVimDiff windows. VCSVimDiff windows default to the user's 'diffopt' +setting, if set, otherwise 'vertical'. + +VCSCommandSVKExec *VCSCommandSVKExec* + +This variable controls the executable used for all SVK commands If not set, +it defaults to "svk". + +VCSCommandSVNDiffExt *VCSCommandSVNDiffExt* + +This variable, if set, is passed to SVN via the --diff-cmd command to select +an external application for performing the diff. + +VCSCommandSVNDiffOpt *VCSCommandSVNDiffOpt* + +This variable, if set, determines the options passed with the '-x' parameter +to the SVN diff command. If not set, no options are passed. + +VCSCommandSVNExec *VCSCommandSVNExec* + +This variable controls the executable used for all SVN commands If not set, +it defaults to "svn". + +VCSCommandVCSTypeOverride *VCSCommandVCSTypeOverride* + +This variable allows the VCS type detection to be overridden on a path-by-path +basis. The value of this variable is expected to be a List of Lists. Each +item in the high-level List is a List containing two elements. The first +element is a regular expression that will be matched against the full file +name of a given buffer. If it matches, the second element will be used as the +VCS type. + +VCSCommandVCSTypePreference *VCSCommandVCSTypePreference* + +This variable allows the VCS type detection to be weighted towards a specific +VCS, in case more than one potential VCS is detected as useable. The format +of the variable is either a list or a space-separated string containing the +ordered-by-preference abbreviations of the preferred VCS types. + +5.2 VCSCommand events *vcscommand-events* + +For additional customization, vcscommand can trigger user-defined events. +Event handlers are provided by defining User event autocommands (see +|autocommand|, |User|) in the vcscommand group with patterns matching the +event name. + +For instance, the following could be added to the vimrc to provide a 'q' +mapping to quit a vcscommand scratch buffer: + +augroup VCSCommand + au User VCSBufferCreated silent! nmap <unique> <buffer> q :bwipeout<cr> +augroup END + +The following hooks are available: + +VCSBufferCreated This event is fired just after a vcscommand + result buffer is created and populated. It is + executed within the context of the vcscommand + buffer. The vcscommand buffer variables may + be useful for handlers of this event (please + see |vcscommand-buffer-variables|). + +VCSBufferSetup This event is fired just after vcscommand buffer + setup occurs, if enabled. + +VCSPluginInit This event is fired when the vcscommand plugin + first loads. + +VCSPluginFinish This event is fired just after the vcscommand + plugin loads. + +VCSVimDiffFinish This event is fired just after the VCSVimDiff + command executes to allow customization of, + for instance, window placement and focus. + +Additionally, there is another hook which is used internally to handle loading +the multiple scripts in order. This hook should probably not be used by an +end user without a good idea of how it works. Among other things, any events +associated with this hook are cleared after they are executed (during +vcscommand.vim script initialization). + +VCSLoadExtensions This event is fired just before the + VCSPluginFinish. It is used internally to + execute any commands from the VCS + implementation plugins that needs to be + deferred until the primary plugin is + initialized. + +5.3 vcscommand buffer naming *vcscommand-naming* + +vcscommand result buffers use the following naming convention: +[{VCS type} {VCS command} {Source file name}] + +If additional buffers are created that would otherwise conflict, a +distinguishing number is added: + +[{VCS type} {VCS command} {Source file name}] (1,2, etc) + +5.4 vcscommand status line support *vcscommand-statusline* + +It is intended that the user will customize the |'statusline'| option to +include vcscommand result buffer attributes. A sample function that may be +used in the |'statusline'| option is provided by the plugin, +VCSCommandGetStatusLine(). In order to use that function in the status line, do +something like the following: + +set statusline=%<%f\ %{VCSCommandGetStatusLine()}\ %h%m%r%=%l,%c%V\ %P + +of which %{VCSCommandGetStatusLine()} is the relevant portion. + +The sample VCSCommandGetStatusLine() function handles both vcscommand result +buffers and VCS-managed files if vcscommand buffer management is enabled +(please see |vcscommand-buffer-management|). + +5.5 vcscommand buffer management *vcscommand-buffer-management* + +The vcscommand plugin can operate in buffer management mode, which means that +it attempts to set a buffer variable ('VCSCommandBufferInfo') upon entry into +a buffer. This is rather slow because it means that the VCS will be invoked +at each entry into a buffer (during the |BufEnter| autocommand). + +This mode is disabled by default. In order to enable it, set the +|VCSCommandEnableBufferSetup| variable to a true (non-zero) value. Enabling +this mode simply provides the buffer variable mentioned above. The user must +explicitly include information from the variable in the |'statusline'| option +if they are to appear in the status line (but see |vcscommand-statusline| for +a simple way to do that). + +The 'VCSCommandBufferInfo' variable is a list which contains, in order, the +revision of the current file, the latest revision of the file in the +repository, and (for CVS) the name of the branch. If those values cannot be +determined, the list is a single element: 'Unknown'. + +============================================================================== + +6. SSH "integration" *vcscommand-ssh* + +The following instructions are intended for use in integrating the +vcscommand.vim plugin with an SSH-based CVS environment. + +Familiarity with SSH and CVS are assumed. + +These instructions assume that the intent is to have a message box pop up in +order to allow the user to enter a passphrase. If, instead, the user is +comfortable using certificate-based authentication, then only instructions +6.1.1 and 6.1.2 (and optionally 6.1.4) need to be followed; ssh should then +work transparently. + +6.1 Environment settings *vcscommand-ssh-env* + +6.1.1 CVSROOT should be set to something like: + + :ext:user@host:/path_to_repository + +6.1.2 CVS_RSH should be set to: + + ssh + + Together, those settings tell CVS to use ssh as the transport when + performing CVS calls. + +6.1.3 SSH_ASKPASS should be set to the password-dialog program. In my case, + running gnome, it's set to: + + /usr/libexec/openssh/gnome-ssh-askpass + + This tells SSH how to get passwords if no input is available. + +6.1.4 OPTIONAL. You may need to set SSH_SERVER to the location of the cvs + executable on the remote (server) machine. + +6.2 CVS wrapper program *vcscommand-ssh-wrapper* + +Now you need to convince SSH to use the password-dialog program. This means +you need to execute SSH (and therefore CVS) without standard input. The +following script is a simple perl wrapper that dissasociates the CVS command +from the current terminal. Specific steps to do this may vary from system to +system; the following example works for me on linux. + +#!/usr/bin/perl -w +use strict; +use POSIX qw(setsid); +open STDIN, '/dev/null'; +fork and do {wait; exit;}; +setsid; +exec('cvs', @ARGV); + +6.3 Configuring vcscommand.vim *vcscommand-ssh-config* + +At this point, you should be able to use your wrapper script to invoke CVS with +various commands, and get the password dialog. All that's left is to make CVS +use your newly-created wrapper script. + +6.3.1 Tell vcscommand.vim what CVS executable to use. The easiest way to do this + is globally, by putting the following in your .vimrc: + + let VCSCommandCVSExec=/path/to/cvs/wrapper/script + +6.4 Where to go from here *vcscommand-ssh-other* + +The script given above works even when non-SSH CVS connections are used, +except possibly when interactively entering the message for CVS commit log +(depending on the editor you use... VIM works fine). Since the vcscommand.vim +plugin handles that message without a terminal, the wrapper script can be used +all the time. + +This allows mixed-mode operation, where some work is done with SSH-based CVS +repositories, and others with pserver or local access. + +It is possible, though beyond the scope of the plugin, to dynamically set the +CVS executable based on the CVSROOT for the file being edited. The user +events provided (such as VCSBufferCreated and VCSBufferSetup) can be used to +set a buffer-local value (b:VCSCommandCVSExec) to override the CVS executable +on a file-by-file basis. Alternatively, much the same can be done (less +automatically) by the various project-oriented plugins out there. + +It is highly recommended for ease-of-use that certificates with no passphrase +or ssh-agent are employed so that the user is not given the password prompt +too often. + +============================================================================== + +7. Changes from cvscommand *cvscommand-changes* + +1. Require Vim 7 in order to leverage several convenient features; also +because I wanted to play with Vim 7. + +2. Renamed commands to start with 'VCS' instead of 'CVS'. The exceptions are +the 'CVSEdit' and 'CVSWatch' family of commands, which are specific to CVS. + +3. Renamed options, events to start with 'VCSCommand'. + +4. Removed option to jump to the parent version of the current line in an +annotated buffer, as opposed to the version on the current line. This made +little sense in the branching scheme used by subversion, where jumping to a +parent branch required finding a different location in the repository. It +didn't work consistently in CVS anyway. + +5. Removed option to have nameless scratch buffers. + +6. Changed default behavior of scratch buffers to split the window instead of +displaying in the current window. This may still be overridden using the +'VCSCommandEdit' option. + +7. Split plugin into multiple plugins. + +8. Added 'VCSLock' and 'VCSUnlock' commands. These are implemented for +subversion but not for CVS. These were not kept specific to subversion as they +seemed more general in nature and more likely to be supported by any future VCS +supported by this plugin. + +9. Changed name of buffer variables set by commands. + +'b:cvsOrigBuffNR' became 'b:VCSCommandOriginalBuffer' +'b:cvscmd' became 'b:VCSCommandCommand' + +10. Added new automatic variables to command result buffers. + +'b:VCSCommandSourceFile' +'b:VCSCommandVCSType' + +============================================================================== + +8. Known bugs *vcscommand-bugs* + +Please let me know if you run across any. + +CVSUnedit may, if a file is changed from the repository, provide prompt text +to determine whether the changes should be thrown away. Currently, that text +shows up in the CVS result buffer as information; there is no way for the user +to actually respond to the prompt and the CVS unedit command does nothing. If +this really bothers anyone, please let me know. + +VCSVimDiff, when using the original (real) source buffer as one of the diff +buffers, uses some hacks to try to restore the state of the original buffer +when the scratch buffer containing the other version is destroyed. There may +still be bugs in here, depending on many configuration details. + +vim:tw=78:ts=8:ft=help diff --git a/.vim/ftplugin/.DS_Store b/.vim/ftplugin/.DS_Store Binary files differ. diff --git a/.vim/ftplugin/._.DS_Store b/.vim/ftplugin/._.DS_Store Binary files differ. diff --git a/.vim/ftplugin/._matlab.vim b/.vim/ftplugin/._matlab.vim Binary files differ. diff --git a/.vim/ftplugin/bib_latexSuite.vim b/.vim/ftplugin/bib_latexSuite.vim @@ -0,0 +1,16 @@ +" File: bib_latexSuite.vim +" Author: Srinath Avadhanula +" License: Vim Charityware License +" Description: +" This file sources the bibtex.vim file distributed as part of latex-suite. +" That file sets up 3 maps BBB, BAS, and BBA which are easy wasy to type in +" bibliographic entries. +" +" CVS: $Id: bib_latexSuite.vim 997 2006-03-20 09:45:45Z srinathava $ + +" source main.vim because we need a few functions from it. +runtime ftplugin/latex-suite/main.vim +" Disable smart-quotes because we need to enter real quotes in bib files. +runtime ftplugin/latex-suite/bibtex.vim + +" vim:fdm=marker:ff=unix:noet:ts=4:sw=4:nowrap diff --git a/.vim/ftplugin/latex-suite/.DS_Store b/.vim/ftplugin/latex-suite/.DS_Store Binary files differ. diff --git a/.vim/ftplugin/latex-suite/._.DS_Store b/.vim/ftplugin/latex-suite/._.DS_Store Binary files differ. diff --git a/.vim/ftplugin/latex-suite/bibtex.vim b/.vim/ftplugin/latex-suite/bibtex.vim @@ -0,0 +1,266 @@ +"============================================================================= +" File: bibtex.vim +" Function: BibT +" Author: Alan G Isaac <aisaac@american.edu> +" modified by Srinath Avadhanula for latex-suite. +" License: Vim Charityware license. +" CVS: $Id: bibtex.vim 997 2006-03-20 09:45:45Z srinathava $ +"============================================================================= + +" Fields: +" Define what field type each letter denotes {{{ +" +let s:w_standsfor = 'address' +let s:a_standsfor = 'author' +let s:b_standsfor = 'booktitle' +let s:c_standsfor = 'chapter' +let s:d_standsfor = 'edition' +let s:e_standsfor = 'editor' +let s:h_standsfor = 'howpublished' +let s:i_standsfor = 'institution' +let s:k_standsfor = 'isbn' +let s:j_standsfor = 'journal' +let s:m_standsfor = 'month' +let s:n_standsfor = 'number' +let s:o_standsfor = 'organization' +let s:p_standsfor = 'pages' +let s:q_standsfor = 'publisher' +let s:r_standsfor = 'school' +let s:s_standsfor = 'series' +let s:t_standsfor = 'title' +let s:u_standsfor = 'type' +let s:v_standsfor = 'volume' +let s:y_standsfor = 'year' +let s:z_standsfor = 'note' + +" }}} +" Define the fields required for the various entry types {{{ +" +" s:{type}_required defines the required fields +" s:{type}_optional1 defines common optional fields +" s:{type}_optional2 defines uncommmon optional fields +" s:{type}_retval defines the first line of the formatted bib entry. +" +let s:key='<+key+>' + +let s:{'article'}_required="atjy" +let s:{'article'}_optional1="vnpm" +let s:{'article'}_optional2="z" " z is note +let s:{'article'}_retval = '@ARTICLE{' . s:key . ','."\n" + +let s:{'book'}_required="aetqy" " requires author *or* editor +let s:{'book'}_optional1="wd" +let s:{'book'}_optional2="vnsmz" " w is address, d is edition +let s:{'book'}_extras="k" " isbn +let s:{'book'}_retval = '@BOOK{' . s:key . ','."\n" + +let s:{'booklet'}_required="t" +let s:{'booklet'}_optional1="ahy" +let s:{'booklet'}_optional2="wmz" " w is address +let s:{'booklet'}_retval = '@BOOKLET{' . s:key . ','."\n" + +let s:{'inbook'}_required="aetcpqy" +let s:{'inbook'}_optional1="w" " w is address +let s:{'inbook'}_optional2="vnsudmz" " d is edition +let s:{'inbook'}_extras="k" " isbn +let s:{'inbook'}_retval = '@INBOOK{' . s:key . ','."\n" + +let s:{'incollection'}_required="atbqy" " b is booktitle +let s:{'incollection'}_optional1="cpw" " w is address, c is chapter +let s:{'incollection'}_optional2="evnsudmz" " d is edition +let s:{'incollection'}_extras="k" " isbn +let s:{'incollection'}_retval = '@INCOLLECTION{' . s:key . ','."\n" + +let s:{'inproceedings'}_required="atby" " b is booktitle +let s:{'inproceedings'}_optional1="epwoq" " w is address, q is publisher +let s:{'inproceedings'}_optional2="vnsmz" +let s:{'inproceedings'}_extras="k" " isbn +let s:{'inproceedings'}_retval = '@INPROCEEDINGS{' . s:key . ','."\n" + +let s:{'conference'}_required="atby" " b is booktitle +let s:{'conference'}_optional1="epwoq" " w is address, q is publisher +let s:{'conference'}_optional2="vnsmz" +let s:{'conference'}_extras="k" " isbn +let s:{'conference'}_retval = '@CONFERENCE{' . s:key . ','."\n" + +let s:{'manual'}_required="t" +let s:{'manual'}_optional1="ow" +let s:{'manual'}_optional2="admyz" " w is address +let s:{'manual'}_retval = '@MANUAL{' . s:key . ','."\n" + +let s:{'msthesis'}_required="atry" " r is school +let s:{'msthesis'}_optional1="w" " w is address +let s:{'msthesis'}_optional2="umz" " u is type, w is address +let s:{'msthesis'}_retval = '@MASTERSTHESIS{' . s:key . ','."\n" + +let s:{'misc'}_required="" +let s:{'misc'}_optional1="ath" +let s:{'misc'}_optional2="myz" +let s:{'misc'}_retval = '@MISC{' . s:key . ','."\n" + +let s:{'phdthesis'}_required="atry" " r is school +let s:{'phdthesis'}_optional1="w" " w is address +let s:{'phdthesis'}_optional2="umz" " u is type +let s:{'phdthesis'}_retval = '@PHDTHESIS{' . s:key . ','."\n" + +let s:{'proceedings'}_required="ty" +let s:{'proceedings'}_optional1="ewo" " w is address +let s:{'proceedings'}_optional2="vnsmqz" " q is publisher +let s:{'proceedings'}_retval = '@PROCEEDINGS{' . s:key . ','."\n" + +let s:{'techreport'}_required="atiy" +let s:{'techreport'}_optional1="unw" " u is type, w is address +let s:{'techreport'}_optional2="mz" +let s:{'techreport'}_retval = '@TECHREPORT{' . s:key . ','."\n" + +let s:{'unpublished'}_required="atz" +let s:{'unpublished'}_optional1="y" +let s:{'unpublished'}_optional2="m" +let s:{'unpublished'}_retval = '@UNPUBLISHED{' . s:key . ','."\n" + +" }}} + +if exists('s:done') + finish +endif +let s:done = 1 + +call IMAP ('BBB', "\<C-r>=BibT('', '', 0)\<CR>", 'bib') +call IMAP ('BBL', "\<C-r>=BibT('', 'o', 0)\<CR>", 'bib') +call IMAP ('BBH', "\<C-r>=BibT('', 'O', 0)\<CR>", 'bib') +call IMAP ('BBX', "\<C-r>=BibT('', 'Ox', 0)\<CR>", 'bib') + +" BibT: function to generate a formatted bibtex entry {{{ +" three sample usages: +" :call BibT() will request type choice +" :call BibT("article") preferred, provides most common fields +" :call BibT("article","ox") more optional fields (o) and extras (x) +" +" Input Arguments: +" type: is one of the types listed above. (this should be a complete name, not +" the acronym). +" options: a string containing 0 or more of the letters 'oOx' +" where +" o: include a bib entry with first set of options +" O: include a bib entry with extended options +" x: incude bib entry with extra options +" prompt: whether the fields are asked to be filled on the command prompt or +" whether place-holders are used. when prompt == 1, then comman line +" questions are used. +" +" Returns: +" a string containing a formatted bib entry +function BibT(type, options, prompt) + if a:type != '' + let choosetype = a:type + else + let types = + \ 'article'."\n". + \ 'booklet'."\n". + \ 'book'."\n". + \ 'conference'."\n". + \ 'inbook'."\n". + \ 'incollection'."\n". + \ 'inproceedings'."\n". + \ 'manual'."\n". + \ 'msthesis'."\n". + \ 'misc'."\n". + \ 'phdthesis'."\n". + \ 'proceedings'."\n". + \ 'techreport'."\n". + \ 'unpublished' + let choosetype = Tex_ChooseFromPrompt( + \ "Choose the type of bibliographic entry: \n" . + \ Tex_CreatePrompt(types, 3, "\n") . + \ "\nEnter number or filename :", + \ types, "\n") + if choosetype == '' + let choosetype = 'article' + endif + if types !~ '^\|\n'.choosetype.'$\|\n' + echomsg 'Please choose only one of the given types' + return + endif + endif + if a:options != '' + let options = a:options + else + let options = "" + endif + + let fields = '' + let extras="" + let retval = "" + + " define fields + let fields = s:{choosetype}_required + if options =~ 'o' && exists('s:'.choosetype.'_optional1') + let fields = fields . s:{choosetype}_optional1 + endif + if options =~ "O" && exists('s:'.choosetype.'_optional2') + if options !~ 'o'&& exists('s:'.choosetype.'_optional1') + let fields = fields . s:{choosetype}_optional1 + endif + let fields = fields . s:{choosetype}_optional2 + endif + if options =~ "x" && exists('s:'.choosetype.'_extras') + let fields = fields . extras + endif + if exists('g:Bib_'.choosetype.'_options') + let fields = fields . g:Bib_{choosetype}_options + endif + + let retval = s:{choosetype}_retval + + let i = 0 + while i < strlen(fields) + let field = strpart(fields, i, 1) + + if exists('s:'.field.'_standsfor') + let field_name = s:{field}_standsfor + let retval = retval.field_name." = {<++>},\n" + endif + + let i = i + 1 + endwhile + + " If the user wants even more fine-tuning... + if Tex_GetVarValue('Bib_'.choosetype.'_extrafields') != '' + + let extrafields = Tex_GetVarValue('Bib_'.choosetype.'_extrafields') + + let i = 1 + while 1 + let field_name = Tex_Strntok(extrafields, "\n", i) + if field_name == '' + break + endif + + let retval = retval.field_name." = {<++>},\n" + + let i = i + 1 + endwhile + + endif + + let retval = retval.'otherinfo = {<++>}'."\n" + let retval = retval."}<++>"."\n" + + return IMAP_PutTextWithMovement(retval) +endfunction + +" }}} +function! s:Input(prompt, ask) " {{{ + if a:ask == 1 + let retval = input(a:prompt) + if retval == '' + return "<++>" + endif + else + return "<++>" + endif +endfunction + +" }}} + +" vim:fdm=marker:ff=unix:noet:ts=4:sw=4 diff --git a/.vim/ftplugin/latex-suite/bibtools.py b/.vim/ftplugin/latex-suite/bibtools.py @@ -0,0 +1,221 @@ +# Author: Srinath Avadhanula +# This file is distributed as part of the vim-latex project +# http://vim-latex.sf.net + +import re + +class Bibliography(dict): + def __init__(self, txt, macros={}): + """ + txt: + a string which represents the entire bibtex entry. A typical + entry is of the form: + @ARTICLE{ellington:84:part3, + author = {Ellington, C P}, + title = {The Aerodynamics of Hovering Insect Flight. III. Kinematics}, + journal = {Philosophical Transactions of the Royal Society of London. Series B, Biological Sciences}, + year = {1984}, + volume = {305}, + pages = {41-78}, + number = {1122}, + owner = {Srinath}, + pdf = {C:\srinath\research\papers\Ellington-3-Kinematics.pdf}, + timestamp = {2006.01.02}, + } + """ + + if macros: + for k, v in macros.iteritems(): + txt = txt.replace(k, '{'+v+'}') + + m = re.match(r'\s*@(\w+){((\S+),)?(.*)}\s*', txt, re.MULTILINE | re.DOTALL) + if not m: + return None + + self['bibtype'] = m.group(1).capitalize() + self['key'] = m.group(3) + self['body'] = m.group(4) + + body = self['body'] + self['bodytext'] = '' + while 1: + m = re.search(r'(\S+?)\s*=\s*(.)', body) + if not m: + break + + field = m.group(1) + + body = body[(m.start(2)+1):] + if m.group(2) == '{': + # search for the next closing brace. This is not simply a + # matter of searching for the next closing brace since + # braces can be nested. The following code basically goes + # to the next } which has not already been closed by a + # following {. + mniter = re.finditer(r'{|}', body) + + count = 1 + while 1: + try: + mn = mniter.next() + except StopIteration: + return None + + if mn.group(0) == '{': + count += 1 + else: + count -= 1 + + if count == 0: + value = body[:(mn.start(0))] + break + + elif m.group(2) == '"': + # search for the next unquoted double-quote. To be more + # precise, a double quote which is preceded by an even + # number of double quotes. + mn = re.search(r'(?!\\)(\\\\)*"', body) + if not mn: + return None + + value = body[:(mn.start(0))] + + else: + # $ always matches. So we do not need to do any + # error-checking. + mn = re.search(r',|$', body) + value = m.group(2) + body[:(mn.start(0))].rstrip() + + self[field] = re.sub(r'\s+', ' ', value) + body = body[(mn.start(0)+1):] + + self['bodytext'] += (' %s: %s\n' % (field, value)) + if self['bibtype'].lower() == 'string': + self['macro'] = {field: value} + + self['bodytext'] = self['bodytext'].rstrip() + + + def __getitem__(self, key): + try: + return dict.__getitem__(self, key) + except KeyError: + return '' + + def __str__(self): + if self['bibtype'].lower() == 'string': + return 'String: %(macro)s' % self + + elif self['bibtype'].lower() == 'article': + return ('Article [%(key)s]\n' + + 'TI "%(title)s"\n' + + 'AU %(author)s\n' + + 'IN In %(journal)s, %(year)s') % self + + elif self['bibtype'].lower() == 'conference': + return ('Conference [%(key)s]\n' + + 'TI "%(title)s"\n' + + 'AU %(author)s\n' + + 'IN In %(booktitle)s, %(year)s') % self + + elif self['bibtype'].lower() == 'mastersthesis': + return ('Masters [%(key)s]\n' + + 'TI "%(title)s"\n' + + 'AU %(author)s\n' + + 'IN In %(school)s, %(year)s') % self + + elif self['bibtype'].lower() == 'phdthesis': + return ('PhD [%(key)s]\n' + + 'TI "%(title)s"\n' + + 'AU %(author)s\n' + + 'IN In %(school)s, %(year)s') % self + + elif self['bibtype'].lower() == 'book': + return ('Book [%(key)s]\n' + + 'TI "%(title)s"\n' + + 'AU %(author)s\n' + + 'IN %(publisher)s, %(year)s') % self + + else: + s = '%(bibtype)s [%(key)s]\n' % self + if self['title']: + s += 'TI "%(title)s"\n' % self + if self['author']: + s += 'AU %(author)s\n' % self + for k, v in self.iteritems(): + if k not in ['title', 'author', 'bibtype', 'key', 'id', 'file', 'body', 'bodytext']: + s += 'MI %s: %s\n' % (k, v) + + return s.rstrip() + + def satisfies(self, filters): + for field, regexp in filters: + if not re.search(regexp, self[field], re.I): + return False + + return True + +class BibFile: + + def __init__(self, filelist=''): + self.bibentries = [] + self.filters = [] + self.macros = {} + self.sortfields = [] + if filelist: + for f in filelist.splitlines(): + self.addfile(f) + + def addfile(self, file): + fields = open(file).read().split('@') + for f in fields: + if not (f and re.match('string', f, re.I)): + continue + + b = Bibliography('@' + f) + self.macros.update(b['macro']) + + for f in fields: + if not f or re.match('string', f, re.I): + continue + + b = Bibliography('@' + f, self.macros) + if b: + b['file'] = file + b['id'] = len(self.bibentries) + self.bibentries += [b] + + + def addfilter(self, filterspec): + self.filters += [filterspec.split()] + + def rmfilters(self): + self.filters = [] + + def __str__(self): + s = '' + for b in self.bibentries: + if b['key'] and b.satisfies(self.filters): + s += '%s\n\n' % b + return s + + def addsortfield(self, field): + self.sortfields += [field] + + def rmsortfields(self): + self.sortfields = [] + + def sort(self): + def cmpfun(b1, b2): + for f in self.sortfields: + c = cmp(b1[f], b2[f]) + if c: + return c + return 0 + self.bibentries.sort(cmp=cmpfun) + +if __name__ == "__main__": + import sys + + bf = BibFile(sys.argv[1]) + print bf diff --git a/.vim/ftplugin/latex-suite/brackets.vim b/.vim/ftplugin/latex-suite/brackets.vim @@ -0,0 +1,145 @@ +" ============================================================================== +" History: This was originally part of auctex.vim by Carl Mueller. +" Srinath Avadhanula incorporated it into latex-suite with +" significant modifications. +" Parts of this file may be copyrighted by others as noted. +" CVS: $Id: brackets.vim 997 2006-03-20 09:45:45Z srinathava $ +" Description: +" This ftplugin provides the following maps: +" . <M-b> encloses the previous character in \mathbf{} +" . <M-c> is polymorphic as follows: +" Insert mode: +" 1. If the previous character is a letter or number, then capitalize it and +" enclose it in \mathcal{} +" 2. otherwise insert \cite{} +" Visual Mode: +" 1. Enclose selection in \mathcal{} +" . <M-l> is also polymorphic as follows: +" If the character before typing <M-l> is one of '([{|<q', then do the +" following: +" 1. (<M-l> \left(\right +" similarly for [, | +" {<M-l> \left\{\right\} +" 2. <<M-l> \langle\rangle +" 3. q<M-l> \lefteqn{} +" otherwise insert \label{} +" . <M-i> inserts \item commands at the current cursor location depending on +" the surrounding environment. For example, inside itemize, it will +" insert a simple \item, but within a description, it will insert +" \item[<+label+>] etc. +" +" These functions make it extremeley easy to do all the \left \right stuff in +" latex. +" ============================================================================== + +" Avoid reinclusion. +if exists('b:did_brackets') + finish +endif +let b:did_brackets = 1 + +" define the funtions only once. +if exists('*Tex_MathBF') + finish +endif + +" Tex_MathBF: encloses te previous letter/number in \mathbf{} {{{ +" Description: +function! Tex_MathBF() + return "\<Left>\\mathbf{\<Right>}" +endfunction " }}} +" Tex_MathCal: enclose the previous letter/number in \mathcal {{{ +" Description: +" if the last character is not a letter/number, then insert \cite{} +function! Tex_MathCal() + let line = getline(line(".")) + let char = line[col(".")-2] + + if char =~ '[a-zA-Z0-9]' + return "\<BS>".'\mathcal{'.toupper(char).'}' + else + return IMAP_PutTextWithMovement('\cite{<++>}<++>') + endif +endfunction +" }}} +" Tex_LeftRight: maps <M-l> in insert mode. {{{ +" Description: +" This is a polymorphic function, which maps the behaviour of <M-l> in the +" following way: +" If the character before typing <M-l> is one of '([{|<q', then do the +" following: +" 1. (<M-l> \left(<++>\right<++> +" similarly for [, | +" {<M-l> \left\{<++>\right\}<++> +" 2. <<M-l> \langle<++>\rangle<++> +" 3. q<M-l> \lefteqn{<++>}<++> +" otherwise insert \label{<++>}<++> +function! Tex_LeftRight() + let line = getline(line(".")) + let char = line[col(".")-2] + let previous = line[col(".")-3] + + let matchedbrackets = '()[]{}||' + if char =~ '(\|\[\|{\||' + let add = '' + if char =~ '{' + let add = "\\" + endif + let rhs = matchstr(matchedbrackets, char.'\zs.\ze') + return "\<BS>".IMAP_PutTextWithMovement('\left'.add.char.'<++>\right'.add.rhs.'<++>') + elseif char == '<' + return "\<BS>".IMAP_PutTextWithMovement('langle<++>\rangle<++>') + elseif char == 'q' + return "\<BS>".IMAP_PutTextWithMovement('\lefteqn{<++>}<++>') + else + return IMAP_PutTextWithMovement('\label{<++>}<++>') + endif +endfunction " }}} +" Tex_PutLeftRight: maps <M-l> in normal mode {{{ +" Description: +" Put \left...\right in front of the matched brackets. +function! Tex_PutLeftRight() + let previous = getline(line("."))[col(".") - 2] + let char = getline(line("."))[col(".") - 1] + if previous == '\' + if char == '{' + exe "normal ileft\\\<Esc>l%iright\\\<Esc>l%" + elseif char == '}' + exe "normal iright\\\<Esc>l%ileft\\\<Esc>l%" + endif + elseif char =~ '\[\|(' + exe "normal i\\left\<Esc>l%i\\right\<Esc>l%" + elseif char =~ '\]\|)' + exe "normal i\\right\<Esc>l%i\\left\<Esc>l%" + endif +endfunction " }}} + +" Provide <plug>'d mapping for easy user customization. {{{ +inoremap <silent> <Plug>Tex_MathBF <C-r>=Tex_MathBF()<CR> +inoremap <silent> <Plug>Tex_MathCal <C-r>=Tex_MathCal()<CR> +inoremap <silent> <Plug>Tex_LeftRight <C-r>=Tex_LeftRight()<CR> +vnoremap <silent> <Plug>Tex_MathBF <C-C>`>a}<Esc>`<i\mathbf{<Esc> +vnoremap <silent> <Plug>Tex_MathCal <C-C>`>a}<Esc>`<i\mathcal{<Esc> +nnoremap <silent> <Plug>Tex_LeftRight :call Tex_PutLeftRight()<CR> + +" }}} +" Tex_SetBracketingMaps: create mappings for the current buffer {{{ +function! <SID>Tex_SetBracketingMaps() + + call Tex_MakeMap('<M-b>', '<Plug>Tex_MathBF', 'i', '<buffer> <silent>') + call Tex_MakeMap('<M-c>', '<Plug>Tex_MathCal', 'i', '<buffer> <silent>') + call Tex_MakeMap('<M-l>', '<Plug>Tex_LeftRight', 'i', '<buffer> <silent>') + call Tex_MakeMap('<M-b>', '<Plug>Tex_MathBF', 'v', '<buffer> <silent>') + call Tex_MakeMap('<M-c>', '<Plug>Tex_MathCal', 'v', '<buffer> <silent>') + call Tex_MakeMap('<M-l>', '<Plug>Tex_LeftRight', 'n', '<buffer> <silent>') + +endfunction +" }}} + +augroup LatexSuite + au LatexSuite User LatexSuiteFileType + \ call Tex_Debug('brackets.vim: Catching LatexSuiteFileType event', 'brak') | + \ call <SID>Tex_SetBracketingMaps() +augroup END + +" vim:fdm=marker diff --git a/.vim/ftplugin/latex-suite/compiler.vim b/.vim/ftplugin/latex-suite/compiler.vim @@ -0,0 +1,871 @@ +"============================================================================= +" File: compiler.vim +" Author: Srinath Avadhanula +" Created: Tue Apr 23 05:00 PM 2002 PST +" +" Description: functions for compiling/viewing/searching latex documents +" CVS: $Id: compiler.vim 1109 2010-10-07 20:19:23Z tmaas $ +"============================================================================= + +" Tex_SetTeXCompilerTarget: sets the 'target' for the next call to Tex_RunLaTeX() {{{ +function! Tex_SetTeXCompilerTarget(type, target) + call Tex_Debug("+Tex_SetTeXCompilerTarget: setting target to [".a:target."] for ".a:type."r", "comp") + + if a:target == '' + let target = Tex_GetVarValue('Tex_DefaultTargetFormat') + let target = input('Enter the target format for '.a:type.'r: ', target) + else + let target = a:target + endif + if target == '' + let target = 'dvi' + endif + + let targetRule = Tex_GetVarValue('Tex_'.a:type.'Rule_'.target) + + if targetRule != '' + if a:type == 'Compile' + let &l:makeprg = escape(targetRule, Tex_GetVarValue('Tex_EscapeChars')) + elseif a:type == 'View' + let s:viewer = targetRule + endif + let s:target = target + + elseif Tex_GetVarValue('Tex_'.a:type.'RuleComplete_'.target) != '' + let s:target = target + + elseif a:type == 'View' && has('macunix') + " On the mac, we can have empty view rules, so do not complain when + " both Tex_ViewRule_target and Tex_ViewRuleComplete_target are + " empty. On other platforms, we will complain... see below. + let s:target = target + + else + let s:origdir = fnameescape(getcwd()) + exe 'cd '.fnameescape(expand('%:p:h')) + if !Tex_GetVarValue('Tex_UseMakefile') || (glob('makefile*') == '' && glob('Makefile*') == '') + if has('gui_running') + call confirm( + \'No '.a:type.' rule defined for target '.target."\n". + \'Please specify a rule in $VIMRUNTIME/ftplugin/tex/texrc'."\n". + \' :help Tex_'.a:type.'Rule_format'."\n". + \'for more information', + \"&ok", 1, 'Warning') + else + call input( + \'No '.a:type.' rule defined for target '.target."\n". + \'Please specify a rule in $VIMRUNTIME/ftplugin/tex/texrc'."\n". + \' :help Tex_'.a:type.'Rule_format'."\n". + \'for more information' + \) + endif + else + echomsg 'Assuming target is for makefile' + let s:target = target + endif + exe 'cd '.s:origdir + endif +endfunction + +function! SetTeXTarget(...) + if a:0 < 1 + let target = Tex_GetVarValue('Tex_DefaultTargetFormat') + let target = input('Enter the target format for compiler and viewer: ', target) + else + let target = a:1 + endif + if target == '' + let target = 'dvi' + endif + + call Tex_SetTeXCompilerTarget('Compile', target) + call Tex_SetTeXCompilerTarget('View', target) +endfunction + +com! -nargs=1 TCTarget :call Tex_SetTeXCompilerTarget('Compile', <f-args>) +com! -nargs=1 TVTarget :call Tex_SetTeXCompilerTarget('View', <f-args>) +com! -nargs=? TTarget :call SetTeXTarget(<f-args>) + +" }}} +" Tex_CompileLatex: compiles the present file. {{{ +" Description: +function! Tex_CompileLatex() + if &ft != 'tex' + echo "calling Tex_RunLaTeX from a non-tex file" + return + end + + " close any preview windows left open. + pclose! + + let s:origdir = fnameescape(getcwd()) + + " Find the main file corresponding to this file. Always cd to the + " directory containing the file to avoid problems with the directory + " containing spaces. + " Latex on linux seems to be unable to handle file names with spaces at + " all! Therefore for the moment, do not attempt to handle spaces in the + " file name. + if exists('b:fragmentFile') + let mainfname = expand('%:p:t') + call Tex_CD(expand('%:p:h')) + else + let mainfname = Tex_GetMainFileName(':p:t') + call Tex_CD(Tex_GetMainFileName(':p:h')) + end + + call Tex_Debug('Tex_CompileLatex: getting mainfname = ['.mainfname.'] from Tex_GetMainFileName', 'comp') + + " if a makefile exists and the user wants to use it, then use that + " irrespective of whether *.latexmain exists or not. mainfname is still + " extracted from *.latexmain (if possible) log file name depends on the + " main file which will be compiled. + if Tex_GetVarValue('Tex_UseMakefile') && (glob('makefile') != '' || glob('Makefile') != '') + let _makeprg = &l:makeprg + call Tex_Debug("Tex_CompileLatex: using the makefile in the current directory", "comp") + let &l:makeprg = 'make $*' + if exists('s:target') + call Tex_Debug('Tex_CompileLatex: execing [make! '.s:target.']', 'comp') + exec 'make! '.s:target + else + call Tex_Debug('Tex_CompileLatex: execing [make!]', 'comp') + exec 'make!' + endif + let &l:makeprg = _makeprg + else + " If &makeprg has something like "$*.ps", it means that it wants the + " file-name without the extension... Therefore remove it. + if &makeprg =~ '\$\*\.\w\+' + let mainfname = fnamemodify(mainfname, ':r') + endif + call Tex_Debug('Tex_CompileLatex: execing [make! '.mainfname.']', 'comp') + exec 'make! '.mainfname + endif + redraw! + + exe 'cd '.s:origdir +endfunction " }}} +" Tex_RunLaTeX: compilation function {{{ +" this function runs the latex command on the currently open file. often times +" the file being currently edited is only a fragment being \input'ed into some +" master tex file. in this case, make a file called mainfile.latexmain in the +" directory containig the file. in other words, if the current file is +" ~/thesis/chapter.tex +" so that doing "latex chapter.tex" doesnt make sense, then make a file called +" main.tex.latexmain +" in the ~/thesis directory. this will then run "latex main.tex" when +" Tex_RunLaTeX() is called. +function! Tex_RunLaTeX() + call Tex_Debug('+Tex_RunLaTeX, b:fragmentFile = '.exists('b:fragmentFile'), 'comp') + + let dir = expand("%:p:h").'/' + let s:origdir = fnameescape(getcwd()) + call Tex_CD(expand("%:p:h")) + + let initTarget = s:target + + " first get the dependency chain of this format. + call Tex_Debug("Tex_RunLaTeX: compiling to target [".s:target."]", "comp") + + if Tex_GetVarValue('Tex_FormatDependency_'.s:target) != '' + let dependency = Tex_GetVarValue('Tex_FormatDependency_'.s:target) + if dependency !~ ','.s:target.'$' + let dependency = dependency.','.s:target + endif + else + let dependency = s:target + endif + + call Tex_Debug('Tex_RunLaTeX: getting dependency chain = ['.dependency.']', 'comp') + + " now compile to the final target format via each dependency. + let i = 1 + while Tex_Strntok(dependency, ',', i) != '' + let s:target = Tex_Strntok(dependency, ',', i) + + call Tex_SetTeXCompilerTarget('Compile', s:target) + call Tex_Debug('Tex_RunLaTeX: setting target to '.s:target, 'comp') + + if Tex_GetVarValue('Tex_MultipleCompileFormats') =~ '\<'.s:target.'\>' + call Tex_Debug("Tex_RunLaTeX: compiling file multiple times via Tex_CompileMultipleTimes", "comp") + call Tex_CompileMultipleTimes() + else + call Tex_Debug("Tex_RunLaTeX: compiling file once via Tex_CompileLatex", "comp") + call Tex_CompileLatex() + endif + + let errlist = Tex_GetErrorList() + call Tex_Debug("Tex_RunLaTeX: errlist = [".errlist."]", "comp") + + " If there are any errors, then break from the rest of the steps + if errlist =~ '\v(error|warning)' + call Tex_Debug('Tex_RunLaTeX: There were errors in compiling, breaking chain...', 'comp') + break + endif + + let i = i + 1 + endwhile + + let s:target = initTarget + let s:origwinnum = winnr() + call Tex_SetupErrorWindow() + + exe 'cd '.s:origdir + call Tex_Debug("-Tex_RunLaTeX", "comp") +endfunction + +" }}} +" Tex_ViewLaTeX: opens viewer {{{ +" Description: opens the DVI viewer for the file being currently edited. +" Again, if the current file is a \input in a master file, see text above +" Tex_RunLaTeX() to see how to set this information. +function! Tex_ViewLaTeX() + if &ft != 'tex' + echo "calling Tex_ViewLaTeX from a non-tex file" + return + end + + let s:origdir = fnameescape(getcwd()) + + " If b:fragmentFile is set, it means this file was compiled as a fragment + " using Tex_PartCompile, which means that we want to ignore any + " *.latexmain or makefile's. + if !exists('b:fragmentFile') + " cd to the location of the file to avoid having to deal with spaces + " in the directory name. + let mainfname = Tex_GetMainFileName(':p:t:r') + call Tex_CD(Tex_GetMainFileName(':p:h')) + else + let mainfname = expand("%:p:t:r") + call Tex_CD(expand("%:p:h")) + endif + + if Tex_GetVarValue('Tex_ViewRuleComplete_'.s:target) != '' + + let execString = Tex_GetVarValue('Tex_ViewRuleComplete_'.s:target) + let execString = substitute(execString, '{v:servername}', v:servername, 'g') + + elseif has('win32') + " unfortunately, yap does not allow the specification of an external + " editor from the command line. that would have really helped ensure + " that this particular vim and yap are connected. + let execString = 'start '.s:viewer.' "$*.'.s:target.'"' + + elseif (has('macunix') && Tex_GetVarValue('Tex_TreatMacViewerAsUNIX') != 1) + + if strlen(s:viewer) + let appOpt = '-a ' + else + let appOpt = '' + endif + let execString = 'open '.appOpt.s:viewer.' $*.'.s:target + + else + " taken from Dimitri Antoniou's tip on vim.sf.net (tip #225). + " slight change to actually use the current servername instead of + " hardcoding it as xdvi. + " Using an option for specifying the editor in the command line + " because that seems to not work on older bash'es. + if s:target == 'dvi' + + if Tex_GetVarValue('Tex_UseEditorSettingInDVIViewer') == 1 && + \ v:servername != '' && + \ (s:viewer == "xdvi" || s:viewer == "xdvik") + + let execString = s:viewer.' -editor "gvim --servername '.v:servername. + \ ' --remote-silent +\%l \%f" $*.dvi' + + elseif Tex_GetVarValue('Tex_UseEditorSettingInDVIViewer') == 1 && + \ s:viewer == "kdvi" + + let execString = 'kdvi --unique $*.dvi' + + else + + let execString = s:viewer.' $*.dvi' + + endif + + else + + let execString = s:viewer.' $*.'.s:target + + endif + + if( Tex_GetVarValue('Tex_ExecuteUNIXViewerInForeground') != 1 ) + let execString = execString.' &' + endif + + end + + let execString = substitute(execString, '\V$*', mainfname, 'g') + call Tex_Debug("Tex_ViewLaTeX: execString = ".execString, "comp") + + exec 'silent! !'.execString + + if !has('gui_running') + redraw! + endif + + exe 'cd '.s:origdir +endfunction + +" }}} +" Tex_ForwardSearchLaTeX: searches for current location in dvi file. {{{ +" Description: if the DVI viewer is compatible, then take the viewer to that +" position in the dvi file. see docs for Tex_RunLaTeX() to set a +" master file if this is an \input'ed file. +" Tip: With YAP on Windows, it is possible to do forward and inverse searches +" on DVI files. to do forward search, you'll have to compile the file +" with the --src-specials option. then set the following as the command +" line in the 'view/options/inverse search' dialog box: +" gvim --servername LATEX --remote-silent +%l "%f" +" For inverse search, if you are reading this, then just pressing \ls +" will work. +function! Tex_ForwardSearchLaTeX() + if &ft != 'tex' + echo "calling Tex_ForwardSeachLaTeX from a non-tex file" + return + end + + if Tex_GetVarValue('Tex_ViewRule_'.s:target) == '' + return + endif + let viewer = Tex_GetVarValue('Tex_ViewRule_'.s:target) + + let s:origdir = fnameescape(getcwd()) + + let mainfname = Tex_GetMainFileName(':t') + let mainfnameRoot = fnamemodify(Tex_GetMainFileName(), ':t:r') + let mainfnameFull = Tex_GetMainFileName(':p:r') + " cd to the location of the file to avoid problems with directory name + " containing spaces. + call Tex_CD(Tex_GetMainFileName(':p:h')) + + " inverse search tips taken from Dimitri Antoniou's tip and Benji Fisher's + " tips on vim.sf.net (vim.sf.net tip #225) + if (has('win32') && (viewer == "yap" || viewer == "YAP" || viewer == "Yap")) + + let execString = 'silent! !start '. viewer.' -s '.line('.').expand('%').' '.mainfnameRoot + + + elseif (has('macunix') && (viewer == "Skim" || viewer == "PDFView" || viewer == "TeXniscope")) + " We're on a Mac using a traditional Mac viewer + + if viewer == "Skim" + + let execString = 'silent! !/Applications/Skim.app/Contents/SharedSupport/displayline '. + \ line('.').' "'.mainfnameFull.'.'.s:target.'" "'.expand("%:p").'"' + + elseif viewer == "PDFView" + + let execString = 'silent! !/Applications/PDFView.app/Contents/MacOS/gotoline.sh '. + \ line('.').' "'.mainfnameFull.'.'.s:target.'" "'.expand("%:p").'"' + + elseif viewer == "TeXniscope" + + let execString = 'silent! !/Applications/TeXniscope.app/Contents/Resources/forward-search.sh '. + \ line('.').' "'.expand("%:p").'" "'.mainfnameFull.'.'.s:target.'"' + + endif + + else + " We're either UNIX or Mac and using a UNIX-type viewer + + " Check for the special DVI viewers first + if (viewer == "xdvi" || viewer == "xdvik" || viewer == "kdvi" ) + + if Tex_GetVarValue('Tex_UseEditorSettingInDVIViewer') == 1 && + \ exists('v:servername') && + \ (viewer == "xdvi" || viewer == "xdvik") + + let execString = 'silent! !'.viewer.' -name xdvi -sourceposition "'.line('.').' '.expand("%").'"'. + \ ' -editor "gvim --servername '.v:servername.' --remote-silent +\%l \%f" '. + \ mainfnameRoot.'.dvi' + + elseif viewer == "kdvi" + + let execString = 'silent! !kdvi --unique file:'.mainfnameRoot.'.dvi\#src:'.line('.').expand("%") + + elseif (viewer == "xdvi" || viewer == "xdvik" ) + + let execString = 'silent! !'.viewer.' -name xdvi -sourceposition "'.line('.').' '.expand("%").'" '.mainfnameRoot.'.dvi' + + endif + + else + " We must be using a generic UNIX viewer + " syntax is: viewer TARGET_FILE LINE_NUMBER SOURCE_FILE + + let execString = 'silent! !'.viewer.' "'.mainfnameRoot.'.'.s:target.'" '.line('.').' "'.expand('%').'"' + + endif + + " See if we should add &. On Mac (at least in MacVim), it seems + " like this should NOT be added... + if( Tex_GetVarValue('Tex_ExecuteUNIXViewerInForeground') != 1 ) + let execString = execString.' &' + endif + + endif + + call Tex_Debug("Tex_ForwardSearchLaTeX: execString = ".execString, "comp") + execute execString + if !has('gui_running') + redraw! + endif + + exe 'cd '.s:origdir +endfunction + +" }}} + +" ============================================================================== +" Functions for compiling parts of a file. +" ============================================================================== +" Tex_PartCompile: compiles selected fragment {{{ +" Description: creates a temporary file from the selected fragment of text +" prepending the preamble and \end{document} and then asks Tex_RunLaTeX() to +" compile it. +function! Tex_PartCompile() range + call Tex_Debug('+Tex_PartCompile', 'comp') + + " Get a temporary file in the same directory as the file from which + " fragment is being extracted. This is to enable the use of relative path + " names in the fragment. + let tmpfile = Tex_GetTempName(expand('%:p:h')) + + " Remember all the temp files and for each temp file created, remember + " where the temp file came from. + let s:Tex_NumTempFiles = (exists('s:Tex_NumTempFiles') ? s:Tex_NumTempFiles + 1 : 1) + let s:Tex_TempFiles = (exists('s:Tex_TempFiles') ? s:Tex_TempFiles : '') + \ . tmpfile."\n" + let s:Tex_TempFile_{s:Tex_NumTempFiles} = tmpfile + " TODO: For a function Tex_RestoreFragment which restores a temp file to + " its original location. + let s:Tex_TempFileOrig_{s:Tex_NumTempFiles} = expand('%:p') + let s:Tex_TempFileRange_{s:Tex_NumTempFiles} = a:firstline.','.a:lastline + + " Set up an autocmd to clean up the temp files when Vim exits. + if Tex_GetVarValue('Tex_RemoveTempFiles') + augroup RemoveTmpFiles + au! + au VimLeave * :call Tex_RemoveTempFiles() + augroup END + endif + + " If mainfile exists open it in tiny window and extract preamble there, + " otherwise do it from current file + let mainfile = Tex_GetMainFileName(":p") + exe 'bot 1 split '.escape(mainfile, ' ') + exe '1,/\s*\\begin{document}/w '.tmpfile + wincmd q + + exe a:firstline.','.a:lastline."w! >> ".tmpfile + + " edit the temporary file + exec 'drop '.tmpfile + + " append the \end{document} line. + $ put ='\end{document}' + w + + " set this as a fragment file. + let b:fragmentFile = 1 + + silent! call Tex_RunLaTeX() +endfunction " }}} +" Tex_RemoveTempFiles: cleans up temporary files created during part compilation {{{ +" Description: During part compilation, temporary files containing the +" visually selected text are created. These files need to be +" removed when Vim exits to avoid "file leakage". +function! Tex_RemoveTempFiles() + if !exists('s:Tex_NumTempFiles') || !Tex_GetVarValue('Tex_RemoveTempFiles') + return + endif + let i = 1 + while i <= s:Tex_NumTempFiles + let tmpfile = s:Tex_TempFile_{i} + " Remove the tmp file and all other associated files such as the + " .log files etc. + call Tex_DeleteFile(fnamemodify(tmpfile, ':p:r').'.*') + let i = i + 1 + endwhile +endfunction " }}} + +" ============================================================================== +" Compiling a file multiple times to resolve references/citations etc. +" ============================================================================== +" Tex_CompileMultipleTimes: The main function {{{ +" Description: compiles a file multiple times to get cross-references right. +function! Tex_CompileMultipleTimes() + " Just extract the root without any extension because we want to construct + " the log file names etc from it. + let s:origdir = fnameescape(getcwd()) + let mainFileName_root = Tex_GetMainFileName(':p:t:r') + call Tex_CD(Tex_GetMainFileName(':p:h')) + + " First ignore undefined references and the + " "rerun to get cross-references right" message from + " the compiler output. + let origlevel = Tex_GetVarValue('Tex_IgnoreLevel') + let origpats = Tex_GetVarValue('Tex_IgnoredWarnings') + + let g:Tex_IgnoredWarnings = g:Tex_IgnoredWarnings."\n" + \ . 'Reference %.%# undefined'."\n" + \ . 'Rerun to get cross-references right' + TCLevel 1000 + + let idxFileName = mainFileName_root.'.idx' + let auxFileName = mainFileName_root.'.aux' + + let runCount = 0 + let needToRerun = 1 + while needToRerun == 1 && runCount < 5 + " assume we need to run only once. + let needToRerun = 0 + + let idxlinesBefore = Tex_CatFile(idxFileName) + let auxlinesBefore = Tex_GetAuxFile(auxFileName) + + " first run latex. + echomsg "latex run number : ".(runCount+1) + call Tex_Debug("Tex_CompileMultipleTimes: latex run number : ".(runCount+1), "comp") + silent! call Tex_CompileLatex() + + " If there are errors in any latex compilation step, immediately + " return. For now, do not bother with warnings because those might go + " away after compiling again or after bibtex is run etc. + let errlist = Tex_GetErrorList() + call Tex_Debug("Tex_CompileMultipleTimes: errors = [".errlist."]", "comp") + + if errlist =~ 'error' + let g:Tex_IgnoredWarnings = origpats + exec 'TCLevel '.origlevel + + return + endif + + let idxlinesAfter = Tex_CatFile(idxFileName) + + " If .idx file changed, then run makeindex to generate the new .ind + " file and remember to rerun latex. + if runCount == 0 && glob(idxFileName) != '' && idxlinesBefore != idxlinesAfter + echomsg "Running makeindex..." + let temp_mp = &mp | let &mp = Tex_GetVarValue('Tex_MakeIndexFlavor') + exec 'silent! make '.mainFileName_root + let &mp = temp_mp + + let needToRerun = 1 + endif + + " The first time we see if we need to run bibtex and if the .bbl file + " changes, we will rerun latex. + if runCount == 0 && Tex_IsPresentInFile('\\bibdata', mainFileName_root.'.aux') + let bibFileName = mainFileName_root.'.bbl' + + let biblinesBefore = Tex_CatFile(bibFileName) + + echomsg "Running '".Tex_GetVarValue('Tex_BibtexFlavor')."' ..." + let temp_mp = &mp | let &mp = Tex_GetVarValue('Tex_BibtexFlavor') + exec 'silent! make '.mainFileName_root + let &mp = temp_mp + + let biblinesAfter = Tex_CatFile(bibFileName) + + " If the .bbl file changed after running bibtex, we need to + " latex again. + if biblinesAfter != biblinesBefore + echomsg 'Need to rerun because bibliography file changed...' + call Tex_Debug('Tex_CompileMultipleTimes: Need to rerun because bibliography file changed...', 'comp') + let needToRerun = 1 + endif + endif + + " check if latex asks us to rerun + let auxlinesAfter = Tex_GetAuxFile(auxFileName) + if auxlinesAfter != auxlinesBefore + echomsg "Need to rerun because the AUX file changed..." + call Tex_Debug("Tex_CompileMultipleTimes: Need to rerun to get cross-references right...", 'comp') + let needToRerun = 1 + endif + + let runCount = runCount + 1 + endwhile + + redraw! + call Tex_Debug("Tex_CompileMultipleTimes: Ran latex ".runCount." time(s)", "comp") + echomsg "Ran latex ".runCount." time(s)" + + let g:Tex_IgnoredWarnings = origpats + exec 'TCLevel '.origlevel + " After all compiler calls are done, reparse the .log file for + " errors/warnings to handle the situation where the clist might have been + " emptied because of bibtex/makeindex being run as the last step. + exec 'silent! cfile '.mainFileName_root.'.log' + + exe 'cd '.s:origdir +endfunction " }}} +" Tex_GetAuxFile: get the contents of the AUX file {{{ +" Description: get the contents of the AUX file recursively including any +" @\input'ted AUX files. +function! Tex_GetAuxFile(auxFile) + if !filereadable(a:auxFile) + return '' + endif + + let auxContents = Tex_CatFile(a:auxFile) + let pattern = '@\input{\(.\{-}\)}' + + let auxContents = substitute(auxContents, pattern, '\=Tex_GetAuxFile(submatch(1))', 'g') + + return auxContents +endfunction " }}} + +" ============================================================================== +" Helper functions for +" . viewing the log file in preview mode. +" . syncing the display between the quickfix window and preview window +" . going to the correct line _and column_ number from from the quick fix +" window. +" ============================================================================== +" Tex_SetupErrorWindow: sets up the cwindow and preview of the .log file {{{ +" Description: +function! Tex_SetupErrorWindow() + let mainfname = Tex_GetMainFileName() + + let winnum = winnr() + + " close the quickfix window before trying to open it again, otherwise + " whether or not we end up in the quickfix window after the :cwindow + " command is not fixed. + cclose + cwindow + " create log file name from mainfname + let mfnlog = fnamemodify(mainfname, ":t:r").'.log' + call Tex_Debug('Tex_SetupErrorWindow: mfnlog = '.mfnlog, 'comp') + " if we moved to a different window, then it means we had some errors. + if winnum != winnr() + if Tex_GetVarValue('Tex_ShowErrorContext') + call Tex_UpdatePreviewWindow(mfnlog) + exe 'nnoremap <buffer> <silent> j j:call Tex_UpdatePreviewWindow("'.mfnlog.'")<CR>' + exe 'nnoremap <buffer> <silent> k k:call Tex_UpdatePreviewWindow("'.mfnlog.'")<CR>' + exe 'nnoremap <buffer> <silent> <up> <up>:call Tex_UpdatePreviewWindow("'.mfnlog.'")<CR>' + exe 'nnoremap <buffer> <silent> <down> <down>:call Tex_UpdatePreviewWindow("'.mfnlog.'")<CR>' + endif + exe 'nnoremap <buffer> <silent> <enter> :call Tex_GotoErrorLocation("'.mfnlog.'")<CR>' + + setlocal nowrap + + " resize the window to just fit in with the number of lines. + exec ( line('$') < 4 ? line('$') : 4 ).' wincmd _' + if Tex_GetVarValue('Tex_GotoError') == 1 + call Tex_GotoErrorLocation(mfnlog) + else + exec s:origwinnum.' wincmd w' + endif + endif + +endfunction " }}} +" Tex_PositionPreviewWindow: positions the preview window correctly. {{{ +" Description: +" The purpose of this function is to count the number of times an error +" occurs on the same line. or in other words, if the current line is +" something like |10 error|, then we want to count the number of +" lines in the quickfix window before this line which also contain lines +" like |10 error|. +" +function! Tex_PositionPreviewWindow(filename) + + if getline('.') !~ '|\d\+ \(error\|warning\)|' + if !search('|\d\+ \(error\|warning\)|') + call Tex_Debug("not finding error pattern anywhere in quickfix window :".bufname(bufnr('%')), + \ 'comp') + pclose! + return + endif + endif + + " extract the error pattern (something like 'file.tex|10 error|') on the + " current line. + let errpat = matchstr(getline('.'), '^\f*|\d\+ \(error\|warning\)|\ze') + let errfile = matchstr(getline('.'), '^\f*\ze|\d\+ \(error\|warning\)|') + " extract the line number from the error pattern. + let linenum = matchstr(getline('.'), '|\zs\d\+\ze \(error\|warning\)|') + + " if we are on an error, then count the number of lines before this in the + " quickfix window with an error on the same line. + if errpat =~ 'error|$' + " our location in the quick fix window. + let errline = line('.') + + " goto the beginning of the quickfix window and begin counting the lines + " which show an error on the same line. + 0 + let numrep = 0 + while 1 + " if we are on the same kind of error line, then means we have another + " line containing the same error pattern. + if getline('.') =~ errpat + let numrep = numrep + 1 + normal! 0 + endif + " if we have reached the original location in the quick fix window, + " then break. + if line('.') == errline + break + else + " otherwise, search for the next line which contains the same + " error pattern again. goto the end of the current line so we + " dont count this line again. + normal! $ + call search(errpat, 'W') + endif + endwhile + else + let numrep = 1 + endif + + if getline('.') =~ '|\d\+ warning|' + let searchpat = escape(matchstr(getline('.'), '|\d\+ warning|\s*\zs.*'), '\ ') + else + let searchpat = 'l\.'.linenum + endif + + " We first need to be in the scope of the correct file in the .log file. + " This is important for example, when a.tex and b.tex both have errors on + " line 9 of the file and we want to go to the error of b.tex. Merely + " searching forward from the beginning of the log file for l.9 will always + " land us on the error in a.tex. + if errfile != '' + exec 'silent! bot pedit +/(\\(\\f\\|\\[\\|\]\\|\\s\\)*'.errfile.'/ '.a:filename + else + exec 'bot pedit +0 '.a:filename + endif + " Goto the preview window + " TODO: This is not robust enough. Check that a wincmd j actually takes + " us to the preview window. + wincmd j + " now search forward from this position in the preview window for the + " numrep^th error of the current line in the quickfix window. + while numrep > 0 + call search(searchpat, 'W') + let numrep = numrep - 1 + endwhile + normal! z. + +endfunction " }}} +" Tex_UpdatePreviewWindow: updates the view of the log file {{{ +" Description: +" This function should be called when focus is in a quickfix window. +" It opens the log file in a preview window and makes it display that +" part of the log file which corresponds to the error which the user is +" currently on in the quickfix window. Control returns to the quickfix +" window when the function returns. +" +function! Tex_UpdatePreviewWindow(filename) + call Tex_PositionPreviewWindow(a:filename) + + if &previewwindow + 6 wincmd _ + wincmd p + endif +endfunction " }}} +" Tex_GotoErrorLocation: goes to the correct location of error in the tex file {{{ +" Description: +" This function should be called when focus is in a quickfix window. This +" function will first open the preview window of the log file (if it is not +" already open), position the display of the preview to coincide with the +" current error under the cursor and then take the user to the file in +" which this error has occured. +" +" The position is both the correct line number and the column number. +function! Tex_GotoErrorLocation(filename) + + " first use vim's functionality to take us to the location of the error + " accurate to the line (not column). This lets us go to the correct file + " without applying any logic. + exec "normal! \<enter>" + " If the log file is not found, then going to the correct line number is + " all we can do. + if glob(a:filename) == '' + return + endif + + let winnum = winnr() + " then come back to the quickfix window + wincmd w + + " find out where in the file we had the error. + let linenum = matchstr(getline('.'), '|\zs\d\+\ze \(warning\|error\)|') + call Tex_PositionPreviewWindow(a:filename) + + if getline('.') =~ 'l.\d\+' + + let brokenline = matchstr(getline('.'), 'l.'.linenum.' \zs.*\ze') + " If the line is of the form + " l.10 ...and then there was some error + " it means (most probably) that only part of the erroneous line is + " shown. In this case, finding the length of the broken line is not + " correct. Instead goto the beginning of the line and search forward + " for the part which is displayed and then go to its end. + if brokenline =~ '^\M...' + let partline = matchstr(brokenline, '^\M...\m\zs.*') + let normcmd = "0/\\V".escape(partline, "\\")."/e+1\<CR>" + else + let column = strlen(brokenline) + 1 + let normcmd = column.'|' + endif + + elseif getline('.') =~ 'LaTeX Warning: \(Citation\|Reference\) `.*' + + let ref = matchstr(getline('.'), "LaTeX Warning: \\(Citation\\|Reference\\) `\\zs[^']\\+\\ze'") + let normcmd = '0/'.ref."\<CR>" + + else + + let normcmd = '0' + + endif + + " go back to the window where we came from. + exec winnum.' wincmd w' + exec 'silent! '.linenum.' | normal! '.normcmd + + if !Tex_GetVarValue('Tex_ShowErrorContext') + pclose! + endif +endfunction " }}} +" Tex_SetCompilerMaps: sets maps for compiling/viewing/searching {{{ +" Description: +function! <SID>Tex_SetCompilerMaps() + if exists('b:Tex_doneCompilerMaps') + return + endif + let s:ml = '<Leader>' + + nnoremap <buffer> <Plug>Tex_Compile :call Tex_RunLaTeX()<cr> + vnoremap <buffer> <Plug>Tex_Compile :call Tex_PartCompile()<cr> + nnoremap <buffer> <Plug>Tex_View :call Tex_ViewLaTeX()<cr> + nnoremap <buffer> <Plug>Tex_ForwardSearch :call Tex_ForwardSearchLaTeX()<cr> + + call Tex_MakeMap(s:ml."ll", "<Plug>Tex_Compile", 'n', '<buffer>') + call Tex_MakeMap(s:ml."ll", "<Plug>Tex_Compile", 'v', '<buffer>') + call Tex_MakeMap(s:ml."lv", "<Plug>Tex_View", 'n', '<buffer>') + call Tex_MakeMap(s:ml."ls", "<Plug>Tex_ForwardSearch", 'n', '<buffer>') +endfunction +" }}} + +augroup LatexSuite + au LatexSuite User LatexSuiteFileType + \ call Tex_Debug('compiler.vim: Catching LatexSuiteFileType event', 'comp') | + \ call <SID>Tex_SetCompilerMaps() +augroup END + +command! -nargs=0 -range=% TPartCompile :<line1>, <line2> silent! call Tex_PartCompile() +" Setting b:fragmentFile = 1 makes Tex_CompileLatex consider the present file +" the _main_ file irrespective of the presence of a .latexmain file. +command! -nargs=0 TCompileThis let b:fragmentFile = 1 +command! -nargs=0 TCompileMainFile let b:fragmentFile = 0 + +" vim:fdm=marker:ff=unix:noet:ts=4:sw=4 diff --git a/.vim/ftplugin/latex-suite/custommacros.vim b/.vim/ftplugin/latex-suite/custommacros.vim @@ -0,0 +1,256 @@ +"============================================================================= +" File: custommacros.vim +" Author: Mikolaj Machowski +" Version: 1.0 +" Created: Tue Apr 23 05:00 PM 2002 PST +" CVS: $Id: custommacros.vim 1013 2006-04-29 02:36:23Z srinathava $ +" +" Description: functions for processing custom macros in the +" latex-suite/macros directory +"============================================================================= + +let s:path = expand('<sfile>:p:h') + +" Set path to macros dir dependent on OS {{{ +if has("unix") || has("macunix") + let s:macrodirpath = $HOME."/.vim/ftplugin/latex-suite/macros/" +elseif has("win32") + if exists("$HOME") + let s:macrodirpath = $HOME."/vimfiles/ftplugin/latex-suite/macros/" + else + let s:macrodirpath = $VIM."/vimfiles/ftplugin/latex-suite/macros/" + endif +endif + +" }}} +" SetCustomMacrosMenu: sets up the menu for Macros {{{ +function! <SID>SetCustomMacrosMenu() + let flist = Tex_FindInRtp('', 'macros') + exe 'amenu '.g:Tex_MacrosMenuLocation.'&New :call <SID>NewMacro("FFFromMMMenu")<CR>' + exe 'amenu '.g:Tex_MacrosMenuLocation.'&Redraw :call RedrawMacro()<CR>' + + let i = 1 + while 1 + let fname = Tex_Strntok(flist, ',', i) + if fname == '' + break + endif + exe "amenu ".g:Tex_MacrosMenuLocation."&Delete.&".i.":<tab>".fname." :call <SID>DeleteMacro('".fname."')<CR>" + exe "amenu ".g:Tex_MacrosMenuLocation."&Edit.&".i.":<tab>".fname." :call <SID>EditMacro('".fname."')<CR>" + exe "imenu ".g:Tex_MacrosMenuLocation."&".i.":<tab>".fname." <C-r>=<SID>ReadMacro('".fname."')<CR>" + exe "nmenu ".g:Tex_MacrosMenuLocation."&".i.":<tab>".fname." i<C-r>=<SID>ReadMacro('".fname."')<CR>" + let i = i + 1 + endwhile +endfunction + +if g:Tex_Menus + call <SID>SetCustomMacrosMenu() +endif + +" }}} +" NewMacro: opens new file in macros directory {{{ +function! <SID>NewMacro(...) + " Allow for calling :TMacroNew without argument or from menu and prompt + " for name. + if a:0 > 0 + let newmacroname = a:1 + else + let newmacroname = input("Name of new macro: ") + if newmacroname == '' + return + endif + endif + + if newmacroname == "FFFromMMMenu" + " Check if NewMacro was called from menu and prompt for insert macro + " name + let newmacroname = input("Name of new macro: ") + if newmacroname == '' + return + endif + elseif Tex_FindInRtp(newmacroname, 'macros') != '' + " If macro with this name already exists, prompt for another name. + exe "echomsg 'Macro ".newmacroname." already exists. Try another name.'" + let newmacroname = input("Name of new macro: ") + if newmacroname == '' + return + endif + endif + exec 'split '.Tex_EscapeSpaces(s:macrodirpath.newmacroname) + setlocal filetype=tex +endfunction + +" }}} +" RedrawMacro: refreshes macro menu {{{ +function! RedrawMacro() + aunmenu TeX-Suite.Macros + call <SID>SetCustomMacrosMenu() +endfunction + +" }}} +" ChooseMacro: choose a macro file {{{ +" " Description: +function! s:ChooseMacro(ask) + let filelist = Tex_FindInRtp('', 'macros') + let filename = Tex_ChooseFromPrompt( + \ a:ask."\n" . + \ Tex_CreatePrompt(filelist, 2, ',') . + \ "\nEnter number or filename :", + \ filelist, ',') +endfunction + +" }}} +" DeleteMacro: deletes macro file {{{ +function! <SID>DeleteMacro(...) + if a:0 > 0 + let filename = a:1 + else + let filename = s:ChooseMacro('Choose a macro file for deletion :') + endif + + if !filereadable(s:macrodirpath.filename) + " When file is not in local directory decline to remove it. + call confirm('This file is not in your local directory: '.filename."\n". + \ 'It will not be deleted.' , '&OK', 1) + + else + let ch = confirm('Really delete '.filename.' ?', "&Yes\n&No", 2) + if ch == 1 + call delete(s:macrodirpath.filename) + endif + call RedrawMacro() + endif +endfunction + +" }}} +" EditMacro: edits macro file {{{ +function! <SID>EditMacro(...) + if a:0 > 0 + let filename = a:1 + else + let filename = s:ChooseMacro('Choose a macro file for insertion:') + endif + + if filereadable(s:macrodirpath.filename) + " If file exists in local directory open it. + exec 'split '.Tex_EscapeSpaces(s:macrodirpath.filename) + else + " But if file doesn't exist in local dir it probably is in user + " restricted area. Instead opening try to copy it to local dir. + " Pity VimL doesn't have mkdir() function :) + let ch = confirm("You are trying to edit file which is probably read-only.\n". + \ "It will be copied to your local LaTeX-Suite macros directory\n". + \ "and you will be operating on local copy with suffix -local.\n". + \ "It will succeed only if ftplugin/latex-suite/macros dir exists.\n". + \ "Do you agree?", "&Yes\n&No", 1) + if ch == 1 + " But there is possibility we already created local modification. + " Check it and offer opening this file. + if filereadable(s:macrodirpath.filename.'-local') + let ch = confirm('Local version of '.filename." already exists.\n". + \ 'Do you want to open it or overwrite with original version?', + \ "&Open\nOver&write\n&Cancel", 1) + if ch == 1 + exec 'split '.Tex_EscapeSpaces(s:macrodirpath.filename.'-local') + elseif ch == 2 + new + exe '0read '.Tex_FindInRtp(filename, 'macros') + " This is possible macro was edited before, wipe it out. + if bufexists(s:macrodirpath.filename.'-local') + exe 'bwipe '.s:macrodirpath.filename.'-local' + endif + exe 'write! '.s:macrodirpath.filename.'-local' + else + return + endif + else + " If file doesn't exist, open new file, read in system macro and + " save it in local macro dir with suffix -local + new + exe '0read '.Tex_FindInRtp(filename, 'macros') + exe 'write '.s:macrodirpath.filename.'-local' + endif + endif + + endif + setlocal filetype=tex +endfunction + +" }}} +" ReadMacro: reads in a macro from a macro file. {{{ +" allowing for placement via placeholders. +function! <SID>ReadMacro(...) + + if a:0 > 0 + let filename = a:1 + else + let filelist = Tex_FindInRtp('', 'macros') + let filename = + \ Tex_ChooseFromPrompt("Choose a macro file:\n" . + \ Tex_CreatePrompt(filelist, 2, ',') . + \ "\nEnter number or name of file :", + \ filelist, ',') + endif + + let fname = Tex_FindInRtp(filename, 'macros', ':p') + + let markerString = '<---- Latex Suite End Macro ---->' + let _a = @a + silent! call append(line('.'), markerString) + silent! exec "read ".fname + silent! exec "normal! V/^".markerString."$/-1\<CR>\"ax" + " This is kind of tricky: At this stage, we are one line after the one we + " started from with the marker text on it. We need to + " 1. remove the marker and the line. + " 2. get focus to the previous line. + " 3. not remove anything from the previous line. + silent! exec "normal! $v0k$\"_x" + + call Tex_CleanSearchHistory() + + let @a = substitute(@a, '['."\n\r\t ".']*$', '', '') + let textWithMovement = IMAP_PutTextWithMovement(@a) + let @a = _a + + return textWithMovement + +endfunction + +" }}} +" commands for macros {{{ +com! -nargs=? TMacroNew :call <SID>NewMacro(<f-args>) + +" This macros had to have 2 versions: +if v:version >= 602 + com! -complete=custom,Tex_CompleteMacroName -nargs=? TMacro + \ :let s:retVal = <SID>ReadMacro(<f-args>) <bar> normal! i<C-r>=s:retVal<CR> + com! -complete=custom,Tex_CompleteMacroName -nargs=? TMacroEdit + \ :call <SID>EditMacro(<f-args>) + com! -complete=custom,Tex_CompleteMacroName -nargs=? TMacroDelete + \ :call <SID>DeleteMacro(<f-args>) + + " Tex_CompleteMacroName: for completing names in TMacro... commands {{{ + " Description: get list of macro names with Tex_FindInRtp(), remove full path + " and return list of names separated with newlines. + " + function! Tex_CompleteMacroName(A,P,L) + " Get name of macros from all runtimepath directories + let macronames = Tex_FindInRtp('', 'macros') + " Separate names with \n not , + let macronames = substitute(macronames,',','\n','g') + return macronames + endfunction + + " }}} + +else + com! -nargs=? TMacro + \ :let s:retVal = <SID>ReadMacro(<f-args>) <bar> normal! i<C-r>=s:retVal<CR> + com! -nargs=? TMacroEdit :call <SID>EditMacro(<f-args>) + com! -nargs=? TMacroDelete :call <SID>DeleteMacro(<f-args>) + +endif + +" }}} + +" vim:fdm=marker:ff=unix:noet:ts=4:sw=4 diff --git a/.vim/ftplugin/latex-suite/diacritics.vim b/.vim/ftplugin/latex-suite/diacritics.vim @@ -0,0 +1,124 @@ +"============================================================================= +" File: diacritics.vim +" Author: Lubomir Host +" Created: Tue Apr 23 07:00 PM 2002 PST +" +" Description: shortcuts for all diacritics. +"============================================================================= + +if !g:Tex_Diacritics + finish +endif + +" \'{a} {{{ +call IMAP ('=a', "\\\'{a}", 'tex') +call IMAP ('=b', "\\'{b}", 'tex') +call IMAP ('=c', "\\'{c}", 'tex') +call IMAP ('=d', "\\'{d}", 'tex') +call IMAP ('=e', "\\'{e}", 'tex') +call IMAP ('=f', "\\'{f}", 'tex') +call IMAP ('=g', "\\'{g}", 'tex') +call IMAP ('=h', "\\'{h}", 'tex') +call IMAP ('=i', "\\'{\i}", 'tex') +call IMAP ('=j', "\\'{j}", 'tex') +call IMAP ('=k', "\\'{k}", 'tex') +call IMAP ('=l', "\\'{l}", 'tex') +call IMAP ('=m', "\\'{m}", 'tex') +call IMAP ('=n', "\\'{n}", 'tex') +call IMAP ('=o', "\\'{o}", 'tex') +call IMAP ('=p', "\\'{p}", 'tex') +call IMAP ('=q', "\\'{q}", 'tex') +call IMAP ('=r', "\\'{r}", 'tex') +call IMAP ('=s', "\\'{s}", 'tex') +call IMAP ('=t', "\\'{t}", 'tex') +call IMAP ('=u', "\\'{u}", 'tex') +call IMAP ('=v', "\\'{v}", 'tex') +call IMAP ('=w', "\\'{w}", 'tex') +call IMAP ('=x', "\\'{x}", 'tex') +call IMAP ('=y', "\\'{y}", 'tex') +call IMAP ('=z', "\\'{z}", 'tex') +call IMAP ('=A', "\\'{A}", 'tex') +call IMAP ('=B', "\\'{B}", 'tex') +call IMAP ('=C', "\\'{C}", 'tex') +call IMAP ('=D', "\\'{D}", 'tex') +call IMAP ('=E', "\\'{E}", 'tex') +call IMAP ('=F', "\\'{F}", 'tex') +call IMAP ('=G', "\\'{G}", 'tex') +call IMAP ('=H', "\\'{H}", 'tex') +call IMAP ('=I', "\\'{\I}", 'tex') +call IMAP ('=J', "\\'{J}", 'tex') +call IMAP ('=K', "\\'{K}", 'tex') +call IMAP ('=L', "\\'{L}", 'tex') +call IMAP ('=M', "\\'{M}", 'tex') +call IMAP ('=N', "\\'{N}", 'tex') +call IMAP ('=O', "\\'{O}", 'tex') +call IMAP ('=P', "\\'{P}", 'tex') +call IMAP ('=Q', "\\'{Q}", 'tex') +call IMAP ('=R', "\\'{R}", 'tex') +call IMAP ('=S', "\\'{S}", 'tex') +call IMAP ('=T', "\\'{T}", 'tex') +call IMAP ('=U', "\\'{U}", 'tex') +call IMAP ('=V', "\\'{V}", 'tex') +call IMAP ('=W', "\\'{W}", 'tex') +call IMAP ('=X', "\\'{X}", 'tex') +call IMAP ('=Y', "\\'{Y}", 'tex') +call IMAP ('=Z', "\\'{Z}", 'tex') +" }}} +" \v{a} {{{ +call IMAP ('+a', "\\v{a}", 'tex') +call IMAP ('+b', "\\v{b}", 'tex') +call IMAP ('+c', "\\v{c}", 'tex') +call IMAP ('+d', "\\v{d}", 'tex') +call IMAP ('+e', "\\v{e}", 'tex') +call IMAP ('+f', "\\v{f}", 'tex') +call IMAP ('+g', "\\v{g}", 'tex') +call IMAP ('+h', "\\v{h}", 'tex') +call IMAP ('+i', "\\v{\i}", 'tex') +call IMAP ('+j', "\\v{j}", 'tex') +call IMAP ('+k', "\\v{k}", 'tex') +call IMAP ('+l', "\\q l", 'tex') +call IMAP ('+m', "\\v{m}", 'tex') +call IMAP ('+n', "\\v{n}", 'tex') +call IMAP ('+o', "\\v{o}", 'tex') +call IMAP ('+p', "\\v{p}", 'tex') +call IMAP ('+q', "\\v{q}", 'tex') +call IMAP ('+r', "\\v{r}", 'tex') +call IMAP ('+s', "\\v{s}", 'tex') +call IMAP ('+t', "\\q t", 'tex') +call IMAP ('+u', "\\v{u}", 'tex') +call IMAP ('+v', "\\v{v}", 'tex') +call IMAP ('+w', "\\v{w}", 'tex') +call IMAP ('+x', "\\v{x}", 'tex') +call IMAP ('+y', "\\v{y}", 'tex') +call IMAP ('+z', "\\v{z}", 'tex') +call IMAP ('+A', "\\v{A}", 'tex') +call IMAP ('+B', "\\v{B}", 'tex') +call IMAP ('+C', "\\v{C}", 'tex') +call IMAP ('+D', "\\v{D}", 'tex') +call IMAP ('+E', "\\v{E}", 'tex') +call IMAP ('+F', "\\v{F}", 'tex') +call IMAP ('+G', "\\v{G}", 'tex') +call IMAP ('+H', "\\v{H}", 'tex') +call IMAP ('+I', "\\v{\I}", 'tex') +call IMAP ('+J', "\\v{J}", 'tex') +call IMAP ('+K', "\\v{K}", 'tex') +call IMAP ('+L', "\\v{L}", 'tex') +call IMAP ('+M', "\\v{M}", 'tex') +call IMAP ('+N', "\\v{N}", 'tex') +call IMAP ('+O', "\\v{O}", 'tex') +call IMAP ('+P', "\\v{P}", 'tex') +call IMAP ('+Q', "\\v{Q}", 'tex') +call IMAP ('+R', "\\v{R}", 'tex') +call IMAP ('+S', "\\v{S}", 'tex') +call IMAP ('+T', "\\v{T}", 'tex') +call IMAP ('+U', "\\v{U}", 'tex') +call IMAP ('+V', "\\v{V}", 'tex') +call IMAP ('+W', "\\v{W}", 'tex') +call IMAP ('+X', "\\v{X}", 'tex') +call IMAP ('+Y', "\\v{Y}", 'tex') +call IMAP ('+Z', "\\v{Z}", 'tex') +" }}} +call IMAP ('+}', "\\\"{a}", 'tex') +call IMAP ('+:', "\\^{o}", 'tex') + +" vim:fdm=marker:ff=unix:noet:ts=4:sw=4 diff --git a/.vim/ftplugin/latex-suite/dictionaries/SIunits b/.vim/ftplugin/latex-suite/dictionaries/SIunits @@ -0,0 +1,289 @@ +addprefix +addunit +ampere +amperemetresecond +amperepermetre +amperepermetrenp +amperepersquaremetre +amperepersquaremetrenp +angstrom +arad +arcminute +arcsecond +are +atomicmass +atto +attod +barn +bbar +becquerel +becquerelbase +bel +candela +candelapersquaremetre +candelapersquaremetrenp +celsius +Celsius +celsiusbase +centi +centid +coulomb +coulombbase +coulombpercubicmetre +coulombpercubicmetrenp +coulombperkilogram +coulombperkilogramnp +coulombpermol +coulombpermolnp +coulombpersquaremetre +coulombpersquaremetrenp +cubed +cubic +cubicmetre +cubicmetreperkilogram +cubicmetrepersecond +curie +dday +deca +decad +deci +decid +degree +degreecelsius +deka +dekad +derbecquerel +dercelsius +dercoulomb +derfarad +dergray +derhenry +derhertz +derjoule +derkatal +derlumen +derlux +dernewton +derohm +derpascal +derradian +dersiemens +dersievert +dersteradian +dertesla +dervolt +derwatt +derweber +electronvolt +exa +exad +farad +faradbase +faradpermetre +faradpermetrenp +femto +femtod +fourth +gal +giga +gigad +gram +graybase +graypersecond +graypersecondnp +hectare +hecto +hectod +henry +henrybase +henrypermetre +henrypermetrenp +hertz +hertzbase +hour +joule +joulebase +joulepercubicmetre +joulepercubicmetrenp +jouleperkelvin +jouleperkelvinnp +jouleperkilogram +jouleperkilogramkelvin +jouleperkilogramkelvinnp +jouleperkilogramnp +joulepermole +joulepermolekelvin +joulepermolekelvinnp +joulepermolenp +joulepersquaremetre +joulepersquaremetrenp +joulepertesla +jouleperteslanp +katal +katalbase +katalpercubicmetre +katalpercubicmetrenp +kelvin +kilo +kilod +kilogram +kilogrammetrepersecond +kilogrammetrepersecondnp +kilogrammetrepersquaresecond +kilogrammetrepersquaresecondnp +kilogrampercubicmetre +kilogrampercubicmetrecoulomb +kilogrampercubicmetrecoulombnp +kilogrampercubicmetrenp +kilogramperkilomole +kilogramperkilomolenp +kilogrampermetre +kilogrampermetrenp +kilogrampersecond +kilogrampersecondcubicmetre +kilogrampersecondcubicmetrenp +kilogrampersecondnp +kilogrampersquaremetre +kilogrampersquaremetrenp +kilogrampersquaremetresecond +kilogrampersquaremetresecondnp +kilogramsquaremetre +kilogramsquaremetrenp +kilogramsquaremetrepersecond +kilogramsquaremetrepersecondnp +kilowatthour +liter +litre +lumen +lumenbase +lux +luxbase +mega +megad +meter +metre +metrepersecond +metrepersecondnp +metrepersquaresecond +metrepersquaresecondnp +micro +microd +milli +millid +minute +mole +molepercubicmetre +molepercubicmetrenp +nano +nanod +neper +newton +newtonbase +newtonmetre +newtonpercubicmetre +newtonpercubicmetrenp +newtonperkilogram +newtonperkilogramnp +newtonpermetre +newtonpermetrenp +newtonpersquaremetre +newtonpersquaremetrenp +NoAMS +no@qsk +ohm +ohmbase +ohmmetre +one +paminute +pascal +pascalbase +pascalsecond +pasecond +per +period@active +persquaremetresecond +persquaremetresecondnp +peta +petad +pico +picod +power +@qsk +quantityskip +rad +radian +radianbase +radianpersecond +radianpersecondnp +radianpersquaresecond +radianpersquaresecondnp +reciprocal +rem +roentgen +rp +rpcubed +rpcubic +rpcubicmetreperkilogram +rpcubicmetrepersecond +rperminute +rpersecond +rpfourth +rpsquare +rpsquared +rpsquaremetreperkilogram +second +siemens +siemensbase +sievert +sievertbase +square +squared +squaremetre +squaremetrepercubicmetre +squaremetrepercubicmetrenp +squaremetrepercubicsecond +squaremetrepercubicsecondnp +squaremetreperkilogram +squaremetrepernewtonsecond +squaremetrepernewtonsecondnp +squaremetrepersecond +squaremetrepersecondnp +squaremetrepersquaresecond +squaremetrepersquaresecondnp +steradian +steradianbase +tera +terad +tesla +teslabase +ton +tonne +unit +unitskip +usk +volt +voltbase +voltpermetre +voltpermetrenp +watt +wattbase +wattpercubicmetre +wattpercubicmetrenp +wattperkilogram +wattperkilogramnp +wattpermetrekelvin +wattpermetrekelvinnp +wattpersquaremetre +wattpersquaremetrenp +wattpersquaremetresteradian +wattpersquaremetresteradiannp +weber +weberbase +yocto +yoctod +yotta +yottad +zepto +zeptod +zetta +zettad diff --git a/.vim/ftplugin/latex-suite/dictionaries/dictionary b/.vim/ftplugin/latex-suite/dictionaries/dictionary @@ -0,0 +1,677 @@ +abbrv +abovedisplayshortskip +abovedisplayskip +abstract +abstract +abstractname +acute +addcontentsline +address +addtime +addtocontents +addtocounter +addtolength +addvspace +align +alph +Alph +alpha +amsmath +amsthm +and +appendix +appendixname +arabic +array +arraycolsep +arrayrulewidth +arraystretch +article +author +a4paper +a5paper +backmatter +bar +bar +baselineskip +baselinestretch +batchmode +begin +belowdisplayshortskip +belowdisplayskip +bezier +bf +bfseries +bibindent +bibitem +bibliography +bibliographystyle +bibname +big +Big +Bigg +bigg +Biggl +biggl +Biggm +biggm +Biggr +biggr +Bigl +bigl +bigm +Bigm +bigr +Bigr +bigskip +bigskipamount +binom +blg +boldmath +boldsymbol +book +botfigrule +bottmofraction +bottomnumber +boxedminipage +bp +breve +b5paper +calc +calc +caption +caption2 +capt-of +cases +cc +ccaption +ccname +cdotscenter +centering +cercle +cfrac +changebar +chapter +chapterbib +chaptername +check +cite +cleardoublepage +clearpage +cline +clock +closing +cm +COLON +columnsep +columnseprule +columnwidth +contentsline +contentsname +copyright +dag +dashbox +date +dbinom +dblfigure +dblfloatpage +dblfloatsep +dbltextfloatsep +dbltopfraction +dbltopnumber +dcolumn +dd +ddag +ddot +ddots +DeclareMathOperator +depth +description +dfrac +displaylimits +displaymath +displaystyle +document +documentclass +dot +dotfill +doublerulesep +downbracefill +draft +dropping +dywiz +em +emph +empty +encl +enclname +end +endfloat +enlargethispage +enskip +enspace +ensuremath +enumerate +enumi +enumii +enumiii +enumiv +eqnarray +equation +errorstopmode +eucal +eufrak +evensidemargin +everyship +ex +executivepaper +expdlist +extracolsep +extramark +fancybox +fancyhdr +fbox +fboxrule +fboxsep +figure +figurename +file +filecontents +final +flafter +fleqn +floatflt +floatpagefraction +floatsep +flushbottom +flushleft +flushright +fnpara +fnsymbol +fn2end +fontenc +footheight +footmisc +footnote +footnotemark +footnoterule +footnotesep +footnotesize +footnotetext +footnpag +footskip +frac +frame +framebox +frenchspacing +frontmatter +ftnright +fussy +gather +genfrac +geometry +glossary +glossaryentry +graphicx +graphpaper +grave +hat +hbox +headheihgt +headings +headsep +height +helvet +hfill +hhline +hline +hrulefill +hspace +huge +Huge +HUGE +hyperref +hyphenation +ifthen +in +include +includeonly +indent +indentfirst +index +indexentry +indexname +indexspace +input +inputenc +intertext +intextsep +invisible +it +item +itemindent +itemize +itemsep +itshape +jot +kill +label +labelenumi +labelenumii +labelenumiii +labelenumiv +labelitemi +labelitemii +labelitemiii +labelitemiv +labelsep +labelwidth +landscape +large +LARGE +Large +LaTeX +LaTeXe +latexsym +ldots +left +leftarrowfill +lefteqn +leftmargin +leftmargini +leftmarginii +leftmarginiii +leftmarginiv +leftmarginv +leftmarginvi +leftmark +legalpaper +leq +leqno +letter +letterpaper +letterspace +lhead +limits +line +linebreak +linethickness +linewidth +list +listfigurename +listfiles +listoffigures +listoftables +listparindent +location +longtable +lq +lrbox +lscape +mainmatter +makeatletter +makeatother +makebox +makeglossary +makeidx +makeindex +makelabel +maketitle +manyfoot +marginpar +marginparpush +marginparsep +marginparwidth +markboth +markleft +markright +math +mathbb +mathbf +mathbin +mathcal +mathclose +mathfrak +mathindent +mathit +mathnormal +mathop +mathopen +mathord +mathpunct +mathrel +mathrm +mathscr +mathsf +mathstrut +mathtt +mathversion +mbox +mdseries +medmuskip +medskip +medskipamount +minipage +minitoc +minus +mkern +mm +moreverbatim +mpfootnote +mu +multicol +multicolumn +multilanguage +multiput +multirow +myheadings +nabla +name +NeedsTeXFormat +newcommand +newcounter +newenvironment +newfont +newlength +newline +newpage +newsavebox +newtheorem +nocite +nofiles +noindent +nolimits +nolinebreak +nomathsymbols +nonfrenchspacing +nonumber +nopagebreak +normalfont +normalsize +not +notag +note +notitlepage +nu +numberline +numline +numprint +oddsidemargin +oldstyle +onecolumn +oneside +onlynotes +onlyslides +openany +openbib +opening +openright +operatorname +oval +overbrace +overlay +overleftarrow +overline +overrightarrow +page +pagebreak +pagenumbering +pageref +pagestyle +paperheight +paperwidth +par +paragraph +parbox +parbox +parindent +parsep +parskip +part +partial +partname +partopsep +pauza +pc +phi +pi +picture +plain +PLdateending +plmath +PLSlash +plus +pmb +pmod +polski +polski +poptabs +pounds +ppauza +prefixing +printindex +protect +providecommand +ps +pt +pushtabs +put +qbezier +qbeziermax +qquad +quad +quotation +quote +raggedbottom +raggedleft +raggedright +ragged2e +raisebox +ratio +real +ref +refname +refstepcounter +relsize +renewcommand +renewenvironment +report +reversemarginpar +rhead +right +rightarrowfill +rightmargin +rightmark +rm +rmfamily +roman +Roman +rotate +rotating +rq +rule +samepage +savebox +sb +sbox +sc +scriptscriptstyle +scriptsize +scriptstyle +scrollmode +scshape +secnumdepth +section +sectionmark +see +seename +selectfont +selectlanguage +setcounter +setlength +settime +settodepth +settoheight +settowidth +sf +sffamily +shadethm +shadow +shapepar +shortstack +showlabels +sidecap +signature +sin +sl +slide +slides +sloppy +sloppybar +slshape +small +smallskip +smallskipamount +soul +sp +space +sqrt +ss +SS +stackrel +startbreaks +stepcounter +stop +stopbreaks +stretch +strut +subfigure +subfigure +subitem +subparagraph +subsection +subsubitem +subsubsection +sum +supressfloats +symbol +symbol +tabbing +tabcolsep +table +tablename +tableofcontents +tabular +tabularx +tag +tan +tbinom +telephone +TeX +textbf +textbullet +textcircled +textcompwordmark +textemdash +textendash +textexclamdown +textfloatsep +textfraction +textheight +textit +textmd +textnormal +textperiodcenter +textquestiondown +textquotedblleft +textquotedblright +textquoteleft +textquoteright +textrm +textsc +textsf +textsl +textstyle +textsuperscript +texttt +textup +textvisiblespace +textwidth +tfrac +thanks +the +thebibliography +theindex +theorem +thepage +thesection +theta +thicklines +thickmuskip +thinlines +thispagestyle +tilde +time +times +tiny +title +titlepage +tocdepth +today +topfigrule +topfraction +topmargin +topmargin +topmargin +topsep +topskip +topskip +totalheight +totalnumber +trivlist +tt +ttfamily +twocolumn +twocolumn +twoside +typein +typein +typeout +typeout +ulem +ulem +unboldmath +underbrace +underline +unsort +unsrt +upbracefill +upshape +upshape +usebox +usebox +usecounter +usefont +usepackage +value +vbox +vdots +vec +vector +verb +verb +verbatim +verse +vfill +visible +vline +vmargin +voffset +vspace +widehat +widetilde +width +wrapfig +xleftarrow +xrightarrow +threeparttable diff --git a/.vim/ftplugin/latex-suite/elementmacros.vim b/.vim/ftplugin/latex-suite/elementmacros.vim @@ -0,0 +1,330 @@ +"============================================================================= +" File: elementmacros.vim +" Author: Mikolaj Machowski +" Created: Tue Apr 23 06:00 PM 2002 PST +" +" Description: macros for dimensions/fonts/counters. +" and various common commands such ref/label/footnote. +"============================================================================= + +nmap <silent> <script> <plug> i +imap <silent> <script> <C-o><plug> <Nop> + +if exists('s:lastElementsLocation') && g:Tex_ElementsMenuLocation == s:lastElementsLocation + finish +endif + +if exists('s:lastElementsLocation') + exe 'aunmenu '.s:lastElementsLocation.'Font.' + exe 'aunmenu '.s:lastElementsLocation.'Dimension.' + exe 'aunmenu '.s:lastElementsLocation.'Counters.' + exe 'aunmenu '.s:lastElementsLocation.'Various.' +endif + +let s:lastElementsLocation = g:Tex_ElementsMenuLocation + +let s:fontMenuLoc = g:Tex_ElementsMenuLocation.'Font.' +let s:dimensionMenuLoc = g:Tex_ElementsMenuLocation.'Dimension.' +let s:counterMenuLoc = g:Tex_ElementsMenuLocation.'Counters.' +let s:variousMenuLoc = g:Tex_ElementsMenuLocation.'Various.' + +" ============================================================================== +" Set up the functions the first time. +" ============================================================================== +if !exists('s:definedFuncs') " {{{ + let s:definedFuncs = 1 + + " Tex_RemoveElementMenus: remove the elements menu {{{ + function! Tex_RemoveElementMenus() + exe 'silent! aunmenu '.s:lastElementsLocation.'Font.' + exe 'silent! aunmenu '.s:lastElementsLocation.'Dimension.' + exe 'silent! aunmenu '.s:lastElementsLocation.'Counters.' + exe 'silent! aunmenu '.s:lastElementsLocation.'Various.' + endfunction " }}} + " Tex_FontFamily: sets up font menus {{{ + function! <SID>Tex_FontFamily(font,fam) + let vislhs = matchstr(tolower(a:font), '^.\zs.*') + + " avoid redoing imaps and vmaps for every reconfiguration of menus. + if !exists('s:doneOnce') && g:Tex_FontMaps + exe "vnoremap <silent> ".g:Tex_Leader.vislhs. + \" \<C-\\>\<C-N>:call VEnclose('\\text".vislhs."{', '}', '{\\".vislhs.a:fam." ', '}')<CR>" + exe 'call IMAP ("'.a:font.'", "\\text'.vislhs.'{<++>}<++>", "tex")' + endif + + " menu entry. + if g:Tex_Menus && g:Tex_FontMenus + let location = s:fontMenuLoc.substitute(a:fam, '^.', '\u&', '').'.'.vislhs.a:fam.'<tab>'.a:font.'\ ('.g:Tex_Leader.vislhs.')' + exe "amenu ".location. + \" <plug><C-r>=IMAP_PutTextWithMovement('\\text".vislhs."{<++>}<++>')<CR>" + exe "vmenu ".location. + \" \<C-\\>\<C-N>:call VEnclose('\\text".vislhs."{', '}', '{\\".vislhs.a:fam." ', '}')<CR>" + endif + + endfunction " }}} + " Tex_FontDiacritics: sets up menus for diacritics. {{{ + function! <SID>Tex_FontDiacritics(name, rhs) + let location = s:fontMenuLoc.'&Diacritics.'.a:name.'<tab>' + exe 'amenu '.location. + \" <plug><C-r>=IMAP_PutTextWithMovement('\\".a:rhs."{<++>}<++>')<CR>" + exe 'vmenu '.location. + \" \<C-\\>\<C-n>:call VEnclose('\\".a:rhs."{', '}', '', '')<CR>" + endfunction " }}} + " Tex_FontSize: sets up size fonts {{{ + function! <SID>Tex_FontSize(name) + let location = s:fontMenuLoc.'&Size.'.a:name.'<tab>' + exe 'amenu '.location." <plug>\\".a:name + exe 'vunmenu '.location + endfunction " }}} + " Tex_Fontfont: sets up the 'font' part of font menus {{{ + function! <SID>Tex_Fontfont(desc, lhs) + let location = s:fontMenuLoc.'&font.'.a:desc.'<tab>' + exe "amenu ".location." <plug><C-r>=IMAP_PutTextWithMovement('".a:lhs."')<CR>" + exe "vunmenu ".location + endfunction " }}} + " Tex_DimMenus: set up dimension menus {{{ + function! <SID>Tex_DimMenus(submenu, rhs) + let location = s:dimensionMenuLoc.a:submenu.'.'.a:rhs.'<tab>' + exe "amenu ".location." <plug>\\".a:rhs + exe "vunmenu ".location + endfunction " }}} + " Tex_CounterMenus: set up counters menus {{{ + function! <SID>Tex_CounterMenus(submenu, rhs) + let location = s:counterMenuLoc.a:submenu.'.'.a:rhs.'<tab>' + exe "amenu ".location." <plug>\\".a:rhs + exe "vunmenu ".location + endfunction " }}} + " Tex_VariousMenus: set up various menus {{{ + function! <SID>Tex_VariousMenus(desc, lhs) + let location = s:variousMenuLoc.a:desc.'<tab>' + exe "amenu ".location." <plug><C-r>=IMAP_PutTextWithMovement('".a:lhs."')<CR>" + exe "vunmenu ".location + endfunction " }}} + +endif +" }}} + +" ============================================================================== +" Fonts +" ============================================================================== +" series/family/shape {{{ +call <SID>Tex_FontFamily("FBF","series") +call <SID>Tex_FontFamily("FMD","series") + +call <SID>Tex_FontFamily("FTT","family") +call <SID>Tex_FontFamily("FSF","family") +call <SID>Tex_FontFamily("FRM","family") + +call <SID>Tex_FontFamily("FUP","shape") +call <SID>Tex_FontFamily("FSL","shape") +call <SID>Tex_FontFamily("FSC","shape") +call <SID>Tex_FontFamily("FIT","shape") + +" the \emph is special. +if g:Tex_FontMaps | exe "vnoremap <silent> ".g:Tex_Leader."em \<C-\\>\<C-N>:call VEnclose('\\emph{', '}', '{\\em', '\\/}')<CR>" | endif +if g:Tex_FontMaps | exe 'call IMAP ("FEM", "\\emph{<++>}<++>", "tex")' | endif + +" }}} +if g:Tex_Menus && g:Tex_FontMenus + " {{{ diacritics + call <SID>Tex_FontDiacritics('Acute', '"') + call <SID>Tex_FontDiacritics('Breve', 'u') + call <SID>Tex_FontDiacritics('Circle', 'r') + call <SID>Tex_FontDiacritics('Circumflex', '^') + call <SID>Tex_FontDiacritics('Umlaut', '"') + call <SID>Tex_FontDiacritics('HUmlaut', 'H') + call <SID>Tex_FontDiacritics('Dot\ over', '.') + call <SID>Tex_FontDiacritics('Grave', '`') + call <SID>Tex_FontDiacritics('Hacek', 'v') + call <SID>Tex_FontDiacritics('Makron', '=') + call <SID>Tex_FontDiacritics('Tilde', '~') + call <SID>Tex_FontDiacritics('Underline', 'b') + call <SID>Tex_FontDiacritics('Cedille', 'c') + call <SID>Tex_FontDiacritics('Dot\ under', ' ') + call <SID>Tex_FontDiacritics('Ligature', 't') + " }}} + " {{{ Si&ze. + call <SID>Tex_FontSize('tiny') + call <SID>Tex_FontSize('scriptsize') + call <SID>Tex_FontSize('footnotesize') + call <SID>Tex_FontSize('small') + call <SID>Tex_FontSize('normalsize') + call <SID>Tex_FontSize('large') + call <SID>Tex_FontSize('Large') + call <SID>Tex_FontSize('LARGE') + call <SID>Tex_FontSize('huge') + call <SID>Tex_FontSize('Huge') + " }}} + " {{{ &font. + call s:Tex_Fontfont('fontencoding{}', '\fontencoding{<++>}<++>') + call s:Tex_Fontfont('fontfamily{qtm}', '\fontfamily{<++>}<++>') + call s:Tex_Fontfont('fontseries{m\ b\ bx\ sb\ c}', '\fontseries{<++>}<++>') + call s:Tex_Fontfont('fontshape{n\ it\ sl\ sc\ ui}', '\fontshape{<++>}<++>') + call s:Tex_Fontfont('fontsize{}{}', '\fontsize{<++>}{<++>}<++>') + call s:Tex_Fontfont('selectfont', '\selectfont ') + " }}} +endif + +" ============================================================================== +" Dimensions +" ============================================================================== +if g:Tex_Menus + " {{{ Static1 + call <SID>Tex_DimMenus('Static1', 'arraycolsep') + call <SID>Tex_DimMenus('Static1', 'arrayrulewidth') + call <SID>Tex_DimMenus('Static1', 'bibindent') + call <SID>Tex_DimMenus('Static1', 'columnsep') + call <SID>Tex_DimMenus('Static1', 'columnseprule') + call <SID>Tex_DimMenus('Static1', 'columnwidth') + call <SID>Tex_DimMenus('Static1', 'doublerulesep') + call <SID>Tex_DimMenus('Static1', 'evensidemargin') + call <SID>Tex_DimMenus('Static1', 'fboxrule') + call <SID>Tex_DimMenus('Static1', 'fboxsep') + call <SID>Tex_DimMenus('Static1', 'footheight') + call <SID>Tex_DimMenus('Static1', 'footnotesep') + call <SID>Tex_DimMenus('Static1', 'footskip') + call <SID>Tex_DimMenus('Static1', 'headheight') + call <SID>Tex_DimMenus('Static1', 'headsep') + call <SID>Tex_DimMenus('Static1', 'itemindent') + call <SID>Tex_DimMenus('Static1', 'labelsep') + call <SID>Tex_DimMenus('Static1', 'labelwidth') + call <SID>Tex_DimMenus('Static1', 'leftmargin') + call <SID>Tex_DimMenus('Static1', 'leftmargini') + call <SID>Tex_DimMenus('Static1', 'leftmarginii') + call <SID>Tex_DimMenus('Static1', 'leftmarginiii') + call <SID>Tex_DimMenus('Static1', 'leftmarginiv') + call <SID>Tex_DimMenus('Static1', 'leftmarginv') + call <SID>Tex_DimMenus('Static1', 'leftmarginvi') + call <SID>Tex_DimMenus('Static1', 'linewidth') + call <SID>Tex_DimMenus('Static1', 'listparindent') + call <SID>Tex_DimMenus('Static1', 'marginparpush') + call <SID>Tex_DimMenus('Static1', 'marginparsep') + call <SID>Tex_DimMenus('Static1', 'marginparwidth') + call <SID>Tex_DimMenus('Static1', 'mathindent') + call <SID>Tex_DimMenus('Static1', 'oddsidemargin') + " }}} + " {{{ Static2 + call <SID>Tex_DimMenus('Static2', 'paperheight') + call <SID>Tex_DimMenus('Static2', 'paperwidth') + call <SID>Tex_DimMenus('Static2', 'parindent') + call <SID>Tex_DimMenus('Static2', 'rightmargin') + call <SID>Tex_DimMenus('Static2', 'tabbingsep') + call <SID>Tex_DimMenus('Static2', 'tabcolsep') + call <SID>Tex_DimMenus('Static2', 'textheight') + call <SID>Tex_DimMenus('Static2', 'textwidth') + call <SID>Tex_DimMenus('Static2', 'topmargin') + call <SID>Tex_DimMenus('Static2', 'unitlength') + " }}} + " {{{ Dynamic + call <SID>Tex_DimMenus('Dynamic', 'abovedisplayshortskip') + call <SID>Tex_DimMenus('Dynamic', 'abovedisplayskip') + call <SID>Tex_DimMenus('Dynamic', 'baselineskip') + call <SID>Tex_DimMenus('Dynamic', 'belowdisplayshortskip') + call <SID>Tex_DimMenus('Dynamic', 'belowdisplayskip') + call <SID>Tex_DimMenus('Dynamic', 'dblfloatsep') + call <SID>Tex_DimMenus('Dynamic', 'dbltextfloatsep') + call <SID>Tex_DimMenus('Dynamic', 'floatsep') + call <SID>Tex_DimMenus('Dynamic', 'intextsep') + call <SID>Tex_DimMenus('Dynamic', 'itemsep') + call <SID>Tex_DimMenus('Dynamic', 'parsep') + call <SID>Tex_DimMenus('Dynamic', 'parskip') + call <SID>Tex_DimMenus('Dynamic', 'partopsep') + call <SID>Tex_DimMenus('Dynamic', 'textfloatsep') + call <SID>Tex_DimMenus('Dynamic', 'topsep') + call <SID>Tex_DimMenus('Dynamic', 'topskip') + " }}} + " {{{ Change + call <SID>Tex_DimMenus('Change', 'setlength') + call <SID>Tex_DimMenus('Change', 'addtolength') + call <SID>Tex_DimMenus('Change', 'settoheight') + call <SID>Tex_DimMenus('Change', 'settowidth') + call <SID>Tex_DimMenus('Change', 'settolength') + " }}} +endif + +" ============================================================================== +" Counters +" ============================================================================== +if g:Tex_Menus + " Counters {{{ + call <SID>Tex_CounterMenus('Counters', 'bottomnumber') + call <SID>Tex_CounterMenus('Counters', 'chapter') + call <SID>Tex_CounterMenus('Counters', 'dbltopnumber') + call <SID>Tex_CounterMenus('Counters', 'enumi') + call <SID>Tex_CounterMenus('Counters', 'enumii') + call <SID>Tex_CounterMenus('Counters', 'enumiii') + call <SID>Tex_CounterMenus('Counters', 'enumiv') + call <SID>Tex_CounterMenus('Counters', 'equation') + call <SID>Tex_CounterMenus('Counters', 'figure') + call <SID>Tex_CounterMenus('Counters', 'footnote') + call <SID>Tex_CounterMenus('Counters', 'mpfootnote') + call <SID>Tex_CounterMenus('Counters', 'page') + call <SID>Tex_CounterMenus('Counters', 'paragraph') + call <SID>Tex_CounterMenus('Counters', 'part') + call <SID>Tex_CounterMenus('Counters', 'secnumdepth') + call <SID>Tex_CounterMenus('Counters', 'section') + call <SID>Tex_CounterMenus('Counters', 'subparagraph') + call <SID>Tex_CounterMenus('Counters', 'subsection') + call <SID>Tex_CounterMenus('Counters', 'subsubsection') + call <SID>Tex_CounterMenus('Counters', 'table') + call <SID>Tex_CounterMenus('Counters', 'tocdepth') + call <SID>Tex_CounterMenus('Counters', 'topnumber') + call <SID>Tex_CounterMenus('Counters', 'totalnumber') + " }}} + " theCounters {{{ + call <SID>Tex_CounterMenus('theCounters', 'thebottomnumber') + call <SID>Tex_CounterMenus('theCounters', 'thechapter') + call <SID>Tex_CounterMenus('theCounters', 'thedbltopnumber') + call <SID>Tex_CounterMenus('theCounters', 'theenumi') + call <SID>Tex_CounterMenus('theCounters', 'theenumii') + call <SID>Tex_CounterMenus('theCounters', 'theenumiii') + call <SID>Tex_CounterMenus('theCounters', 'theenumiv') + call <SID>Tex_CounterMenus('theCounters', 'theequation') + call <SID>Tex_CounterMenus('theCounters', 'thefigure') + call <SID>Tex_CounterMenus('theCounters', 'thefootnote') + call <SID>Tex_CounterMenus('theCounters', 'thempfootnote') + call <SID>Tex_CounterMenus('theCounters', 'thepage') + call <SID>Tex_CounterMenus('theCounters', 'theparagraph') + call <SID>Tex_CounterMenus('theCounters', 'thepart') + call <SID>Tex_CounterMenus('theCounters', 'thesecnumdepth') + call <SID>Tex_CounterMenus('theCounters', 'thesection') + call <SID>Tex_CounterMenus('theCounters', 'thesubparagraph') + call <SID>Tex_CounterMenus('theCounters', 'thesubsection') + call <SID>Tex_CounterMenus('theCounters', 'thesubsubsection') + call <SID>Tex_CounterMenus('theCounters', 'thetable') + call <SID>Tex_CounterMenus('theCounters', 'thetocdepth') + call <SID>Tex_CounterMenus('theCounters', 'thetopnumber') + call <SID>Tex_CounterMenus('theCounters', 'thetotalnumber') + " }}} + " Type {{{ + call <SID>Tex_CounterMenus('Type', 'alph') + call <SID>Tex_CounterMenus('Type', 'Alph') + call <SID>Tex_CounterMenus('Type', 'arabic') + call <SID>Tex_CounterMenus('Type', 'roman') + call <SID>Tex_CounterMenus('Type', 'Roman') + " }}} +endif + +" ============================================================================== +" Various +" ============================================================================== +if g:Tex_Menus + " Various {{{ + call <SID>Tex_VariousMenus('ref{}' , '\ref{<++>}<++>') + call <SID>Tex_VariousMenus('pageref{}' , '\pageref{<++>}<++>') + call <SID>Tex_VariousMenus('label{}' , '\label{<++>}<++>') + call <SID>Tex_VariousMenus('footnote{}' , '\footnote{<++>}<++>') + call <SID>Tex_VariousMenus('footnotemark{}', '\footnotemark{<++>}<++>') + call <SID>Tex_VariousMenus('footnotemark{}', '\footnotetext{<++>}<++>') + call <SID>Tex_VariousMenus('cite{}' , '\cite{<++>}<++>') + call <SID>Tex_VariousMenus('nocite{}' , '\nocite{<++>}<++>') + " }}} +endif + +if g:Tex_CatchVisMapErrors + exe "vnoremap ".g:Tex_Leader." :\<C-u>call ExecMap('".g:Tex_Leader."', 'v')\<CR>" +endif +" this is for avoiding reinclusion of imaps from next time on. +let s:doneOnce = 1 + +" vim:fdm=marker:ff=unix:noet:ts=4:sw=4 diff --git a/.vim/ftplugin/latex-suite/envmacros.vim b/.vim/ftplugin/latex-suite/envmacros.vim @@ -0,0 +1,1166 @@ +"============================================================================= +" File: envmacros.vim +" Author: Mikolaj Machowski +" Created: Tue Apr 23 08:00 PM 2002 PST +" CVS Header: $Id: envmacros.vim 1101 2010-01-28 23:30:56Z tmaas $ +" Description: mappings/menus for environments. +"============================================================================= + +if !g:Tex_EnvironmentMaps && !g:Tex_EnvironmentMenus + finish +endif + +exe 'so '.fnameescape(expand('<sfile>:p:h').'/wizardfuncs.vim') + +nmap <silent> <script> <plug> i +imap <silent> <script> <C-o><plug> <Nop> + +" Define environments for IMAP evaluation " {{{ +let s:figure = "\\begin{figure}[<+htpb+>]\<cr>\\begin{center}\<cr>\\psfig{figure=<+eps file+>}\<cr>\\end{center}\<cr>\\caption{<+caption text+>}\<cr>\\label{fig:<+label+>}\<cr>\\end{figure}<++>" +let s:figure_graphicx = "\\begin{figure}[<+htpb+>]\<cr>\\begin{center}\<cr>\\includegraphics{<+file+>}\<cr>\\end{center}\<cr>\\caption{<+caption text+>}\<cr>\\label{fig:<+label+>}\<cr>\\end{figure}<++>" +let s:minipage = "\\begin{minipage}[<+tb+>]{<+width+>}\<cr><++>\<cr>\\end{minipage}<++>" +let s:picture = "\\begin{picture}(<+width+>, <+height+>)(<+xoff+>,<+yoff+>)\<cr>\\put(<+xoff+>,<+yoff+>){\\framebox(<++>,<++>){<++>}}\<cr>\\end{picture}<++>" +let s:list = "\\begin{list}{<+label+>}{<+spacing+>}\<cr>\\item <++>\<cr>\\end{list}<++>" +let s:table = "\\begin{table}\<cr>\\centering\<cr>\\begin{tabular}{<+dimensions+>}\<cr><++>\<cr>\\end{tabular}\<cr>\\caption{<+Caption text+>}\<cr>\\label{tab:<+label+>}\<cr>\\end{table}<++>" +let s:array = "\\left<++>\<cr>\\begin{array}{<+dimension+>}\<cr><+elements+>\<cr>\\end{array}\<cr>\\right<++>" +let s:description ="\\begin{description}\<cr>\\item[<+label+>]<++>\<cr>\\end{description}<++>" +let s:document = "\\documentclass[<+options+>]{<+class+>}\<cr>\<cr>\\begin{document}\<cr><++>\<cr>\\end{document}" +let s:tabular = "\\begin{tabular}[<+hbtp+>]{<+format+>}\<cr><++>\<cr>\\end{tabular}" +let s:tabular_star = "\\begin{tabular*}[<+hbtp+>]{<+format+>}\<cr><++>\<cr>\\end{tabular*}" + +" }}} +" define environments with special behavior in line wise selection. {{{ +if !exists('s:vis_center_left') + let s:vis_center_left = '\centerline{' + let s:vis_center_right = '}' + + let s:vis_verbatim_left = '\verb\|' + let s:vis_verbatim_right = '\|' + + let s:vis_flushright_left = '{\raggedright ' + let s:vis_flushright_right = '}' + + let s:vis_fushleft_left = '{\raggedleft ' + let s:vis_fushleft_right = '}' + + let s:vis_lrbox_left = '\sbox{' + let s:vis_lrbox_right = '}' +endif +" }}} +" Tex_EnvMacros: sets up maps and menus for environments {{{ +" Description: +function! <SID>Tex_EnvMacros(lhs, submenu, name) + + let extra = '' + if a:submenu =~ 'Lists' + let extra = '\item ' + endif + + let vright = '' + let vleft = '' + if exists('s:vis_'.a:name.'_right') + let vright = s:vis_{a:name}_right + let vleft = s:vis_{a:name}_left + endif + let vrhs = "\<C-\\>\<C-N>:call VEnclose('".vleft."', '".vright."', '\\begin{".a:name."}', '\\end{".a:name."}')\<CR>" + let location = g:Tex_EnvMenuLocation.a:submenu.a:name.'<tab>' + + if a:lhs != '' + + let vlhs = g:Tex_Leader2.substitute(tolower(a:lhs), '^.', '', '') + let location = location.a:lhs.'\ ('.vlhs.')' + + if g:Tex_EnvironmentMaps && !exists('s:doneOnce') + call IMAP(a:lhs, "\<C-r>=Tex_PutEnvironment('".a:name."')\<CR>", 'tex') + exec 'vnoremap <silent> '.vlhs.' '.vrhs + endif + + endif + + if g:Tex_Menus && g:Tex_EnvironmentMenus && has("gui_running") + exe 'amenu '.location.' <plug><C-r>=Tex_DoEnvironment("'.a:name.'")<CR>' + exe 'vmenu '.location.' '.vrhs + endif + +endfunction + +" }}} +" Tex_SpecialMacros: macros with special right hand sides {{{ +" Description: +function! <SID>Tex_SpecialMacros(lhs, submenu, name, irhs, ...) + + let wiz = 1 + if a:0 > 0 && a:1 == 0 + let wiz = 0 + endif + + let location = g:Tex_EnvMenuLocation.a:submenu.a:name + + let vright = '' + let vleft = '' + if exists('s:vis_'.a:name.'_right') + let vright = s:vis_{a:name}_right + let vleft = s:vis_{a:name}_left + endif + let vrhs = "\<C-\\>\<C-N>:call VEnclose('".vleft."', '".vright."', '\\begin{".a:name."}', '\\end{".a:name."}')\<CR>" + + if a:lhs != '' + + let vlhs = g:Tex_Leader2.substitute(tolower(a:lhs), '^.', '', '') + let location = location.'<tab>'.a:lhs.'\ ('.vlhs.')' + + if g:Tex_EnvironmentMaps && !exists('s:doneOnce') + call IMAP(a:lhs, a:irhs, 'tex') + exec 'vnoremap '.vlhs.' '.vrhs + endif + + endif + + if g:Tex_Menus && g:Tex_EnvironmentMenus + if wiz + exe 'amenu '.location.' <plug><C-r>=Tex_DoEnvironment("'.a:name.'")<CR>' + else + exe 'amenu '.location." <plug><C-r>=IMAP_PutTextWithMovement('".a:irhs."')<CR>" + endif + exe 'vmenu '.location.' '.vrhs + endif + +endfunction " }}} +" Tex_SectionMacros: creates section maps and menus {{{ +" Description: +function! <SID>Tex_SectionMacros(lhs, name) + + let vlhs = g:Tex_Leader2.substitute(tolower(a:lhs), '^.', '', '') + let vrhs = "\<C-\\>\<C-N>:call VEnclose('\\".a:name."{', '}', '', '')<CR>" + + if g:Tex_SectionMaps && !exists('s:doneOnce') + exe 'vnoremap '.vlhs.' '.vrhs + call IMAP (a:lhs, "\\".a:name.'{<++>}<++>', 'tex') + endif + + if g:Tex_Menus && g:Tex_SectionMenus + let location = g:Tex_EnvMenuLocation.'Sections.'.a:name.'<tab>'.a:lhs.'\ ('.vlhs.')' + let advlocation = g:Tex_EnvMenuLocation.'Sections.Advanced.'.a:name + + let irhs = "\<C-r>=IMAP_PutTextWithMovement('\\".a:name."{<++>}<++>')\<CR>" + + let advirhs = "\<C-r>=Tex_InsSecAdv('".a:name."')\<CR>" + let advvrhs = "\<C-\\>\<C-N>:call Tex_VisSecAdv('".a:name."')\<CR>" + + exe 'amenu '.advlocation.' <plug>'.advirhs + exe 'vnoremenu '.advlocation." ".advvrhs + + exe 'amenu '.location.' <plug>'.irhs + exe 'vnoremenu '.location." ".vrhs + endif +endfunction " }}} + +" NewEnvironments {{{ +call s:Tex_SpecialMacros('', '', 'newenvironment', '\newenvironment{<++>}[<++>][<++>]{<++>}{<++>}<++>', 0) +call s:Tex_SpecialMacros('', '', 'newenvironment*', '\newenvironment*{<++>}[<++>][<++>]{<++>}{<++>}<++>', 0) +call s:Tex_SpecialMacros('', '', 'renewenvironment', '\renewenvironment{<++>}[<++>][<++>]{<++>}{<++>}<++>', 0) +call s:Tex_SpecialMacros('', '', 'renewenvironment*', '\renewenvironment*{<++>}[<++>][<++>]{<++>}{<++>}<++>', 0) +call s:Tex_SpecialMacros('', '', '-sepenv0-', ' :', 0) +" }}} +" Environments specific commands {{{ +call s:Tex_SpecialMacros('', 'Env&Commands.&Lists.', '&item', '\item', 0) +call s:Tex_SpecialMacros('', 'Env&Commands.&Lists.', 'i&tem[]', '\item[<++>]<++>', 0) +call s:Tex_SpecialMacros('', 'Env&Commands.&Lists.', '&bibitem{}', '\bibitem{<++>}<++>', 0) +call s:Tex_SpecialMacros('', 'Env&Commands.&Tabbing.', '\\&=', '\=', 0) +call s:Tex_SpecialMacros('', 'Env&Commands.&Tabbing.', '\\&>', '\>', 0) +call s:Tex_SpecialMacros('', 'Env&Commands.&Tabbing.', '&\\\\', '\\', 0) +call s:Tex_SpecialMacros('', 'Env&Commands.&Tabbing.', '\\&+', '\+', 0) +call s:Tex_SpecialMacros('', 'Env&Commands.&Tabbing.', '\\&-', '\-', 0) +call s:Tex_SpecialMacros('', 'Env&Commands.&Tabbing.', "\\\'", "\\\'", 0) +call s:Tex_SpecialMacros('', 'Env&Commands.&Tabbing.', '\\&`', '\`', 0) +call s:Tex_SpecialMacros('', 'Env&Commands.&Tabbing.', '\\&kill', '\kill', 0) +call s:Tex_SpecialMacros('', 'Env&Commands.&Tabbing.', '&makron\ \\CHAR=', '\<++>=<++>', 0) +call s:Tex_SpecialMacros('', 'Env&Commands.&Tabbing.', "&aigu\ \\CHAR\'", "\\<++>\'<++>", 0) +call s:Tex_SpecialMacros('', 'Env&Commands.&Tabbing.', '&grave\ \\CHAR`', '\<++>`<++>', 0) +call s:Tex_SpecialMacros('', 'Env&Commands.&Tabbing.', 'p&ushtabs', '\pushtabs', 0) +call s:Tex_SpecialMacros('', 'Env&Commands.&Tabbing.', 'p&optabs', '\poptabs', 0) +call s:Tex_SpecialMacros('', 'EnvCommands.&Tabular.', '&hline', '\hline', 0) +call s:Tex_SpecialMacros('', 'EnvCommands.&Tabular.', '&cline', '\cline', 0) +call s:Tex_SpecialMacros('', 'EnvCommands.&Tabular.', '&\&', '&', 0) +call s:Tex_SpecialMacros('', 'EnvCommands.&Tabular.', '&\\\\', '\\', 0) +call s:Tex_SpecialMacros('', 'EnvCommands.&Tabular.', '&multicolumn{}{}{}', '\multicolumn{<++>}{<++>}{<++>}<++>', 0) +call s:Tex_SpecialMacros('', 'EnvCommands.Le&tter.', '&makelabels', '\makelabels', 0) +call s:Tex_SpecialMacros('', 'EnvCommands.Le&tter.', '&address', '\address', 0) +call s:Tex_SpecialMacros('', 'EnvCommands.Le&tter.', '&signature', '\signature', 0) +call s:Tex_SpecialMacros('', 'EnvCommands.Le&tter.', '&date', '\date', 0) +call s:Tex_SpecialMacros('', 'EnvCommands.Le&tter.', '-sepenva4-', ' :', 0) +call s:Tex_SpecialMacros('', 'EnvCommands.Le&tter.', '&opening{}', '\opening{<++>}<++>', 0) +call s:Tex_SpecialMacros('', 'EnvCommands.Le&tter.', '&closing{}', '\closing{<++>}<++>', 0) +call s:Tex_SpecialMacros('', 'EnvCommands.Le&tter.', '&ps{}', '\ps{<++>}<++>', 0) +call s:Tex_SpecialMacros('', 'EnvCommands.Le&tter.', 'cc&{}', '\cc{<++>}<++>', 0) +call s:Tex_SpecialMacros('', 'EnvCommands.&Slides.', '&onlyslides{}', '\onlyslides{<++>}<++>', 0) +call s:Tex_SpecialMacros('', 'EnvCommands.&Slides.', '&onlynotes{}', '\onlynotes{<++>}<++>', 0) +call s:Tex_SpecialMacros('', 'EnvCommands.&Slides.', '-sepenva5-', ' :', 0) +call s:Tex_SpecialMacros('', 'EnvCommands.&Slides.', '&invisible', '\invisible', 0) +call s:Tex_SpecialMacros('', 'EnvCommands.&Slides.', '&visible', '\visible', 0) +call s:Tex_SpecialMacros('', 'EnvCommands.&Slides.', '&settime', '\settime', 0) +call s:Tex_SpecialMacros('', 'EnvCommands.&Slides.', '&addtime', '\addtime', 0) +call s:Tex_SpecialMacros('', '', '-sepenv0-', ' :', 0) +" }}} +" Lists {{{ +call s:Tex_SpecialMacros('ELI', '&Lists.', 'list', s:list) +call s:Tex_SpecialMacros('EDE', '&Lists.', 'description', s:description) +call s:Tex_EnvMacros('EEN', '&Lists.', 'enumerate') +call s:Tex_EnvMacros('EIT', '&Lists.', 'itemize') +call s:Tex_EnvMacros('ETI', '&Lists.', 'theindex') +call s:Tex_EnvMacros('ETL', '&Lists.', 'trivlist') +" }}} +" Tables {{{ +call s:Tex_SpecialMacros('ETE', '&Tables.', 'table', s:table) +call s:Tex_EnvMacros('ETG', '&Tables.', 'tabbing') +call s:Tex_EnvMacros('', '&Tables.', 'table*') +call s:Tex_EnvMacros('', '&Tables.', 'table2') +call s:Tex_SpecialMacros('ETR', '&Tables.', 'tabular', s:tabular) +call s:Tex_SpecialMacros('', '&Tables.', 'tabular*', s:tabular_star) +" }}} +" Math {{{ +call s:Tex_EnvMacros('EAR', '&Math.', 'array') +call s:Tex_EnvMacros('EDM', '&Math.', 'displaymath') +call s:Tex_EnvMacros('EEA', '&Math.', 'eqnarray') +call s:Tex_EnvMacros('', '&Math.', 'eqnarray*') +call s:Tex_EnvMacros('EEQ', '&Math.', 'equation') +call s:Tex_EnvMacros('EMA', '&Math.', 'math') +" }}} +" Structure {{{ +call s:Tex_SpecialMacros('EAR', 'Math.', 'array', s:array) +call s:Tex_EnvMacros('EAB', '&Structure.', 'abstract') +call s:Tex_EnvMacros('EAP', '&Structure.', 'appendix') +call s:Tex_EnvMacros('ECE', '&Structure.', 'center') +call s:Tex_EnvMacros('EDO', '&Structure.', 'document') +call s:Tex_EnvMacros('EFC', '&Structure.', 'filecontents') +call s:Tex_EnvMacros('', '&Structure.', 'filecontents*') +call s:Tex_EnvMacros('EFL', '&Structure.', 'flushleft') +call s:Tex_EnvMacros('EFR', '&Structure.', 'flushright') +call s:Tex_EnvMacros('EQN', '&Structure.', 'quotation') +call s:Tex_EnvMacros('EQE', '&Structure.', 'quote') +call s:Tex_EnvMacros('ESP', '&Structure.', 'sloppypar') +call s:Tex_EnvMacros('ETI', '&Structure.', 'theindex') +call s:Tex_EnvMacros('ETP', '&Structure.', 'titlepage') +call s:Tex_EnvMacros('EVM', '&Structure.', 'verbatim') +call s:Tex_EnvMacros('', '&Structure.', 'verbatim*') +call s:Tex_EnvMacros('EVE', '&Structure.', 'verse') +call s:Tex_EnvMacros('ETB', '&Structure.', 'thebibliography') +call s:Tex_SpecialMacros('', '&Structure.', '-sepstruct0-', ':', 0) +call s:Tex_EnvMacros('ENO', '&Structure.', 'note') +call s:Tex_EnvMacros('EOV', '&Structure.', 'overlay') +call s:Tex_EnvMacros('ESL', '&Structure.', 'slide') +" }}} +" Sections {{{ +call s:Tex_SectionMacros('SPA', 'part') +call s:Tex_SectionMacros('SCH', 'chapter') +call s:Tex_SectionMacros('SSE', 'section') +call s:Tex_SectionMacros('SSS', 'subsection') +call s:Tex_SectionMacros('SS2', 'subsubsection') +call s:Tex_SectionMacros('SPG', 'paragraph') +call s:Tex_SectionMacros('SSP', 'subparagraph') +" }}} +" Miscellaneous {{{ +call s:Tex_SpecialMacros('', '', '-sepenv1-', ' :', 0) +call s:Tex_SpecialMacros('EFI', '', 'figure', "\<C-r>=Tex_PutEnvironment('figure')\<CR>") +call s:Tex_EnvMacros('', '', 'figure*') +call s:Tex_EnvMacros('ELR', '', 'lrbox') +call s:Tex_SpecialMacros('EMP', '', 'minipage', s:minipage) +call s:Tex_SpecialMacros('EPI', '', 'picture', s:picture) +" }}} + +if g:Tex_CatchVisMapErrors + exe 'vnoremap '.g:Tex_Leader2." :\<C-u>call ExecMap('".g:Tex_Leader2."', 'v')\<CR>" +endif + +" ============================================================================== +" Specialized functions for various environments +" +" All these functions are to be used as: +" +" inoremap <lhs> <C-r>=Tex_itemize('enumerate')<CR> +" nnoremap <lhs> i<C-r>=Tex_itemize('enumerate')<CR> +" +" and so on... +" ============================================================================== +" Tex_itemize: {{{ +function! Tex_itemize(env) + return IMAP_PutTextWithMovement('\begin{'.a:env."}\<cr>\\item <++>\<cr>\\end{".a:env."}<++>") +endfunction +" }}} +" Tex_description: {{{ +function! Tex_description(env) + if g:Tex_UseMenuWizard == 1 + let itlabel = input('(Optional) Item label? ') + if itlabel != '' + let itlabel = '['.itlabel.']' + endif + return IMAP_PutTextWithMovement("\\begin{description}\<cr>\\item".itlabel." <++>\<cr>\\end{description}<++>") + else + return IMAP_PutTextWithMovement(s:description) + endif +endfunction +" }}} +" Tex_figure: {{{ +function! Tex_figure(env) + if g:Tex_UseMenuWizard == 1 + let flto = input('Float to (htbp)? ') + let caption = input('Caption? ') + let center = input('Center ([y]/n)? ') + let label = input('Label (for use with \ref)? ') + " additional to AUC Tex since my pics are usually external files + let pic = input('Name of Pic-File? ') + if flto != '' + let flto = '['.flto."]\<cr>" + else + let flto = "\<cr>" + endif + if pic != '' + let pic = '\input{'.pic."}\<cr>" + else + let pic = "<++>\<cr>" + endif + if caption != '' + let caption = '\caption{'.caption."}\<cr>" + endif + if label != '' + let label = '\label{fig:'.label."}\<cr>" + endif + if center == 'y' + let centr = '\begin{center}' . "\<cr>" + let centr = centr . pic + let centr = centr . caption + let centr = centr . label + let centr = centr . '\end{center}' . "\<cr>" + else + let centr = pic + let centr = centr . caption + let centr = centr . label + endif + let figure = '\begin{'.a:env.'}'.flto + let figure = figure . centr + let figure = figure . '\end{'.a:env.'}' + return IMAP_PutTextWithMovement(figure) + else + if g:Tex_package_detected =~ '\<graphicx\>' + return IMAP_PutTextWithMovement(s:figure_graphicx) + else + return IMAP_PutTextWithMovement(s:figure) + endif + endif +endfunction +" }}} +" Tex_table: {{{ +function! Tex_table(env) + if g:Tex_UseMenuWizard == 1 + let flto = input('Float to (htbp)? ') + let caption = input('Caption? ') + let center = input('Center (y/n)? ') + let label = input('Label? ') + if flto != '' + let flto ='['.flto."]\<cr>" + else + let flto = '' + endif + let ret='\begin{table}'.flto + if center == 'y' + let ret=ret."\\begin{center}\<cr>" + endif + let foo = '\begin{tabular}' + let pos = input('(Optional) Position (t b)? ') + if pos != '' + let foo = foo.'['.pos.']' + else + let foo = foo."\<cr>" + endif + let format = input("Format ( l r c p{width} | @{text} )? ") + if format == '' + let format = '<++>' + endif + let ret = ret.foo.'{'.format."}\<cr><++>\<cr>\\end{tabular}<++>\<cr>" + if center == 'y' + let ret=ret."\\end{center}\<cr>" + endif + if caption != '' + let ret=ret.'\caption{'.caption."}\<cr>" + endif + if label != '' + let ret=ret.'\label{tab:'.label."}\<cr>" + endif + let ret=ret.'\end{table}<++>' + return IMAP_PutTextWithMovement(ret) + else + return IMAP_PutTextWithMovement(s:table) + endif +endfunction +" }}} +" Tex_tabular: {{{ +function! Tex_tabular(env) + if g:Tex_UseMenuWizard == 1 + let pos = input('(Optional) Position (t b)? ') + let format = input("Format ( l r c p{width} | @{text} )? ") + if pos != '' + let pos = '['.pos.']' + endif + if format != '' + let format = '{'.format.'}' + endif + return IMAP_PutTextWithMovement('\begin{'.a:env.'}'.pos.format."\<cr> \<cr>\\end{".a:env.'}<++>') + else + return IMAP_PutTextWithMovement('\begin{'.a:env.'}[<+position+>]{<+format+>}'."\<cr><++>\<cr>\\end{".a:env.'}<++>') + endif +endfunction +" }}} +" Tex_eqnarray: {{{ +function! Tex_eqnarray(env) + if g:Tex_UseMenuWizard == 1 + if a:env !~ '\*' + let label = input('Label? ') + if label != '' + let arrlabel = '\label{'.label."}\<cr>" + else + let arrlabel = '' + endif + else + let arrlabel = '' + endif + else + if a:env !~ '\*' + let arrlabel = "\\label{<++>}\<cr>" + else + let arrlabel = "" + endif + endif + return IMAP_PutTextWithMovement('\begin{'.a:env."}\<cr><++>\<cr>".arrlabel."\\end{".a:env."}<++>") +endfunction +" }}} +" Tex_list: {{{ +function! Tex_list(env) + if g:Tex_UseMenuWizard == 1 + let label = input('Label (for \item)? ') + if label != '' + let label = '{'.label.'}' + let addcmd = input('Additional commands? ') + if addcmd != '' + let label = label . '{'.addcmd.'}' + endif + else + let label = '' + endif + return IMAP_PutTextWithMovement('\begin{list}'.label."\<cr>\\item \<cr>\\end{list}<++>") + else + return IMAP_PutTextWithMovement(s:list) + endif +endfunction +" }}} +" Tex_document: {{{ +function! Tex_document(env) + if g:Tex_UseMenuWizard == 1 + let dstyle = input('Document style? ') + let opts = input('(Optional) Options? ') + let foo = '\documentclass' + if opts == '' + let foo = foo.'{'.dstyle.'}' + else + let foo = foo.'['.opts.']'.'{'.dstyle.'}' + endif + return IMAP_PutTextWithMovement(foo."\<cr>\<cr>\\begin{document}\<cr><++>\<cr>\\end{document}") + else + return IMAP_PutTextWithMovement(s:document) + endif +endfunction +" }}} +" Tex_minipage: {{{ +function! Tex_minipage(env) + if g:Tex_UseMenuWizard == 1 + let foo = '\begin{minipage}' + let pos = input('(Optional) Position (t b)? ') + let width = input('Width? ') + if pos == '' + let foo = foo.'{'.width.'}' + else + let foo = foo.'['.pos.']{'.width.'}' + endif + return IMAP_PutTextWithMovement(foo."\<cr><++>\<cr>\\end{minipage}<++>") + else + return IMAP_PutTextWithMovement(s:minipage) + endif +endfunction +" }}} +" Tex_thebibliography: {{{ +function! Tex_thebibliography(env) + if g:Tex_UseMenuWizard == 1 + " AUC Tex: "Label for BibItem: 99" + let indent = input('Indent for BibItem? ') + let foo = '{'.indent.'}' + let biblabel = input('(Optional) Bibitem label? ') + let key = input('Add key? ') + let bar = '\bibitem' + if biblabel != '' + let bar = bar.'['.biblabel.']' + endif + let bar = bar.'{'.key.'}' + return IMAP_PutTextWithMovement('\begin{thebibliography}'.foo."\<cr>".bar." \<cr>\\end{thebibliography}<++>\<Up>") + else + return IMAP_PutTextWithMovement( + \ "\\begin{thebibliography}\<CR>". + \ "\\bibitem[<+biblabel+>]{<+bibkey+>} <++>\<CR>". + \ "<++>\<CR>". + \ "\\end{thebibliography}<++>") + endif +endfunction +" }}} + +" ============================================================================== +" Contributions / suggestions from Carl Mueller (auctex.vim) +" ============================================================================== +" PromptForEnvironment: prompts for an environment {{{ +" Description: +function! PromptForEnvironment(ask) + return Tex_ChooseFromPrompt( + \ a:ask."\n" . + \ Tex_CreatePrompt(g:Tex_PromptedEnvironments, 2, ",") . + \ "\nEnter name or number of environment :", + \ g:Tex_PromptedEnvironments, ",") +endfunction " }}} +" Tex_DoEnvironment: fast insertion of environments {{{ +" Description: +" The menus call this function with an argument (the name of the environment +" to insert). The maps call this without any arguments. In this case, it +" prompts for an environment to enter if the current line is empty. If +" called without arguments and there is a word on the current line, then use +" that as the name of a new environment. +function! Tex_DoEnvironment(...) + if a:0 < 1 + let env = matchstr(getline('.'), '^\s*\zs\w*\*\=\ze\s*$') + " If in current line is more than one word or in visual mode + " ignore contents of line and prompt for environment + if env == '' || (exists('s:isvisual') && s:isvisual == 'yes') + let env = PromptForEnvironment('Choose which environment to insert: ') + if env != '' + return Tex_PutEnvironment(env) + else + return '' + endif + else + " delete the word on the line into the blackhole register. + normal! 0"_D + return Tex_PutEnvironment(env) + endif + else + return Tex_PutEnvironment(a:1) + endif +endfunction " }}} +" Tex_PutEnvironment: calls various specialized functions {{{ +" Description: +" Based on input argument, it calls various specialized functions. +function! Tex_PutEnvironment(env) + if exists("s:isvisual") && s:isvisual == "yes" + let s:isvisual = 'no' + if a:env == '\[' + return VEnclose('', '', '\[', '\]') + elseif a:env == '$$' + return VEnclose('', '', '$$', '$$') + endif + return VEnclose('\begin{'.a:env.'}', '\end{'.a:env.'}', '\begin{'.a:env.'}', '\end{'.a:env.'}') + else + " The user can define something like + " let g:Tex_Env_theorem = "\\begin{theorem}\<CR><++>\<CR>\\end{theorem}" + " This will effectively over-write the default definition of the + " theorem environment which uses a \label. + if exists("b:Tex_Env_{'".a:env."'}") + return IMAP_PutTextWithMovement(b:Tex_Env_{a:env}) + elseif exists("g:Tex_Env_{'".a:env."'}") + return IMAP_PutTextWithMovement(g:Tex_Env_{a:env}) + elseif a:env =~ 'equation*\|eqnarray*\|theorem\|lemma\|equation\|eqnarray\|align\*\|align\>\|multline' + let g:aa = a:env + return Tex_eqnarray(a:env) + elseif a:env =~ "enumerate\\|itemize\\|theindex\\|trivlist" + return Tex_itemize(a:env) + elseif a:env =~ "table\\|table*" + return Tex_table(a:env) + elseif a:env =~ "tabular\\|tabular*\\|array\\|array*" + return Tex_tabular(a:env) + elseif exists('*Tex_'.a:env) + exe 'return Tex_'.a:env.'(a:env)' + elseif a:env == '$$' + return IMAP_PutTextWithMovement('$$<++>$$') + elseif a:env == '\[' + return IMAP_PutTextWithMovement("\\[\<CR><++>\<CR>\\]<++>") + else + " Look in supported packages if exists template for environment + " given in the line + if exists('g:Tex_package_supported') && g:Tex_package_supported != '' + let i = 1 + while Tex_Strntok(g:Tex_package_supported, ',', i) != '' + let checkpack = Tex_Strntok(g:Tex_package_supported, ',', i) + if g:TeX_package_{checkpack} =~ 'e..:'.a:env + if a:env =~ '*' + " Don't allow * to be treated as wildcard + let aenv = substitute(a:env, '*', '\\*', '') + else + let aenv = a:env + endif + let envcommand = matchstr(g:TeX_package_{checkpack}, '\zse..:'.aenv.'[^,]\{-}\ze,') + return Tex_ProcessPackageCommand(envcommand) + endif + let i = i + 1 + endwhile + endif + endif + " If nothing before us managed to create an environment, then just + " create a bare-bones environment from the name. + return IMAP_PutTextWithMovement('\begin{'.a:env."}\<cr><++>\<cr>\\end{".a:env."}<++>") + endif +endfunction " }}} +" Mapping the <F5> key to insert/prompt for an environment/package {{{ +" and <S-F5> to prompt/replace an environment +" +" g:Tex_PromptedEnvironments is a variable containing a comma seperated list +" of environments. This list defines the prompt which latex-suite sets up when +" the user presses <F5> on an empty line. +" +" Leaving this empty is equivalent to disabling the feature. +if g:Tex_PromptedEnvironments != '' + + let b:DoubleDollars = 0 + + " Provide only <plug>s here. main.vim will create the actual maps. + inoremap <silent> <Plug>Tex_FastEnvironmentInsert <C-r>=Tex_FastEnvironmentInsert("no")<cr> + nnoremap <silent> <Plug>Tex_FastEnvironmentInsert i<C-r>=Tex_FastEnvironmentInsert("no")<cr> + vnoremap <silent> <Plug>Tex_FastEnvironmentInsert <C-\><C-N>:call Tex_FastEnvironmentInsert("yes")<CR> + inoremap <silent> <Plug>Tex_FastEnvironmentChange <C-O>:call Tex_ChangeEnvironments()<CR> + nnoremap <silent> <Plug>Tex_FastEnvironmentChange :call Tex_ChangeEnvironments()<CR> + + " Tex_FastEnvironmentInsert: maps <F5> to prompt for env and insert it " {{{ + " Description: + " This function calculates whether we are in the preamble. If we are + " then inserts a \usepackage line by either reading in a word from the + " current line or prompting to type in one. If not in the preamble, then + " inserts a environment template either by reading in a word from the + " current line or prompting the user to choose one. + " + function! Tex_FastEnvironmentInsert(isvisual) + + let start_line = line('.') + let pos = Tex_GetPos() + let s:isvisual = a:isvisual + + " decide if we are in the preamble of the document. If we are then + " insert a package, otherwise insert an environment. + " + if search('\\documentclass', 'bW') && search('\\begin{document}') + + " If there is a \documentclass line and a \begin{document} line in + " the file, then a part of the file is the preamble. + + " search for where the document begins. + let begin_line = search('\\begin{document}') + " if the document begins after where we are presently, then we are + " in the preamble. + if start_line < begin_line + " return to our original location and insert a package + " statement. + call Tex_SetPos(pos) + return Tex_package_from_line() + else + " we are after the preamble. insert an environment. + call Tex_SetPos(pos) + return Tex_DoEnvironment() + endif + + elseif search('\\documentclass') + " if there is only a \documentclass but no \begin{document}, then + " the entire file is a preamble. Put a package. + + call Tex_SetPos(pos) + return Tex_package_from_line() + + else + " no \documentclass, put an environment. + + call Tex_SetPos(pos) + return Tex_DoEnvironment() + + endif + + endfunction + + " }}} + " Tex_package_from_line: puts a \usepackage line in the current line. " {{{ + " Description: + " + function! Tex_package_from_line() + " Function Tex_PutPackage is defined in packages.vim + " Ignores <F5> in Visual mode + if s:isvisual == "yes" + return 0 + else + let l = getline(".") + let pack = matchstr(l, '^\s*\zs.*') + normal! 0"_D + return Tex_pack_one(pack) + endif + endfunction + + " }}} + " Tex_ChangeEnvironments: calls Change() to change the environment {{{ + " Description: + " Finds out which environment the cursor is positioned in and changes + " that to the chosen new environment. This function knows the changes + " which need to be made to change one env to another and calls + " Change() with the info. + " + function! Tex_ChangeEnvironments() + + let env_line = searchpair('$$\|\\[\|begin{', '', '$$\|\\]\|end{', "bn") + + if env_line != 0 + if getline(env_line) !~ 'begin{' + let env_name = '[' + else + let env_name = matchstr(getline(env_line), 'begin{\zs.\{-}\ze}') + endif + endif + + if !exists('env_name') + echomsg "You are not inside environment" + return 0 + endif + + exe 'echomsg "You are within a '.env_name.' environment."' + let change_env = PromptForEnvironment('What do you want to change it to? ') + + if change_env == 'eqnarray' + call <SID>Change('eqnarray', 1, '', env_name =~ '\*$') + elseif change_env == 'align' + call <SID>Change('align', 1, '', env_name =~ '\*$') + elseif change_env == 'eqnarray*' + call <SID>Change('eqnarray*', 0, '\\nonumber', 0) + elseif change_env == 'align*' + call <SID>Change('align*', 0, '\\nonumber', 0) + elseif change_env == 'equation*' + call <SID>Change('equation*', 0, '&\|\\lefteqn{\|\\nonumber\|\\\\', 0) + elseif change_env == '' + return 0 + else + call <SID>Change(change_env, 0, '', '') + return 0 + endif + + endfunction + + " }}} + " Change: changes the current env to the new env {{{ + " Description: + " This function needs to know the changes which need to be made while + " going from an old environment to a new one. This info, it gets from + " Tex_ChangeEnvironments + " + " env : name of the new environment. + " label : if 1, then insert a \label at the end of the environment. + " otherwise, delete any \label line found. + " delete : a pattern which is to be deleted from the original environment. + " for example, going to a eqnarray* environment means we need to + " delete \label's. + " putInNonumber : whether we need to put a \nonumber before the end of the + " environment. + function! s:Change(env, label, delete, putInNonumber) + + let start_line = line('.') + let start_col = virtcol('.') + + if a:env == '[' + if b:DoubleDollars == 0 + let first = '\\[' + let second = '\\]' + else + let first = '$$' + let second = '$$' + endif + else + let first = '\\begin{' . a:env . '}' + let second = '\\end{' . a:env . '}' + endif + + if b:DoubleDollars == 0 + let bottom = searchpair('\\\[\|\\begin{','','\\\]\|\\end{','') + s/\\\]\|\\end{.\{-}}/\=second/ + let top = searchpair('\\\[\|\\begin{','','\\\]\|\\end{','b') + s/\\\[\|\\begin{.\{-}}/\=first/ + else + let bottom = search('\$\$\|\\end{') + s/\$\$\|\\end{.\{-}}/\=second/ + let top = search('\$\$\|\\begin{','b') + s/\$\$\|\\begin{.\{-}}/\=first/ + end + if a:delete != '' + exe 'silent '. top . "," . bottom . 's/' . a:delete . '//e' + endif + + if a:putInNonumber == 1 + exe top + call search('\\end\|\\\\') + if line('.') != bottom + exe '.+1,' . bottom . 's/\\\\/\\nonumber\\\\/e' + exe (bottom-1) . 's/\s*$/ \\nonumber/' + endif + endif + + if a:label == 1 + exe top + if search("\\label", "W") > bottom + exe top + let local_label = input('Label? ') + if local_label != '' + put = '\label{'.local_label.'}' + endif + normal $ + endif + else + exe 'silent '.top . ',' . bottom . ' g/\\label/delete' + endif + + if exists('local_label') && local_label != '' + exe start_line + 1.' | normal! '.start_col.'|' + else + exe start_line.' | normal! '.start_col.'|' + endif + endfunction " }}} + +endif + +" }}} +" Map <S-F1> through <S-F4> to insert environments {{{ +if g:Tex_HotKeyMappings != '' + + " SetUpHotKeys: maps <F1> through <F4> to insert environments + " Description: + function! <SID>SetUpHotKeys() + let i = 1 + let envname = Tex_Strntok(g:Tex_HotKeyMappings, ',', i) + while envname != '' + + exec 'inoremap <silent> <buffer> <S-F'.i.'> <C-r>=Tex_PutEnvironment("'.envname.'")<CR>' + + let i = i + 1 + let envname = Tex_Strntok(g:Tex_HotKeyMappings, ',', i) + + endwhile + + endfunction + +endif + +" }}} +" Tex_SetFastEnvironmentMaps: function for setting up the <F5> and <S-F1>-<S-F4> keys {{{ +" Description: This function is made public so it can be called by the +" SetTeXOptions() function in main.vim +function! Tex_SetFastEnvironmentMaps() + if g:Tex_PromptedEnvironments != '' + call Tex_MakeMap("<F5>", "<Plug>Tex_FastEnvironmentInsert", 'i', '<silent> <buffer>') + call Tex_MakeMap("<F5>", "<Plug>Tex_FastEnvironmentInsert", 'n', '<silent> <buffer>') + call Tex_MakeMap("<F5>", "<Plug>Tex_FastEnvironmentInsert", 'v', '<silent> <buffer>') + call Tex_MakeMap("<S-F5>", "<Plug>Tex_FastEnvironmentChange", 'i', '<silent> <buffer>') + call Tex_MakeMap("<S-F5>", "<Plug>Tex_FastEnvironmentChange", 'n', '<silent> <buffer>') + endif + if g:Tex_HotKeyMappings != '' + call s:SetUpHotKeys() + endif +endfunction " }}} + +" ============================================================================== +" Contributions / Tex_InsertItem() from Johannes Tanzler +" ============================================================================== +" Tex_GetCurrentEnv: gets the current environment in which the cursor lies {{{ +" Description: handles cases such as: +" +" \begin{itemize} +" \item first item +" \item second item +" \begin{description} +" \item first desc +" \item second +" % Tex_GetCurrentEnv will return "description" when called from here +" \end{description} +" \item third item +" % Tex_GetCurrentEnv will return "itemize" when called from here +" \end{itemize} +" % Tex_GetCurrentEnv will return "" when called from here +" +" Author: Alan Schmitt +function! Tex_GetCurrentEnv() + let pos = Tex_GetPos() + let i = 0 + while 1 + let env_line = search('^[^%]*\\\%(begin\|end\){', 'bW') + if env_line == 0 + " we reached the beginning of the file, so we return the empty string + call Tex_SetPos(pos) + return '' + endif + if match(getline(env_line), '^[^%]*\\begin{') == -1 + " we found a \\end, so we keep searching + let i = i + 1 + continue + else + " we found a \\begin which has not been \\end'ed. we are done. + if i == 0 + let env = matchstr(getline(env_line), '\\begin{\zs.\{-}\ze}') + call Tex_SetPos(pos) + return env + else + " this \\begin closes a \\end, continue searching. + let i = i - 1 + continue + endif + endif + endwhile +endfunction +" }}} +" Tex_InsertItem: insert \item into a list {{{ +" Description: Find last \begin line, extract env name, return to the start +" position and insert proper \item, depending on env name. +" Env names are stored in g: variables it can be used by +" package files. + +TexLet g:Tex_ItemStyle_itemize = '\item ' +TexLet g:Tex_ItemStyle_enumerate = '\item ' +TexLet g:Tex_ItemStyle_theindex = '\item ' +TexLet g:Tex_ItemStyle_thebibliography = '\bibitem[<+biblabel+>]{<+bibkey+>} <++>' +TexLet g:Tex_ItemStyle_description = '\item[<+label+>] <++>' + +function! Tex_InsertItem() + " Get current enclosing environment + let env = Tex_GetCurrentEnv() + + if exists('g:Tex_ItemStyle_'.env) + return IMAP_PutTextWithMovement(g:Tex_ItemStyle_{env}) + else + return '' + endif +endfunction +" }}} +" Tex_SetItemMaps: sets the \item inserting maps for current buffer {{{ + +inoremap <script> <silent> <Plug>Tex_InsertItemOnThisLine <C-r>=Tex_InsertItem()<CR> +inoremap <script> <silent> <Plug>Tex_InsertItemOnNextLine <ESC>o<C-R>=Tex_InsertItem()<CR> + +function! Tex_SetItemMaps() + if !hasmapto("<Plug>Tex_InsertItemOnThisLine", "i") + imap <buffer> <M-i> <Plug>Tex_InsertItemOnThisLine + endif + if !hasmapto("<Plug>Tex_InsertItemOnNextLine", "i") + imap <buffer> <C-CR> <Plug>Tex_InsertItemOnNextLine + endif +endfunction " }}} + +" ============================================================================== +" Implementation of Fast Environment commands for LaTeX commands +" ============================================================================== +" Define certain commonly used command definitions {{{ + +TexLet g:Tex_Com_{'newtheorem'} = '\newtheorem{<+name+>}{<+caption+>}[<+within+>]' +TexLet g:Tex_Com_{'frac'} = '\frac{<+n+>}{<+d+>}<++>' + +" }}} +" PromptForCommand: prompts for a command {{{ +" Description: +function! PromptForCommand(ask) + let common_com_prompt = + \ Tex_CreatePrompt(g:Tex_PromptedCommands, 2, ',') . "\n" . + \ "Enter number or command name :" + + let inp = input(a:ask."\n".common_com_prompt) + if inp =~ '^[0-9]\+$' + let com = Tex_Strntok(g:Tex_PromptedCommands, ',', inp) + else + let com = inp + endif + + return com +endfunction " }}} +" Tex_DoCommand: fast insertion of commands {{{ +" Description: +" +function! Tex_DoCommand(isvisual) + " If the current line is empty or if a visual selection has been made, + " prompt for a new environment. + if getline('.') == '' || a:isvisual == 'yes' + let com = PromptForCommand('Choose a command to insert: ') + if com != '' + return Tex_PutCommand(com, a:isvisual) + else + return '' + endif + else + " We want to find out the word under the cursor without issuing + " any movement commands. + let presline = getline('.') + let c = col('.') + + let wordbef = matchstr(strpart(presline, 0, c-1), '\k\+\*\?$') + let wordaft = matchstr(strpart(presline, c-1), '^\k\+\*\?') + + let word = wordbef . wordaft + call Tex_Debug("Tex_DoCommand: wordbef = [".wordbef."], wordaft = [".wordaft."], word = [".word."]", 'env') + + " We use \<Del> instead of \<Bs> because \<Bs> does not work + " unless bs=2 + if word != '' + return substitute(wordbef, '.', "\<Left>", 'g') + \ . substitute(word, '.', "\<Del>", 'g') + \ . Tex_PutCommand(word, a:isvisual) + else + let cmd = PromptForCommand('Choose a command to insert: ') + if cmd != '' + return Tex_PutCommand(cmd, a:isvisual) + else + return '' + endif + endif + endif +endfunction " }}} +" Tex_PutCommand: calls various specialized functions {{{ +" Description: +" Based on input argument, it calls various specialized functions. +function! Tex_PutCommand(com, isvisual) + if a:isvisual == "yes" + if a:com == '$' + return VEnclose('$', '$', '$', '$') + elseif a:com == '\\(' + return VEnclose('\\(', '\\)', '\\(', '\\)') + else + return VEnclose("\\".a:com.'{', '}', "\\".a:com.'{', '}') + endif + else + if exists('b:Tex_Com_{"'.a:com.'"}') + return IMAP_PutTextWithMovement(b:Tex_Com_{a:com}) + elseif exists('g:Tex_Com_{"'.a:com.'"}') + return IMAP_PutTextWithMovement(g:Tex_Com_{a:com}) + elseif a:com == '$' + return IMAP_PutTextWithMovement('$<++>$') + else + return IMAP_PutTextWithMovement("\\".a:com.'{<++>}<++>') + endif + endif +endfunction " }}} +" Mapping the <F7> key to prompt/insert for command {{{ +" and <S-F7> to prompt/replace command +" +" g:Tex_PromptedCommands is a variable containing a comma seperated list +" of commands. +" +" Leaving this empty is equivalent to disabling the feature. +if g:Tex_PromptedCommands != '' + + let b:DoubleDollars = 0 + + inoremap <silent> <Plug>Tex_FastCommandInsert <C-r>=Tex_DoCommand('no')<cr> + nnoremap <silent> <Plug>Tex_FastCommandInsert i<C-r>=Tex_DoCommand('no')<cr> + vnoremap <silent> <Plug>Tex_FastCommandInsert <C-\><C-N>:call Tex_DoCommand('yes')<CR> + + inoremap <silent> <Plug>Tex_FastCommandChange <C-O>:call Tex_ChangeCommand('no')<CR> + nnoremap <silent> <Plug>Tex_FastCommandChange :call Tex_ChangeCommand('no')<CR> + + " Tex_ChangeCommand: calls ChangeCommand() to change the environment {{{ + " Description: + " Finds out which environment the cursor is positioned in and changes + " that to the chosen new environment. This function knows the changes + " which need to be made to change one env to another and calls + " ChangeCommand() with the info. + " + function! Tex_ChangeCommand(isvisual) + + let pos_com = Tex_GetPos() + + let com_line = searchpair('\\\k\{-}{', '', '}', 'b') + + if com_line != 0 + normal l + let com_name = expand('<cword>') + endif + + if !exists('com_name') + echomsg "You are not inside command" + call Tex_SetPos(pos_com) + return 0 + endif + + exe 'echomsg "You are within a '.com_name.' command."' + let change_com = PromptForCommand('Do you want to change it to (number or name)? ') + + if change_com == '' + call Tex_SetPos(pos_com) + return 0 + else + call <SID>ChangeCommand(change_com) + call Tex_SetPos(pos_com) + return 0 + endif + + endfunction + + " }}} + " ChangeCommand: Changes current command according to prompt menu {{{ + " Description: + " + function! s:ChangeCommand(newcom) + + exe 'normal! ct{'.a:newcom."\<Esc>" + + endfunction + " }}} + +endif + +" }}} +" Tex_SetFastCommandMaps: function for setting up the <F7> keys {{{ +" Description: This function is made public so it can be called by the +" SetTeXOptions() function in main.vim +function! Tex_SetFastCommandMaps() + if g:Tex_PromptedCommands != '' + if !hasmapto('<Plug>Tex_FastCommandInsert', 'i') + imap <silent> <buffer> <F7> <Plug>Tex_FastCommandInsert + endif + if !hasmapto('<Plug>Tex_FastCommandInsert', 'n') + nmap <silent> <buffer> <F7> <Plug>Tex_FastCommandInsert + endif + if !hasmapto('<Plug>Tex_FastCommandChange', 'i') + imap <silent> <buffer> <S-F7> <Plug>Tex_FastCommandChange + endif + if !hasmapto('<Plug>Tex_FastCommandChange', 'n') + nmap <silent> <buffer> <S-F7> <Plug>Tex_FastCommandChange + endif + if !hasmapto('<Plug>Tex_FastCommandInsert', 'v') + vmap <silent> <buffer> <F7> <Plug>Tex_FastCommandInsert + endif + endif +endfunction " }}} + +" SetEnvMacrosOptions: sets mappings for buffers {{{ +" " Description: +function! <SID>SetEnvMacrosOptions() + if exists('b:doneTexEnvMaps') + return + endif + let b:doneTexEnvMaps = 1 + if g:Tex_PromptedEnvironments != '' || g:Tex_HotKeyMappings != '' + call Tex_SetFastEnvironmentMaps() + endif + if g:Tex_PromptedCommands != '' + call Tex_SetFastCommandMaps() + endif + call Tex_SetItemMaps() +endfunction " }}} +" Catch the Filetype event so we set maps for each buffer {{{ +augroup LatexSuite + au LatexSuite User LatexSuiteFileType + \ call Tex_Debug('envmacros.vim: Catching LatexSuiteFileType event', 'env') | + \ call s:SetEnvMacrosOptions() +augroup END +" }}} + +" this statement has to be at the end. +let s:doneOnce = 1 + +" vim:fdm=marker:nowrap:noet:ff=unix diff --git a/.vim/ftplugin/latex-suite/folding.vim b/.vim/ftplugin/latex-suite/folding.vim @@ -0,0 +1,395 @@ +"============================================================================= +" File: folding.vim +" Author: Srinath Avadhanula +" modifications/additions by Zhang Linbo +" CVS: $Id: folding.vim 1109 2010-10-07 20:19:23Z tmaas $ +" Created: Tue Apr 23 05:00 PM 2002 PST +" +" Description: functions to interact with Syntaxfolds.vim +"============================================================================= + +nnoremap <unique> <Plug>Tex_RefreshFolds :call MakeTexFolds(1)<cr> + +augroup LatexSuite + au LatexSuite User LatexSuiteFileType + \ call Tex_Debug('folding.vim: catching LatexSuiteFileType', 'fold') | + \ call Tex_SetFoldOptions() +augroup END + +" Tex_SetFoldOptions: sets maps for every buffer {{{ +" Description: +function! Tex_SetFoldOptions() + if exists('b:doneSetFoldOptions') + return + endif + let b:doneSetFoldOptions = 1 + + setlocal foldtext=TexFoldTextFunction() + + if g:Tex_Folding && g:Tex_AutoFolding + call MakeTexFolds(0) + endif + + let s:ml = '<Leader>' + + call Tex_MakeMap(s:ml."rf", "<Plug>Tex_RefreshFolds", 'n', '<silent> <buffer>') + +endfunction " }}} +" Tex_FoldSections: creates section folds {{{ +" Author: Zhang Linbo +" Description: +" This function takes a comma seperated list of "sections" and creates fold +" definitions for them. The first item is supposed to be the "shallowest" field +" and the last is the "deepest". See g:Tex_FoldedSections for the default +" definition of the lst input argument. +" +" **works recursively** +function! Tex_FoldSections(lst, endpat) + let i = match(a:lst, ',') + if i > 0 + let s = strpart(a:lst, 0, i) + else + let s = a:lst + endif + if s =~ '%%fakesection' + let s = '^\s*' . s + else + let s = '^\s*\\' . s . '\W\|^\s*%%fake' . s + endif + let endpat = s . '\|' . a:endpat + if i > 0 + call Tex_FoldSections(strpart(a:lst,i+1), endpat) + endif + let endpat = '^\s*\\appendix\W\|' . endpat + call AddSyntaxFoldItem(s, endpat, 0, -1) +endfunction +" }}} +" MakeTexFolds: function to create fold items for latex. {{{ +" +" used in conjunction with MakeSyntaxFolds(). +" see ../plugin/syntaxFolds.vim for documentation +function! MakeTexFolds(force) + if exists('g:Tex_Folding') && !g:Tex_Folding + return + endif + if &ft != 'tex' + return + end + + " Setup folded items lists g:Tex_Foldedxxxx + " 1. Use default value if g:Tex_Foldedxxxxxx is not defined + " 2. prepend default value to g:Tex_Foldedxxxxxx if it starts with ',' + " 3. append default value to g:Tex_Foldedxxxxxx if it ends with ',' + + " Folding items which are not caught in any of the standard commands, + " environments or sections. + let s = 'item,slide,preamble,<<<' + if !exists('g:Tex_FoldedMisc') + let g:Tex_FoldedMisc = s + elseif g:Tex_FoldedMisc[0] == ',' + let g:Tex_FoldedMisc = s . g:Tex_FoldedMisc + elseif g:Tex_FoldedMisc =~ ',$' + let g:Tex_FoldedMisc = g:Tex_FoldedMisc . s + endif + + " By default do not fold any commands. It looks like trying to fold + " commands is a difficult problem since commands can be arbitrarily nested + " and the end patterns are not unique unlike the case of environments. + " For this to work well, we need a regexp which will match a line only if + " a command begins on that line but does not end on that line. This + " requires a regexp which will match unbalanced curly braces and that is + " apparently not doable with regexps. + let s = '' + if !exists('g:Tex_FoldedCommands') + let g:Tex_FoldedCommands = s + elseif g:Tex_FoldedCommands[0] == ',' + let g:Tex_FoldedCommands = s . g:Tex_FoldedCommands + elseif g:Tex_FoldedCommands =~ ',$' + let g:Tex_FoldedCommands = g:Tex_FoldedCommands . s + endif + + let s = 'verbatim,comment,eq,gather,align,figure,table,thebibliography,' + \. 'keywords,abstract,titlepage' + if !exists('g:Tex_FoldedEnvironments') + let g:Tex_FoldedEnvironments = s + elseif g:Tex_FoldedEnvironments[0] == ',' + let g:Tex_FoldedEnvironments = s . g:Tex_FoldedEnvironments + elseif g:Tex_FoldedEnvironments =~ ',$' + let g:Tex_FoldedEnvironments = g:Tex_FoldedEnvironments . s + endif + + if !exists('g:Tex_FoldedSections') + let g:Tex_FoldedSections = 'part,chapter,section,' + \. 'subsection,subsubsection,paragraph' + endif + + " the order in which these calls are made decides the nestedness. in + " latex, a table environment will always be embedded in either an item or + " a section etc. not the other way around. so we first fold up all the + " tables. and then proceed with the other regions. + + let b:numFoldItems = 0 + + " ======================================================================== + " How to add new folding items {{{ + " ======================================================================== + " + " Each of the following function calls defines a syntax fold region. Each + " definition consists of a call to the AddSyntaxFoldItem() function. + " + " The order in which the folds are defined is important. Juggling the + " order of the function calls will create havoc with folding. The + " "deepest" folding item needs to be called first. For example, if + " the \begin{table} environment is a subset (or lies within) the \section + " environment, then add the definition for the \table first. + " + " The AddSyntaxFoldItem() function takes either 4 or 6 arguments. When it + " is called with 4 arguments, it is equivalent to calling it with 6 + " arguments with the last two left blank (i.e as empty strings) + " + " The explanation for each argument is as follows: + " startpat: a line matching this pattern defines the beginning of a fold. + " endpat : a line matching this pattern defines the end of a fold. + " startoff: this is the offset from the starting line at which folding will + " actually start + " endoff : like startoff, but gives the offset of the actual fold end from + " the line satisfying endpat. + " startoff and endoff are necessary when the folding region does + " not have a specific end pattern corresponding to a start + " pattern. for example in latex, + " \begin{section} + " defines the beginning of a section, but its not necessary to + " have a corresponding + " \end{section} + " the section is assumed to end 1 line _before_ another section + " starts. + " startskip: a pattern which defines the beginning of a "skipped" region. + " + " For example, suppose we define a \itemize fold as follows: + " startpat = '^\s*\\item', + " endpat = '^\s*\\item\|^\s*\\end{\(enumerate\|itemize\|description\)}', + " startoff = 0, + " endoff = -1 + " + " This defines a fold which starts with a line beginning with an + " \item and ending one line before a line beginning with an + " \item or \end{enumerate} etc. + " + " Then, as long as \item's are not nested things are fine. + " However, once items begin to nest, the fold started by one + " \item can end because of an \item in an \itemize + " environment within this \item. i.e, the following can happen: + " + " \begin{itemize} + " \item Some text <------- fold will start here + " This item will contain a nested item + " \begin{itemize} <----- fold will end here because next line contains \item... + " \item Hello + " \end{itemize} <----- ... instead of here. + " \item Next item of the parent itemize + " \end{itemize} + " + " Therefore, in order to completely define a folding item which + " allows nesting, we need to also define a "skip" pattern. + " startskip and end skip do that. + " Leave '' when there is no nesting. + " endskip: the pattern which defines the end of the "skip" pattern for + " nested folds. + " + " Example: + " 1. A syntax fold region for a latex section is + " startpat = "\\section{" + " endpat = "\\section{" + " startoff = 0 + " endoff = -1 + " startskip = '' + " endskip = '' + " Note that the start and end patterns are thus the same and endoff has a + " negative value to capture the effect of a section ending one line before + " the next starts. + " 2. A syntax fold region for the \itemize environment is: + " startpat = '^\s*\\item', + " endpat = '^\s*\\item\|^\s*\\end{\(enumerate\|itemize\|description\)}', + " startoff = 0, + " endoff = -1, + " startskip = '^\s*\\begin{\(enumerate\|itemize\|description\)}', + " endskip = '^\s*\\end{\(enumerate\|itemize\|description\)}' + " Note the use of startskip and endskip to allow nesting. + " + " + " }}} + " ======================================================================== + + " {{{ comment lines + if g:Tex_FoldedMisc =~ '\<comments\>' + call AddSyntaxFoldItem ( + \ '^%\([^%]\|[^f]\|[^a]\|[^k]\|[^e]\)', + \ '^[^%]', + \ 0, + \ -1 + \ ) + endif + " }}} + + " {{{ items + if g:Tex_FoldedMisc =~ '\<item\>' + call AddSyntaxFoldItem ( + \ '^\s*\\item', + \ '^\s*\\item\|^\s*\\end{\(enumerate\|itemize\|description\)}', + \ 0, + \ -1, + \ '^\s*\\begin{\(enumerate\|itemize\|description\)}', + \ '^\s*\\end{\(enumerate\|itemize\|description\)}' + \ ) + endif + " }}} + + " {{{ title + if g:Tex_FoldedMisc =~ '\<title\>' + call AddSyntaxFoldItem ( + \ '^\s*\\title\W', + \ '^\s*\\maketitle', + \ 0, + \ 0 + \ ) + endif + " }}} + + " Commands and Environments {{{ + " Fold the commands and environments in 2 passes. + let pass = 0 + while pass < 2 + if pass == 0 + let lst = g:Tex_FoldedCommands + else + let lst = g:Tex_FoldedEnvironments + endif + while lst != '' + let i = match(lst, ',') + if i > 0 + let s = strpart(lst, 0, i) + let lst = strpart(lst, i+1) + else + let s = lst + let lst = '' + endif + if s != '' + if pass == 0 + " NOTE: This pattern ensures that a command which is + " terminated on the same line will not start a fold. + " However, it will also refuse to fold certain commands + " which have not terminated. eg: + " \commandname{something \bf{text} and + " will _not_ start a fold. + " In other words, the pattern is safe, but not exact. + call AddSyntaxFoldItem('^\s*\\'.s.'{[^{}]*$','^[^}]*}',0,0) + else + call AddSyntaxFoldItem('^\s*\\begin{'.s,'\(^\|\s\)\s*\\end{'.s,0,0) + endif + endif + endwhile + let pass = pass + 1 + endwhile + " }}} + + " Sections {{{ + if g:Tex_FoldedSections != '' + call Tex_FoldSections(g:Tex_FoldedSections, + \ '^\s*\\frontmatter\|^\s*\\mainmatter\|^\s*\\backmatter\|' + \. '^\s*\\begin{thebibliography\|>>>\|^\s*\\endinput\|' + \. '^\s*\\begin{slide\|^\s*\\end{document') + endif + " }}} + + " {{{ slide + if g:Tex_FoldedMisc =~ '\<slide\>' + call AddSyntaxFoldItem ( + \ '^\s*\\begin{slide', + \ '^\s*\\appendix\W\|^\s*\\chapter\W\|^\s*\\end{slide\|^\s*\\end{document', + \ 0, + \ 0 + \ ) + endif + " }}} + + " {{{ preamble + if g:Tex_FoldedMisc =~ '\<preamble\>' + call AddSyntaxFoldItem ( + \ '^\s*\\document\(class\|style\).*{', + \ '^\s*\\begin{document}', + \ 0, + \ -1 + \ ) + endif + " }}} + + " Manually folded regions {{{ + if g:Tex_FoldedMisc =~ '\(^\|,\)<<<\(,\|$\)' + call AddSyntaxFoldItem ( + \ '<<<', + \ '>>>', + \ 0, + \ 0 + \ ) + endif + " }}} + + call MakeSyntaxFolds(a:force) + normal! zv +endfunction + +" }}} +" TexFoldTextFunction: create fold text for folds {{{ +function! TexFoldTextFunction() + let leadingSpace = matchstr(' ', ' \{,'.indent(v:foldstart).'}') + if getline(v:foldstart) =~ '^\s*\\begin{' + let header = matchstr(getline(v:foldstart), + \ '^\s*\\begin{\zs\([:alpha:]*\)[^}]*\ze}') + let caption = '' + let label = '' + let i = v:foldstart + while i <= v:foldend + if getline(i) =~ '\\caption' + " distinguish between + " \caption{fulldesc} - fulldesc will be displayed + " \caption[shortdesc]{fulldesc} - shortdesc will be displayed + if getline(i) =~ '\\caption\[' + let caption = matchstr(getline(i), '\\caption\[\zs[^\]]*') + let caption = substitute(caption, '\zs\]{.*}[^}]*$', '', '') + else + let caption = matchstr(getline(i), '\\caption{\zs.*') + let caption = substitute(caption, '\zs}[^}]*$', '', '') + end + elseif getline(i) =~ '\\label' + let label = matchstr(getline(i), '\\label{\zs.*') + " :FIXME: this does not work when \label contains a + " newline or a }-character + let label = substitute(label, '\([^}]*\)}.*$', '\1', '') + end + + let i = i + 1 + endwhile + + let ftxto = foldtext() + " if no caption found, then use the second line. + if caption == '' + let caption = getline(v:foldstart + 1) + end + + let retText = matchstr(ftxto, '^[^:]*').': '.header. + \ ' ('.label.'): '.caption + return leadingSpace.retText + + elseif getline(v:foldstart) =~ '^%' && getline(v:foldstart) !~ '^%%fake' + let ftxto = foldtext() + return leadingSpace.substitute(ftxto, ':', ': % ', '') + elseif getline(v:foldstart) =~ '^\s*\\document\(class\|style\).*{' + let ftxto = leadingSpace.foldtext() + return substitute(ftxto, ':', ': Preamble: ', '') + else + return leadingSpace.foldtext() + end +endfunction +" }}} + +" vim:fdm=marker:ff=unix:noet:ts=4:sw=4 diff --git a/.vim/ftplugin/latex-suite/macros/example b/.vim/ftplugin/latex-suite/macros/example @@ -0,0 +1,11 @@ +% my long complicated macro. This is an example of how to set up a +% tex-macro for latex-suite. simply type in the lines as you would in +% latex. Place holders are allowed. +% NOTE: if you have filetype indentation turned on, then do not do +% formatting here. the indentation will follow automatically... +\begin{mycomplicatedenvironment} +\mycommand1{<++>} +\mycommand2{<+hint2+>} +\mycommand3{<++>} +\mycommand4{<++>} +\end{mycomplicatedenvironment}<++> diff --git a/.vim/ftplugin/latex-suite/main.vim b/.vim/ftplugin/latex-suite/main.vim @@ -0,0 +1,1042 @@ +" LaTeX filetype +" Language: LaTeX (ft=tex) +" Maintainer: Srinath Avadhanula +" CVS: $Id: main.vim 1109 2010-10-07 20:19:23Z tmaas $ +" URL: + +" line continuation used here. +let s:save_cpo = &cpo +set cpo&vim + +" avoiding re-inclusion {{{ +" the avoiding re-inclusion statement is not provided here because the files +" which call this file should in the normal course of events handle the +" re-inclusion stuff. + +" we definitely dont want to run through the entire file each and every time. +" only once to define the functions. for successive latex files, just set up +" the folding and mappings and quit. +if exists('s:doneFunctionDefinitions') && !exists('b:forceRedoLocalTex') + call s:SetTeXOptions() + finish +endif + +let s:doneFunctionDefinitions = 1 + +" get the place where this plugin resides for setting cpt and dict options. +" these lines need to be outside the function. +let s:path = expand('<sfile>:p:h') +" set up personal defaults. +runtime ftplugin/tex/texrc +" set up global defaults. +exe "so ".fnameescape(s:path.'/texrc') + +" }}} + +nmap <silent> <script> <plug> i +imap <silent> <script> <C-o><plug> <Nop> + +" ============================================================================== +" mappings +" ============================================================================== +" {{{ +" calculate the mapleader character. +let s:ml = '<Leader>' + +if !exists('s:doneMappings') + let s:doneMappings = 1 + " short forms for latex formatting and math elements. {{{ + " taken from auctex.vim or miktexmacros.vim + call IMAP ('__', '_{<++>}<++>', "tex") + call IMAP ('()', '(<++>)<++>', "tex") + call IMAP ('[]', '[<++>]<++>', "tex") + call IMAP ('{}', '{<++>}<++>', "tex") + call IMAP ('^^', '^{<++>}<++>', "tex") + call IMAP ('$$', '$<++>$<++>', "tex") + call IMAP ('==', '&=& ', "tex") + call IMAP ('~~', '&\approx& ', "tex") + call IMAP ('=~', '\approx', "tex") + call IMAP ('::', '\dots', "tex") + call IMAP ('((', '\left( <++> \right)<++>', "tex") + call IMAP ('[[', '\left[ <++> \right]<++>', "tex") + call IMAP ('{{', '\left\{ <++> \right\}<++>', "tex") + call IMAP (g:Tex_Leader.'^', '\hat{<++>}<++>', "tex") + call IMAP (g:Tex_Leader.'_', '\bar{<++>}<++>', "tex") + call IMAP (g:Tex_Leader.'6', '\partial', "tex") + call IMAP (g:Tex_Leader.'8', '\infty', "tex") + call IMAP (g:Tex_Leader.'/', '\frac{<++>}{<++>}<++>', "tex") + call IMAP (g:Tex_Leader.'%', '\frac{<++>}{<++>}<++>', "tex") + call IMAP (g:Tex_Leader.'@', '\circ', "tex") + call IMAP (g:Tex_Leader.'0', '^\circ', "tex") + call IMAP (g:Tex_Leader.'=', '\equiv', "tex") + call IMAP (g:Tex_Leader."\\",'\setminus', "tex") + call IMAP (g:Tex_Leader.'.', '\cdot', "tex") + call IMAP (g:Tex_Leader.'*', '\times', "tex") + call IMAP (g:Tex_Leader.'&', '\wedge', "tex") + call IMAP (g:Tex_Leader.'-', '\bigcap', "tex") + call IMAP (g:Tex_Leader.'+', '\bigcup', "tex") + call IMAP (g:Tex_Leader.'M', '\sum_{<++>}^{<++>}<++>', 'tex') + call IMAP (g:Tex_Leader.'S', '\sum_{<++>}^{<++>}<++>', 'tex') + call IMAP (g:Tex_Leader.'(', '\subset', "tex") + call IMAP (g:Tex_Leader.')', '\supset', "tex") + call IMAP (g:Tex_Leader.'<', '\le', "tex") + call IMAP (g:Tex_Leader.'>', '\ge', "tex") + call IMAP (g:Tex_Leader.',', '\nonumber', "tex") + call IMAP (g:Tex_Leader.'~', '\tilde{<++>}<++>', "tex") + call IMAP (g:Tex_Leader.';', '\dot{<++>}<++>', "tex") + call IMAP (g:Tex_Leader.':', '\ddot{<++>}<++>', "tex") + call IMAP (g:Tex_Leader.'2', '\sqrt{<++>}<++>', "tex") + call IMAP (g:Tex_Leader.'|', '\Big|', "tex") + call IMAP (g:Tex_Leader.'I', "\\int_{<++>}^{<++>}<++>", 'tex') + " }}} + " Greek Letters {{{ + call IMAP(g:Tex_Leader.'a', '\alpha', 'tex') + call IMAP(g:Tex_Leader.'b', '\beta', 'tex') + call IMAP(g:Tex_Leader.'c', '\chi', 'tex') + call IMAP(g:Tex_Leader.'d', '\delta', 'tex') + call IMAP(g:Tex_Leader.'e', '\varepsilon', 'tex') + call IMAP(g:Tex_Leader.'f', '\varphi', 'tex') + call IMAP(g:Tex_Leader.'g', '\gamma', 'tex') + call IMAP(g:Tex_Leader.'h', '\eta', 'tex') + call IMAP(g:Tex_Leader.'k', '\kappa', 'tex') + call IMAP(g:Tex_Leader.'l', '\lambda', 'tex') + call IMAP(g:Tex_Leader.'m', '\mu', 'tex') + call IMAP(g:Tex_Leader.'n', '\nu', 'tex') + call IMAP(g:Tex_Leader.'p', '\pi', 'tex') + call IMAP(g:Tex_Leader.'q', '\theta', 'tex') + call IMAP(g:Tex_Leader.'r', '\rho', 'tex') + call IMAP(g:Tex_Leader.'s', '\sigma', 'tex') + call IMAP(g:Tex_Leader.'t', '\tau', 'tex') + call IMAP(g:Tex_Leader.'u', '\upsilon', 'tex') + call IMAP(g:Tex_Leader.'v', '\varsigma', 'tex') + call IMAP(g:Tex_Leader.'w', '\omega', 'tex') + call IMAP(g:Tex_Leader.'w', '\wedge', 'tex') " AUCTEX style + call IMAP(g:Tex_Leader.'x', '\xi', 'tex') + call IMAP(g:Tex_Leader.'y', '\psi', 'tex') + call IMAP(g:Tex_Leader.'z', '\zeta', 'tex') + " not all capital greek letters exist in LaTeX! + " reference: http://www.giss.nasa.gov/latex/ltx-405.html + call IMAP(g:Tex_Leader.'D', '\Delta', 'tex') + call IMAP(g:Tex_Leader.'F', '\Phi', 'tex') + call IMAP(g:Tex_Leader.'G', '\Gamma', 'tex') + call IMAP(g:Tex_Leader.'Q', '\Theta', 'tex') + call IMAP(g:Tex_Leader.'L', '\Lambda', 'tex') + call IMAP(g:Tex_Leader.'X', '\Xi', 'tex') + call IMAP(g:Tex_Leader.'Y', '\Psi', 'tex') + call IMAP(g:Tex_Leader.'S', '\Sigma', 'tex') + call IMAP(g:Tex_Leader.'U', '\Upsilon', 'tex') + call IMAP(g:Tex_Leader.'W', '\Omega', 'tex') + " }}} + " ProtectLetters: sets up indentity maps for things like ``a {{{ + " " Description: If we simply do + " call IMAP('`a', '\alpha', 'tex') + " then we will never be able to type 'a' after a tex-quotation. Since + " IMAP() always uses the longest map ending in the letter, this problem + " can be avoided by creating a fake map for ``a -> ``a. + " This function sets up fake maps of the following forms: + " ``[aA] -> ``[aA] (for writing in quotations) + " \`[aA] -> \`[aA] (for writing diacritics) + " "`[aA] -> "`[aA] (for writing german quotations) + " It does this for all printable lower ascii characters just to make sure + " we dont let anything slip by. + function! s:ProtectLetters(first, last) + let i = a:first + while i <= a:last + if nr2char(i) =~ '[[:print:]]' + call IMAP('``'.nr2char(i), '``'.nr2char(i), 'tex') + call IMAP('\`'.nr2char(i), '\`'.nr2char(i), 'tex') + call IMAP('"`'.nr2char(i), '"`'.nr2char(i), 'tex') + endif + let i = i + 1 + endwhile + endfunction + call s:ProtectLetters(32, 127) + " }}} + " vmaps: enclose selected region in brackets, environments {{{ + " The action changes depending on whether the selection is character-wise + " or line wise. for example, selecting linewise and pressing \v will + " result in the region being enclosed in \begin{verbatim}, \end{verbatim}, + " whereas in characterise visual mode, the thingie is enclosed in \verb| + " and |. + exec 'vnoremap <silent> '.g:Tex_Leader."( \<C-\\>\<C-N>:call VEnclose('\\left( ', ' \\right)', '\\left(', '\\right)')\<CR>" + exec 'vnoremap <silent> '.g:Tex_Leader."[ \<C-\\>\<C-N>:call VEnclose('\\left[ ', ' \\right]', '\\left[', '\\right]')\<CR>" + exec 'vnoremap <silent> '.g:Tex_Leader."{ \<C-\\>\<C-N>:call VEnclose('\\left\\{ ', ' \\right\\}', '\\left\\{', '\\right\\}')\<CR>" + exec 'vnoremap <silent> '.g:Tex_Leader."$ \<C-\\>\<C-N>:call VEnclose('$', '$', '\\[', '\\]')\<CR>" + " }}} +end + +" }}} + +" ============================================================================== +" Helper functions for debugging +" ============================================================================== +" Tex_Debug: appends the argument into s:debugString {{{ +" Description: +" +" Do not want a memory leak! Set this to zero so that latex-suite always +" starts out in a non-debugging mode. +if !exists('g:Tex_Debug') + let g:Tex_Debug = 0 +endif +function! Tex_Debug(str, ...) + if !g:Tex_Debug + return + endif + if a:0 > 0 + let pattern = a:1 + else + let pattern = '' + endif + if !exists('s:debugString_'.pattern) + let s:debugString_{pattern} = '' + endif + let s:debugString_{pattern} = s:debugString_{pattern}.a:str."\n" + + let s:debugString_ = (exists('s:debugString_') ? s:debugString_ : '') + \ . pattern.' : '.a:str."\n" + + if Tex_GetVarValue('Tex_DebugLog') != '' + exec 'redir! >> '.Tex_GetVarValue('Tex_DebugLog') + silent! echo pattern.' : '.a:str + redir END + endif +endfunction " }}} +" Tex_PrintDebug: prings s:debugString {{{ +" Description: +" +function! Tex_PrintDebug(...) + if a:0 > 0 + let pattern = a:1 + else + let pattern = '' + endif + if exists('s:debugString_'.pattern) + echo s:debugString_{pattern} + endif +endfunction " }}} +" Tex_ClearDebug: clears the s:debugString string {{{ +" Description: +" +function! Tex_ClearDebug(...) + if a:0 > 0 + let pattern = a:1 + else + let pattern = '' + endif + if exists('s:debugString_'.pattern) + let s:debugString_{pattern} = '' + endif +endfunction " }}} +" Tex_ShowVariableValue: debugging help {{{ +" provides a way to examine script local variables from outside the script. +" very handy for debugging. +function! Tex_ShowVariableValue(...) + let i = 1 + while i <= a:0 + exe 'let arg = a:'.i + if exists('s:'.arg) || + \ exists('*s:'.arg) + exe 'let val = s:'.arg + echomsg 's:'.arg.' = '.val + end + let i = i + 1 + endwhile +endfunction + +" }}} + +" ============================================================================== +" Helper functions for grepping +" ============================================================================== +" Tex_Grep: shorthand for :grep or :vimgrep {{{ +function! Tex_Grep(string, where) + if v:version >= 700 + exec 'silent! vimgrep! /'.a:string.'/ '.a:where + else + exec 'silent! grep! '.Tex_EscapeForGrep(a:string).' '.a:where + endif +endfunction + +" }}} +" Tex_Grepadd: shorthand for :grepadd or :vimgrepadd {{{ +function! Tex_Grepadd(string, where) + if v:version >= 700 + exec 'silent! vimgrepadd! /'.a:string.'/ '.a:where + else + exec "silent! grepadd! ".Tex_EscapeForGrep(a:string).' '.a:where + endif +endfunction + +" }}} +" Tex_EscapeForGrep: escapes back-slashes and doublequotes the correct number of times {{{ +" Description: This command escapes the backslash and double quotes in a +" search pattern the correct number of times so it can be used in the ``:grep`` +" command. This command is meant to be used as:: +" +" exec "silent! grep ".Tex_EscapeForGrep(pattern)." file" +" +" The input argument to this function should be the string which you want +" the external command to finally see. For example, to search for a string +" ``'\bibitem'``, the grep command needs to be passed a string like +" ``'\\bibitem'``. Examples:: +" +" Tex_EscapeForGrep('\\bibitem') " correct +" Tex_EscapeForGrep('\bibitem') " wrong +" Tex_EscapeForGrep("\\bibitem") " wrong +" Tex_EscapeForGrep('\<word\>') " correct +" +function! Tex_EscapeForGrep(string) + let retVal = a:string + + " The shell halves the backslashes. + if &shell =~ 'sh' + let retVal = escape(retVal, "\\") + + " If shellxquote is set, then the backslashes are halved yet again. + if &shellxquote == '"' + let retVal = escape(retVal, "\"\\") + endif + + endif + " escape special characters which bash/cmd.exe might interpret + let retVal = escape(retVal, "<>") + + return retVal +endfunction " }}} + +" ============================================================================== +" Uncategorized helper functions +" ============================================================================== +" Tex_Strntok: extract the n^th token from a list {{{ +" example: Strntok('1,23,3', ',', 2) = 23 +fun! Tex_Strntok(s, tok, n) + return matchstr( a:s.a:tok[0], '\v(\zs([^'.a:tok.']*)\ze['.a:tok.']){'.a:n.'}') +endfun + +" }}} +" Tex_CreatePrompt: creates a prompt string {{{ +" Description: +" Arguments: +" promptList: This is a string of the form: +" 'item1,item2,item3,item4' +" cols: the number of columns in the resultant prompt +" sep: the list seperator token +" +" Example: +" Tex_CreatePrompt('item1,item2,item3,item4', 2, ',') +" returns +" "(1) item1\t(2)item2\n(3)item3\t(4)item4" +" +" This string can be used in the input() function. +function! Tex_CreatePrompt(promptList, cols, sep) + + let g:listSep = a:sep + let num_common = GetListCount(a:promptList) + + let i = 1 + let promptStr = "" + + while i <= num_common + + let j = 0 + while j < a:cols && i + j <= num_common + let com = Tex_Strntok(a:promptList, a:sep, i+j) + let promptStr = promptStr.'('.(i+j).') '. + \ com."\t".( strlen(com) < 4 ? "\t" : '' ) + + let j = j + 1 + endwhile + + let promptStr = promptStr."\n" + + let i = i + a:cols + endwhile + return promptStr +endfunction + +" }}} +" Tex_CleanSearchHistory: removes last search item from search history {{{ +" Description: This function needs to be globally visible because its +" called from outside the script during expansion. +function! Tex_CleanSearchHistory() + call histdel("/", -1) + let @/ = histget("/", -1) +endfunction +nmap <silent> <script> <plug>cleanHistory :call Tex_CleanSearchHistory()<CR> + +" }}} +" Tex_GetVarValue: gets the value of the variable {{{ +" Description: +" See if a window-local, buffer-local or global variable with the given name +" exists and if so, returns the corresponding value. If none exist, return +" an empty string. +function! Tex_GetVarValue(varname, ...) + if exists('w:'.a:varname) + return w:{a:varname} + elseif exists('b:'.a:varname) + return b:{a:varname} + elseif exists('g:'.a:varname) + return g:{a:varname} + elseif a:0 > 0 + return a:1 + else + return '' + endif +endfunction " }}} +" Tex_GetMainFileName: gets the name of the main file being compiled. {{{ +" Description: returns the full path name of the main file. +" This function checks for the existence of a .latexmain file +" which might point to the location of a "main" latex file. +" If .latexmain exists, then return the full path name of the +" file being pointed to by it. +" +" Otherwise, return the full path name of the current buffer. +" +" You can supply an optional "modifier" argument to the +" function, which will optionally modify the file name before +" returning. +" NOTE: From version 1.6 onwards, this function always trims +" away the .latexmain part of the file name before applying the +" modifier argument. +function! Tex_GetMainFileName(...) + if a:0 > 0 + let modifier = a:1 + else + let modifier = ':p' + endif + + " If the user wants to use his own way to specify the main file name, then + " use it straight away. + if Tex_GetVarValue('Tex_MainFileExpression') != '' + exec 'let retval = '.Tex_GetVarValue('Tex_MainFileExpression') + return retval + endif + + let s:origdir = fnameescape(getcwd()) + + let dirmodifier = '%:p:h' + let dirLast = fnameescape(expand(dirmodifier)) + exe 'cd '.dirLast + + " move up the directory tree until we find a .latexmain file. + " TODO: Should we be doing this recursion by default, or should there be a + " setting? + while glob('*.latexmain') == '' + let dirmodifier = dirmodifier.':h' + let dirNew = fnameescape(expand(dirmodifier)) + " break from the loop if we cannot go up any further. + if dirNew == dirLast + break + endif + let dirLast = dirNew + exe 'cd '.dirLast + endwhile + + let lheadfile = glob('*.latexmain') + if lheadfile != '' + " Remove the trailing .latexmain part of the filename... We never want + " that. + let lheadfile = fnamemodify(substitute(lheadfile, '\.latexmain$', '', ''), modifier) + else + " If we cannot find any main file, just modify the filename of the + " current buffer. + let lheadfile = expand('%'.modifier) + endif + + exe 'cd '.s:origdir + + " NOTE: The caller of this function needs to escape the file name with + " fnameescape() . The reason its not done here is that escaping is not + " safe if this file is to be used as part of an external command on + " certain platforms. + return lheadfile +endfunction + +" }}} +" Tex_ChooseFromPrompt: process a user input to a prompt string {{{ +" " Description: +function! Tex_ChooseFromPrompt(dialog, list, sep) + let g:Tex_ASDF = a:dialog + let inp = input(a:dialog) + if inp =~ '\d\+' + return Tex_Strntok(a:list, a:sep, inp) + else + return inp + endif +endfunction " }}} +" Tex_ChooseFile: produces a file list and prompts for choice {{{ +" Description: +function! Tex_ChooseFile(dialog) + let files = glob('*') + if files == '' + return '' + endif + let s:incnum = 0 + echo a:dialog + let filenames = substitute(files, "\\v(^|\n)", "\\=submatch(0).Tex_IncrementNumber(1).' : '", 'g') + echo filenames + let choice = input('Enter Choice : ') + let g:choice = choice + if choice == '' + return '' + endif + if choice =~ '^\s*\d\+\s*$' + let retval = Tex_Strntok(files, "\n", choice) + else + let filescomma = substitute(files, "\n", ",", "g") + let retval = GetListMatchItem(filescomma, choice) + endif + if retval == '' + return '' + endif + return retval +endfunction + +" }}} +" Tex_IncrementNumber: returns an incremented number each time {{{ +" Description: +let s:incnum = 0 +function! Tex_IncrementNumber(increm) + let s:incnum = s:incnum + a:increm + return s:incnum +endfunction + +" }}} +" Tex_ResetIncrementNumber: increments s:incnum to zero {{{ +" Description: +function! Tex_ResetIncrementNumber(val) + let s:incnum = a:val +endfunction " }}} +" Tex_FindInRtp: check if file exists in &rtp {{{ +" Description: Checks if file exists in globpath(&rtp, ...) and cuts off the +" rest of returned names. This guarantees that sourced file is +" from $HOME. +" If an optional argument is given, it specifies how to expand +" each filename found. For example, '%:p' will return a list of +" the complete paths to the files. By default returns trailing +" path-names without extenions. +" NOTE: This function is very slow when a large number of +" matches are found because of a while loop which modifies +" each filename found. Some speedup was acheived by using +" a tokenizer approach rather than using Tex_Strntok which +" would have been more obvious. +function! Tex_FindInRtp(filename, directory, ...) + " how to expand each filename. ':p:t:r' modifies each filename to its + " trailing part without extension. + let expand = (a:0 > 0 ? a:1 : ':p:t:r') + " The pattern used... An empty filename should be regarded as '*' + let pattern = (a:filename != '' ? a:filename : '*') + + let filelist = globpath(&rtp, 'ftplugin/latex-suite/'.a:directory.'/'.pattern)."\n" + + if filelist == "\n" + return '' + endif + + if a:filename != '' + return fnamemodify(Tex_Strntok(filelist, "\n", 1), expand) + endif + + " Now cycle through the files modifying each filename in the desired + " manner. + let retfilelist = '' + let i = 1 + while 1 + " Extract the portion till the next newline. Then shorten the filelist + " by removing till the newline. + let nextnewline = stridx(filelist, "\n") + if nextnewline == -1 + break + endif + let filename = strpart(filelist, 0, nextnewline) + let filelist = strpart(filelist, nextnewline+1) + + " The actual modification. + if fnamemodify(filename, expand) != '' + let retfilelist = retfilelist.fnamemodify(filename, expand)."," + endif + let i = i + 1 + endwhile + + return substitute(retfilelist, ',$', '', '') +endfunction + +" }}} +" Tex_GetErrorList: returns vim's clist {{{ +" Description: returns the contents of the error list available via the :clist +" command. +function! Tex_GetErrorList() + let _a = @a + redir @a | silent! clist | redir END + let errlist = @a + let @a = _a + + if errlist =~ 'E42: ' + let errlist = '' + endif + + return errlist +endfunction " }}} +" Tex_GetTempName: get the name of a temporary file in specified directory {{{ +" Description: Unlike vim's native tempname(), this function returns the name +" of a temporary file in the directory specified. This enables +" us to create temporary files in a specified directory. +function! Tex_GetTempName(dirname) + let prefix = 'latexSuiteTemp' + let slash = (a:dirname =~ '\\\|/$' ? '' : '/') + let i = 0 + while filereadable(a:dirname.slash.prefix.i.'.tex') && i < 1000 + let i = i + 1 + endwhile + if filereadable(a:dirname.slash.prefix.i.'.tex') + echoerr "Temporary file could not be created in ".a:dirname + return '' + endif + return expand(a:dirname.slash.prefix.i.'.tex', ':p') +endfunction +" }}} +" Tex_MakeMap: creates a mapping from lhs to rhs if rhs is not already mapped {{{ +" Description: +function! Tex_MakeMap(lhs, rhs, mode, extraargs) + if !hasmapto(a:rhs, a:mode) + exec a:mode.'map '.a:extraargs.' '.a:lhs.' '.a:rhs + endif +endfunction " }}} +" Tex_CD: cds to given directory escaping spaces if necessary {{{ +" " Description: +function! Tex_CD(dirname) + exec 'cd '.Tex_EscapeSpaces(a:dirname) +endfunction " }}} +" Tex_EscapeSpaces: escapes unescaped spaces from a path name {{{ +" Description: +function! Tex_EscapeSpaces(path) + return substitute(a:path, '[^\\]\(\\\\\)*\zs ', '\\ ', 'g') +endfunction " }}} +" Tex_FindFile: finds a file in the vim's 'path' {{{ +" Description: finds a file in vim's 'path' +function! Tex_FindFile(fname, path, suffixesadd) + if exists('*findfile') + let _suffixesadd = &suffixesadd + let &suffixesadd = a:suffixesadd + let retval = findfile(a:fname, a:path) + let &suffixesadd = _suffixesadd + else + " split a new window so we do not screw with the current buffer. We + " want to use the same filename each time so that multiple scratch + " buffers are not created. + let retval = '' + silent! split __HOPEFULLY_THIS_FILE_DOES_NOT_EXIST__ + let _suffixesadd = &suffixesadd + let _path = &path + let &suffixesadd = a:suffixesadd + let &path = a:path + exec 'silent! find '.a:fname + if bufname('%') != '__HOPEFULLY_THIS_FILE_DOES_NOT_EXIST__' + let retval = expand('%:p') + end + silent! bdelete! + let &suffixesadd = _suffixesadd + let &path = _path + endif + return retval +endfunction " }}} +" Tex_GetPos: gets position of cursor {{{ +function! Tex_GetPos() + if exists('*getpos') + return getpos('.') + else + return line('.').' | normal! '.virtcol('.').'|' + endif +endfunction " }}} +" Tex_SetPos: sets position of cursor {{{ +function! Tex_SetPos(pos) + if exists('*setpos') + call setpos('.', a:pos) + else + exec a:pos + endif +endfunction " }}} + + +" ============================================================================== +" Smart key-mappings +" ============================================================================== +" TexQuotes: inserts `` or '' instead of " {{{ +if g:Tex_SmartKeyQuote + + " TexQuotes: inserts `` or '' instead of " + " Taken from texmacro.vim by Benji Fisher <benji@e-math.AMS.org> + " TODO: Deal with nested quotes. + " The :imap that calls this function should insert a ", move the cursor to + " the left of that character, then call this with <C-R>= . + function! s:TexQuotes() + let l = line(".") + let c = col(".") + let restore_cursor = l . "G" . virtcol(".") . "|" + normal! H + let restore_cursor = "normal!" . line(".") . "Gzt" . restore_cursor + execute restore_cursor + " In math mode, or when preceded by a \, just move the cursor past the + " already-inserted " character. + if synIDattr(synID(l, c, 1), "name") =~ "^texMath" + \ || (c > 1 && getline(l)[c-2] == '\') + return "\<Right>" + endif + " Find the appropriate open-quote and close-quote strings. + if exists("b:Tex_SmartQuoteOpen") + let open = b:Tex_SmartQuoteOpen + elseif exists("g:Tex_SmartQuoteOpen") + let open = g:Tex_SmartQuoteOpen + else + let open = "``" + endif + if exists("b:Tex_SmartQuoteClose") + let close = b:Tex_SmartQuoteClose + elseif exists("g:Tex_SmartQuoteClose") + let close = g:Tex_SmartQuoteClose + else + let close = "''" + endif + let boundary = '\|' + " This code seems to be obsolete, since this script variable is never + " set. The idea is that some languages use ",," as an open- or + " close-quote string, and we want to avoid confusing ordinary "," + " with a quote boundary. + if exists("s:TeX_strictquote") + if( s:TeX_strictquote == "open" || s:TeX_strictquote == "both" ) + let boundary = '\<' . boundary + endif + if( s:TeX_strictquote == "close" || s:TeX_strictquote == "both" ) + let boundary = boundary . '\>' + endif + endif + + " Eventually return q; set it to the default value now. + let q = open + let pattern = + \ escape(open, '\~') . + \ boundary . + \ escape(close, '\~') . + \ '\|^$\|"' + + while 1 " Look for preceding quote (open or close), ignoring + " math mode and '\"' . + call search(pattern, "bw") + if synIDattr(synID(line("."), col("."), 1), "name") !~ "^texMath" + \ && strpart(getline('.'), col('.')-2, 2) != '\"' + break + endif + endwhile + + " Now, test whether we actually found a _preceding_ quote; if so, is it + " an open quote? + if ( line(".") < l || line(".") == l && col(".") < c ) + if strpart(getline("."), col(".")-1) =~ '\V\^' . escape(open, '\') + if line(".") == l && col(".") + strlen(open) == c + " Insert "<++>''<++>" instead of just "''". + let q = IMAP_PutTextWithMovement("<++>".close."<++>") + else + let q = close + endif + endif + endif + + " Return to line l, column c: + execute restore_cursor + " Start with <Del> to remove the " put in by the :imap . + return "\<Del>" . q + + endfunction + +endif +" }}} +" SmartBS: smart backspacing {{{ +if g:Tex_SmartKeyBS + + " SmartBS: smart backspacing + " SmartBS lets you treat diacritic characters (those \'{a} thingies) as a + " single character. This is useful for example in the following situation: + " + " \v{s}\v{t}astn\'{y} ('happy' in Slovak language :-) ) + " If you will delete this normally (without using smartBS() function), you + " must press <BS> about 19x. With function smartBS() you must press <BS> only + " 7x. Strings like "\v{s}", "\'{y}" are considered like one character and are + " deleted with one <BS>. + let s:smartBS_pat = Tex_GetVarValue('Tex_SmartBSPattern') + + fun! s:SmartBS_pat() + return s:smartBS_pat + endfun + + " This function comes from Benji Fisher <benji@e-math.AMS.org> + " http://vim.sourceforge.net/scripts/download.php?src_id=409 + " (modified/patched by Lubomir Host 'rajo' <host8 AT keplerDOTfmphDOTuniba.sk>) + function! s:SmartBS(pat) + let init = strpart(getline("."), 0, col(".")-1) + let matchtxt = matchstr(init, a:pat) + if matchtxt != '' + let bstxt = substitute(matchtxt, '.', "\<bs>", 'g') + return bstxt + else + return "\<bs>" + endif + endfun + +endif " }}} +" SmartDots: inserts \cdots instead of ... in math mode otherwise \ldots {{{ +" if amsmath package is detected then just use \dots and let amsmath take care +" of it. +if g:Tex_SmartKeyDot + + function! <SID>SmartDots() + if strpart(getline('.'), col('.')-3, 2) == '..' && + \ g:Tex_package_detected =~ '\<amsmath\|ellipsis\>' + return "\<bs>\<bs>\\dots" + elseif synIDattr(synID(line('.'),col('.')-1,0),"name") =~ '^texMath' + \&& strpart(getline('.'), col('.')-3, 2) == '..' + return "\<bs>\<bs>\\cdots" + elseif strpart(getline('.'), col('.')-3, 2) == '..' + return "\<bs>\<bs>\\ldots" + else + return '.' + endif + endfunction + +endif +" }}} + +" source texproject.vim before other files +exe 'source '.fnameescape(s:path.'/texproject.vim') + +" source all the relevant files. +exe 'source '.fnameescape(s:path.'/texmenuconf.vim') +exe 'source '.fnameescape(s:path.'/envmacros.vim') +exe 'source '.fnameescape(s:path.'/elementmacros.vim') + +" source utf-8 or plain math menus +if exists("g:Tex_UseUtfMenus") && g:Tex_UseUtfMenus != 0 && has("gui_running") + exe 'source '.fnameescape(s:path.'/mathmacros-utf.vim') +else + exe 'source '.fnameescape(s:path.'/mathmacros.vim') +endif + +exe 'source '.fnameescape(s:path.'/multicompile.vim') +exe 'source '.fnameescape(s:path.'/compiler.vim') +exe 'source '.fnameescape(s:path.'/folding.vim') +exe 'source '.fnameescape(s:path.'/templates.vim') +exe 'source '.fnameescape(s:path.'/custommacros.vim') +exe 'source '.fnameescape(s:path.'/bibtex.vim') + +" source advanced math functions +if g:Tex_AdvancedMath == 1 + exe 'source '.fnameescape(s:path.'/brackets.vim') + exe 'source '.fnameescape(s:path.'/smartspace.vim') +endif + +if g:Tex_Diacritics != 0 + exe 'source '.fnameescape(s:path.'/diacritics.vim') +endif + +exe 'source '.fnameescape(s:path.'/texviewer.vim') +exe 'source '.fnameescape(s:path.'/version.vim') + +" ============================================================================== +" Finally set up the folding, options, mappings and quit. +" ============================================================================== +" SetTeXOptions: sets options/mappings for this file. {{{ +function! <SID>SetTeXOptions() + " Avoid reinclusion. + if exists('b:doneSetTeXOptions') + return + endif + let b:doneSetTeXOptions = 1 + + exe 'setlocal dict^='.fnameescape(s:path.'/dictionaries/dictionary') + + call Tex_Debug('SetTeXOptions: sourcing maps', 'main') + " smart functions + if g:Tex_SmartKeyQuote + inoremap <buffer> <silent> " "<Left><C-R>=<SID>TexQuotes()<CR> + endif + if g:Tex_SmartKeyBS + inoremap <buffer> <silent> <BS> <C-R>=<SID>SmartBS(<SID>SmartBS_pat())<CR> + endif + if g:Tex_SmartKeyDot + inoremap <buffer> <silent> . <C-R>=<SID>SmartDots()<CR> + endif + + " This line seems to be necessary to source our compiler/tex.vim file. + " The docs are unclear why this needs to be done even though this file is + " the first compiler plugin in 'runtimepath'. + runtime compiler/tex.vim + +endfunction + +augroup LatexSuite + au LatexSuite User LatexSuiteFileType + \ call Tex_Debug('main.vim: Catching LatexSuiteFileType event', 'main') | + \ call <SID>SetTeXOptions() +augroup END + +" }}} + +" ============================================================================== +" Settings for taglist.vim plugin +" ============================================================================== +" Sets Tlist_Ctags_Cmd for taglist.vim and regexps for ctags {{{ +if exists("g:Tex_TaglistSupport") && g:Tex_TaglistSupport == 1 + if !exists("g:tlist_tex_settings") + let g:tlist_tex_settings = 'tex;s:section;c:chapter;l:label;r:ref' + endif + + if exists("Tlist_Ctags_Cmd") + let s:tex_ctags = Tlist_Ctags_Cmd + else + let s:tex_ctags = 'ctags' " Configurable in texrc? + endif + + if exists("g:Tex_InternalTagsDefinitions") && g:Tex_InternalTagsDefinitions == 1 + let Tlist_Ctags_Cmd = s:tex_ctags ." --langdef=tex --langmap=tex:.tex.ltx.latex" + \.' --regex-tex="/\\\\begin{abstract}/Abstract/s,abstract/"' + \.' --regex-tex="/\\\\part[ \t]*\*?\{[ \t]*([^}]*)\}/\1/s,part/"' + \.' --regex-tex="/\\\\chapter[ \t]*\*?\{[ \t]*([^}]*)\}/\1/s,chapter/"' + \.' --regex-tex="/\\\\section[ \t]*\*?\{[ \t]*([^}]*)\}/\1/s,section/"' + \.' --regex-tex="/\\\\subsection[ \t]*\*?\{[ \t]*([^}]*)\}/+ \1/s,subsection/"' + \.' --regex-tex="/\\\\subsubsection[ \t]*\*?\{[ \t]*([^}]*)\}/+ \1/s,subsubsection/"' + \.' --regex-tex="/\\\\paragraph[ \t]*\*?\{[ \t]*([^}]*)\}/+ \1/s,paragraph/"' + \.' --regex-tex="/\\\\subparagraph[ \t]*\*?\{[ \t]*([^}]*)\}/+ \1/s,subparagraph/"' + \.' --regex-tex="/\\\\begin{thebibliography}/BIBLIOGRAPHY/s,thebibliography/"' + \.' --regex-tex="/\\\\tableofcontents/TABLE OF CONTENTS/s,tableofcontents/"' + \.' --regex-tex="/\\\\frontmatter/FRONTMATTER/s,frontmatter/"' + \.' --regex-tex="/\\\\mainmatter/MAINMATTER/s,mainmatter/"' + \.' --regex-tex="/\\\\backmatter/BACKMATTER/s,backmatter/"' + \.' --regex-tex="/\\\\appendix/APPENDIX/s,appendix/"' + \.' --regex-tex="/\\\\label[ \t]*\*?\{[ \t]*([^}]*)\}/\1/l,label/"' + \.' --regex-tex="/\\\\ref[ \t]*\*?\{[ \t]*([^}]*)\}/\1/r,ref/"' + endif +endif + +" }}} + +" commands to completion +let g:Tex_completion_explorer = ',' + +" Mappings defined in package files will overwrite all other +exe 'source '.fnameescape(s:path.'/packages.vim') + +" ============================================================================== +" These functions are used to immitate certain operating system type functions +" (like reading the contents of a file), which are not available in vim. For +" example, in Vim, its not possible to read the contents of a file without +" opening a buffer on it, which means that over time, lots of buffers can open +" up needlessly. +" +" If python is available (and allowed), then these functions utilize python +" library functions without making calls to external programs. +" ============================================================================== +" Tex_GotoTempFile: open a temp file. reuse from next time on {{{ +function! Tex_GotoTempFile() + if !exists('s:tempFileName') + let s:tempFileName = tempname() + endif + exec 'silent! split '.s:tempFileName +endfunction " }}} +" Tex_IsPresentInFile: finds if a string str, is present in filename {{{ +if has('python') && g:Tex_UsePython + function! Tex_IsPresentInFile(regexp, filename) + exec 'python isPresentInFile(r"'.a:regexp.'", r"'.a:filename.'")' + + return retval + endfunction +else + function! Tex_IsPresentInFile(regexp, filename) + call Tex_GotoTempFile() + + silent! 1,$ d _ + let _report = &report + let _sc = &sc + set report=9999999 nosc + exec 'silent! 0r! '.g:Tex_CatCmd.' '.a:filename + set nomod + let &report = _report + let &sc = _sc + + if search(a:regexp, 'w') + let retval = 1 + else + let retval = 0 + endif + silent! bd + return retval + endfunction +endif " }}} +" Tex_CatFile: returns the contents of a file in a <NL> seperated string {{{ +if has('*readfile') + function! Tex_CatFile(filename) + return join(readfile(filename), "\n") + endfunction +elseif has('python') && g:Tex_UsePython + function! Tex_CatFile(filename) + " catFile assigns a value to retval + exec 'python catFile("'.a:filename.'")' + + return retval + endfunction +else + function! Tex_CatFile(filename) + if glob(a:filename) == '' + return '' + endif + + call Tex_GotoTempFile() + + silent! 1,$ d _ + + let _report = &report + let _sc = &sc + set report=9999999 nosc + exec 'silent! 0r! '.g:Tex_CatCmd.' '.a:filename + + set nomod + let _a = @a + silent! normal! ggVG"ay + let retval = @a + let @a = _a + + silent! bd + let &report = _report + let &sc = _sc + return retval + endfunction +endif +" }}} +" Tex_DeleteFile: removes a file if present {{{ +" Description: +if has('python') && g:Tex_UsePython + function! Tex_DeleteFile(filename) + exec 'python deleteFile(r"'.a:filename.'")' + + if exists('retval') + return retval + endif + endfunction +else + function! Tex_DeleteFile(filename) + if filereadable(a:filename) + exec '! '.g:Tex_RmCmd.' '.a:filename + endif + endfunction +endif +" }}} + + +let &cpo = s:save_cpo + +" Define the functions in python if available. +if !has('python') || !g:Tex_UsePython + finish +endif + +exec 'pyfile '.fnameescape(expand('<sfile>:p:h')).'/pytools.py' + +" vim:fdm=marker:ff=unix:noet:ts=4:sw=4:nowrap diff --git a/.vim/ftplugin/latex-suite/mathmacros-utf.vim b/.vim/ftplugin/latex-suite/mathmacros-utf.vim @@ -0,0 +1,729 @@ +"============================================================================= +" File: mathmacros.vim +" Author: Mikolaj Machowski +" Created: Tue Apr 23 06:00 PM 2002 PST +" +" Description: macros for everything mathematical in latex. +"============================================================================= + +if !(has('gui_running') && g:Tex_MathMenus && g:Tex_Menus) + finish +endif + +let s:MathMenuName = g:Tex_MenuPrefix.'Ma&th.' + +function! Tex_MathMenuRemove() + exe 'silent! aunmenu '.s:MathMenuName +endfunction + +let s:pA = 'amenu <silent> 85 '.s:MathMenuName + +" brackets and dollars {{{ +exe s:pA.'\\&[\ \\] <plug><C-r>=IMAP_PutTextWithMovement("\\[<++>\\]<++>")<cr>' +exe s:pA.'\\&(\ \\) <plug><C-r>=IMAP_PutTextWithMovement("\\(<++>\\)<++>")<cr>' +exe s:pA.'&$\ $ <plug>$$' +exe s:pA.'-sepmath1- :' +" }}} +" MATH arrows {{{ +let s:pA1 = s:pA."&Arrows." +exe s:pA1.'Leftarrow<Tab>⇠<plug>\Leftarrow ' +exe s:pA1.'leftarrow<Tab>↠<plug>\leftarrow' +exe s:pA1.'longleftarrow<Tab>↠<plug>\longleftarrow ' +exe s:pA1.'Longleftarrow<Tab>⇠<plug>\Longleftarrow ' +exe s:pA1.'rightarrow<Tab>→ <plug>\rightarrow ' +exe s:pA1.'longrightarrow<Tab>→ <plug>\longrightarrow ' +exe s:pA1.'Rightarrow<Tab>⇒ <plug>\Rightarrow ' +exe s:pA1.'Longrightarrow<Tab>⇒ <plug>\Longrightarrow ' +exe s:pA1.'leftrightarrow<Tab>⇆ <plug>\leftrightarrow ' +exe s:pA1.'longleftrightarrow<Tab>↔ <plug>\longleftrightarrow ' +exe s:pA1.'Leftrightarrow<Tab>⇔ <plug>\Leftrightarrow ' +exe s:pA1.'Longleftrightarrow<Tab>⇔ <plug>\Longleftrightarrow ' +exe s:pA1.'uparrow<Tab>↑ <plug>\uparrow ' +exe s:pA1.'Uparrow<Tab>⇑ <plug>\Uparrow ' +exe s:pA1.'downarrow<Tab>↓ <plug>\downarrow ' +exe s:pA1.'Downarrow<Tab>⇓ <plug>\Downarrow ' +exe s:pA1.'updownarrow<Tab>↕ <plug>\updownarrow ' +exe s:pA1.'Updownarrow<Tab>⇕ <plug>\Updownarrow ' +exe s:pA1.'nearrow<Tab>↗ <plug>\nearrow ' +exe s:pA1.'searrow<Tab>↘ <plug>\searrow ' +exe s:pA1.'swarrow<Tab>↙ <plug>\swarrow ' +exe s:pA1.'nwarrow<Tab>↖ <plug>\nwarrow ' +exe s:pA1.'mapsto<Tab>↦ <plug>\mapsto ' +exe s:pA1.'leadsto<Tab>↠<plug>\leadsto ' +exe s:pA1.'longmapsto<Tab>⇖ <plug>\longmapsto ' +exe s:pA1.'hookleftarrow<Tab>↩ <plug>\hookleftarrow ' +exe s:pA1.'hookrightarrow<Tab>↪ <plug>\hookrightarrow ' +exe s:pA1.'leftharpoonup<Tab>↼ <plug>\leftharpoonup ' +exe s:pA1.'leftharpoondown<Tab>↽ <plug>\leftharpoondown ' +exe s:pA1.'rightharpoonup<Tab>⇀ <plug>\rightharpoonup ' +exe s:pA1.'rightharpoondown<Tab>⇠<plug>\rightharpoondown ' +exe s:pA1.'rightleftharpoons<Tab>⇌ <plug>\rightleftharpoons ' +exe s:pA1.'overleftarrow<Tab> <plug>\overleftarrow ' +exe s:pA1.'overrightarrow<Tab> <plug>\overrightarrow ' +exe s:pA1.'overleftrightarrow<Tab> <plug>\overleftrightarrow ' +exe s:pA1.'underleftarrow<Tab> <plug>\underleftarrow ' +exe s:pA1.'underrightarrow<Tab> <plug>\underrightarrow ' +exe s:pA1.'underleftrightarrow<Tab> <plug>\underleftrightarrow ' +exe s:pA1.'xleftarrow<Tab> <plug>\xleftarrow ' +exe s:pA1.'xrightarrow<Tab> <plug>\xrightarrow ' +" }}} +" MATH Arrows2 {{{ +let s:pA1a = s:pA."Arrows2." +exe s:pA1a.'dashleftarrow<Tab>⇠ <plug>\dashleftarrow ' +exe s:pA1a.'leftleftarrows<Tab>⇇ <plug>\leftleftarrows ' +exe s:pA1a.'leftrightarrows<Tab>⇆ <plug>\leftrightarrows ' +exe s:pA1a.'Lleftarrow<Tab>⇚ <plug>\Lleftarrow ' +exe s:pA1a.'twoheadleftarrow<Tab>↞ <plug>\twoheadleftarrow ' +exe s:pA1a.'leftarrowtail<Tab>↢ <plug>\leftarrowtail ' +exe s:pA1a.'leftrightharpoons<Tab>⇋ <plug>\leftrightharpoons ' +exe s:pA1a.'Lsh<Tab>↰ <plug>\Lsh ' +exe s:pA1a.'looparrowleft<Tab>↫ <plug>\looparrowleft ' +exe s:pA1a.'curvearrowleft<Tab>↶ <plug>\curvearrowleft ' +exe s:pA1a.'circlearrowleft<Tab>↺ <plug>\circlearrowleft ' +exe s:pA1a.'dashrightarrow<Tab>⇢ <plug>\dashrightarrow ' +exe s:pA1a.'rightrightarrows<Tab>⇉ <plug>\rightrightarrows ' +exe s:pA1a.'rightleftarrows<Tab>⇄ <plug>\rightleftarrows ' +exe s:pA1a.'Rrightarrow<Tab>⇛ <plug>\Rrightarrow ' +exe s:pA1a.'twoheadrightarrow<Tab>↠ <plug>\twoheadrightarrow ' +exe s:pA1a.'rightarrowtail<Tab>↣ <plug>\rightarrowtail ' +exe s:pA1a.'rightleftharpoons<Tab>⇌ <plug>\rightleftharpoons ' +exe s:pA1a.'Rsh<Tab>↱ <plug>\Rsh ' +exe s:pA1a.'looparrowright<Tab>↬ <plug>\looparrowright ' +exe s:pA1a.'curvearrowright<Tab>↷ <plug>\curvearrowright ' +exe s:pA1a.'circlearrowright<Tab>↻ <plug>\circlearrowright ' +exe s:pA1a.'multimap<Tab>⊸ <plug>\multimap ' +exe s:pA1a.'upuparrows<Tab>⇈ <plug>\upuparrows ' +exe s:pA1a.'downdownarrows<Tab>⇊ <plug>\downdownarrows ' +exe s:pA1a.'upharpoonleft<Tab>↿ <plug>\upharpoonleft ' +exe s:pA1a.'upharpoonright<Tab>↾ <plug>\upharpoonright ' +exe s:pA1a.'downharpoonleft<Tab>⇃ <plug>\downharpoonleft ' +exe s:pA1a.'downharpoonright<Tab>⇂ <plug>\downharpoonright ' +exe s:pA1a.'rightsquigarrow<Tab>⇠<plug>\rightsquigarrow ' +exe s:pA1a.'leftrightsquigarrow<Tab>↭ <plug>\leftrightsquigarrow ' +" }}} +" MATH nArrows {{{ +let s:pA1b = s:pA."&nArrows." +exe s:pA1b.'nleftarrow<Tab>↚ <plug>\nleftarrow ' +exe s:pA1b.'nLeftarrow<Tab>⇠<plug>\nLeftarrow ' +exe s:pA1b.'nleftrightarrow<Tab>↮ <plug>\nleftrightarrow ' +exe s:pA1b.'nLeftrightarrow<Tab>⇎ <plug>\nleftrightarrow ' +exe s:pA1b.'nrightarrow<Tab>↛ <plug>\nrightarrow ' +exe s:pA1b.'nRightarrow<Tab>⇠<plug>\nRightarrow ' +" }}} +" MATH Fonts {{{ +let s:pA2a = s:pA."&MathFonts." +exe s:pA2a.'mathbf{} <plug><C-r>=IMAP_PutTextWithMovement("\\mathbf{<++>}<++>")<cr>' +exe s:pA2a.'mathrm{} <plug><C-r>=IMAP_PutTextWithMovement("\\mathrm{<++>}<++>")<cr>' +exe s:pA2a.'mathsf{} <plug><C-r>=IMAP_PutTextWithMovement("\\mathsf{<++>}<++>")<cr>' +exe s:pA2a.'mathtt{} <plug><C-r>=IMAP_PutTextWithMovement("\\mathtt{<++>}<++>")<cr>' +exe s:pA2a.'mathit{} <plug><C-r>=IMAP_PutTextWithMovement("\\mathit{<++>}<++>")<cr>' +exe s:pA2a.'mathfrak{} <plug><C-r>=IMAP_PutTextWithMovement("\\mathfrak{<++>}<++>")<cr>' +exe s:pA2a.'mathcal{} <plug><C-r>=IMAP_PutTextWithMovement("\\mathcal{<++>}<++>")<cr>' +exe s:pA2a.'mathscr{} <plug><C-r>=IMAP_PutTextWithMovement("\\mathscr{<++>}<++>")<cr>' +exe s:pA2a.'mathbb{} <plug><C-r>=IMAP_PutTextWithMovement("\\mathbb{<++>}<++>")<cr>' +" }}} +" Greek Letters small {{{ +let s:pA2 = s:pA."&Greek.&Small." +exe s:pA2.'alpha<Tab>`a\ \ α <plug>\alpha ' +exe s:pA2.'beta<Tab>`b\ \ β <plug>\beta ' +exe s:pA2.'gamma<Tab>`g\ \ γ <plug>\gamma ' +exe s:pA2.'delta<Tab>`d\ \ δ <plug>\delta ' +exe s:pA2.'epsilon<Tab>∊ <plug>\epsilon ' +exe s:pA2.'varepsilon<Tab>`e\ \ ε <plug>\varepsilon ' +exe s:pA2.'zeta<Tab>`z\ \ ζ <plug>\zeta ' +exe s:pA2.'eta<Tab>`h\ \ η <plug>\eta ' +exe s:pA2.'theta<Tab>`q\ \ θ <plug>\theta ' +exe s:pA2.'vartheta<Tab>Ï‘ <plug>\vartheta ' +exe s:pA2.'iota<Tab>`i\ \ ι <plug>\iota ' +exe s:pA2.'kappa<Tab>`k\ \ κ <plug>\kappa ' +exe s:pA2.'lambda<Tab>`l\ \ λ <plug>\lambda ' +exe s:pA2.'mu<Tab>`m\ \ μ <plug>\mu ' +exe s:pA2.'nu<Tab>`n\ \ ν <plug>\nu ' +exe s:pA2.'xi<Tab>`x\ \ ξ <plug>\xi ' +exe s:pA2.'pi<Tab>`p\ \ Ï€ <plug>\pi ' +exe s:pA2.'varpi<Tab>Ï– <plug>\varpi ' +exe s:pA2.'rho<Tab>`r\ \ Ï <plug>\rho ' +exe s:pA2.'varrho<Tab>ϱ <plug>\varrho ' +exe s:pA2.'sigma<Tab>`s\ \ σ <plug>\sigma ' +exe s:pA2.'varsigma<Tab>`v\ \ Ï‚ <plug>\varsigma ' +exe s:pA2.'tau<Tab>`t\ \ Ï„ <plug>\tau ' +exe s:pA2.'upsilon<Tab>`u\ \ Ï… <plug>\upsilon ' +exe s:pA2.'phi<Tab>φ <plug>\phi ' +exe s:pA2.'varphi<Tab>`f\ \ Ï• <plug>\varphi ' +exe s:pA2.'chi<Tab>`c\ \ χ <plug>\chi ' +exe s:pA2.'psi<Tab>`y\ \ ψ <plug>\psi ' +exe s:pA2.'omega<Tab>`w\ \ ω <plug>\omega ' +" }}} +" Greek Letters big {{{ +let s:pA3 = s:pA.'&Greek.&Big.' +exe s:pA3.'Alpha<Tab>`A\ \ A <plug>\Alpha ' +exe s:pA3.'Beta<Tab>`B\ \ B <plug>\Beta ' +exe s:pA3.'Gamma<Tab>`G\ \ Γ <plug>\Gamma ' +exe s:pA3.'Delta<Tab>`D\ \ Δ <plug>\Delta ' +exe s:pA3.'Epsilon<Tab>`E\ \ E <plug>\Epsilon ' +exe s:pA3.'Zeta<Tab>`Z\ \ Z <plug>\mathrm{Z} ' +exe s:pA3.'Eta<Tab>`H\ \ H <plug>\Eta ' +exe s:pA3.'Theta<Tab>Θ <plug>\Theta ' +exe s:pA3.'Iota<Tab>I <plug>\mathrm{I} ' +exe s:pA3.'Kappa<Tab>`K\ \ K <plug>\Kappa ' +exe s:pA3.'Lambda<Tab>`L\ \ Λ <plug>\Lambda ' +exe s:pA3.'Mu<Tab>`M\ \ M <plug>\Mu ' +exe s:pA3.'Nu<Tab>`N\ \ N <plug>\Nu ' +exe s:pA3.'Xi<Tab>`X\ \ Ξ <plug>\Xi ' +exe s:pA3.'Pi<Tab>`P\ \ Π <plug>\Pi ' +exe s:pA3.'Rho<Tab>`R\ \ P <plug>\Rho ' +exe s:pA3.'Sigma<Tab>`S\ \ Σ <plug>\Sigma ' +exe s:pA3.'Tau<Tab>`T\ \ T <plug>\Tau ' +exe s:pA3.'Upsilon<Tab>`U\ \ Y <plug>\Upsilon ' +exe s:pA3.'Phi<Tab>Φ <plug>\Phi ' +exe s:pA3.'Chi<Tab>`C\ \ X <plug>\Chi ' +exe s:pA3.'Psi<Tab>`Y\ \ Ψ <plug>\Psi ' +exe s:pA3.'Omega<Tab>`W\ \ Ω <plug>\Omega ' +" }}} +" BinaryRel1 {{{ +let s:pA4 = s:pA."&BinaryRel1." +exe s:pA4.'ll<Tab>≪ <plug>\ll ' +exe s:pA4.'lll<Tab>⋘ <plug>\lll ' +exe s:pA4.'leqslant<Tab>≤ <plug>\leqslant ' +exe s:pA4.'leq<Tab>≤ <plug>\leq ' +exe s:pA4.'leqq<Tab>≦ <plug>\leqq ' +exe s:pA4.'eqslantless<Tab>â‹œ <plug>\eqslantless ' +exe s:pA4.'lessdot<Tab>â‹– <plug>\lessdot ' +exe s:pA4.'prec<Tab>≺ <plug>\prec ' +exe s:pA4.'preceq<Tab>≼ <plug>\preceq ' +exe s:pA4.'preccurlyeq<Tab>≼ <plug>\preccurlyeq ' +exe s:pA4.'curlyeqprec<Tab>â‹ž <plug>\curlyeqprec ' +exe s:pA4.'lesssim<Tab>≲ <plug>\lesssim ' +exe s:pA4.'lessapprox<Tab> <plug>\lessapprox ' +exe s:pA4.'precsim<Tab>≾ <plug>\precsim ' +exe s:pA4.'precapprox<Tab> <plug>\precapprox ' +exe s:pA4.'in<Tab>∈ <plug>\in ' +exe s:pA4.'subset<Tab>`(\ \ ⊂ <plug>\subset ' +exe s:pA4.'Subset<Tab>`)\ \ â‹ <plug>\Subset ' +exe s:pA4.'subseteq<Tab>⊆ <plug>\subseteq ' +exe s:pA4.'subseteqq<Tab> <plug>\subseteqq ' +exe s:pA4.'sqsubset<Tab>⊠<plug>\sqsubset ' +exe s:pA4.'sqsubseteq<Tab>⊑ <plug>\sqsubseteq ' +exe s:pA4.'smile<Tab>⌣ <plug>\smile ' +exe s:pA4.'smallsmile<Tab>⌣ <plug>\smallsmile ' +exe s:pA4.'parallel<Tab>∥ <plug>\parallel ' +exe s:pA4.'shortparallel<Tab>∥ <plug>\shortparallel ' +exe s:pA4.'dashv<Tab>⊣ <plug>\dashv ' +exe s:pA4.'vdash<Tab>⊢ <plug>\vdash ' +exe s:pA4.'vDash<Tab>⊨ <plug>\vDash ' +exe s:pA4.'models<Tab>⊨ <plug>\models ' +exe s:pA4.'therefore<Tab>∴ <plug>\therefore ' +exe s:pA4.'backepsilon<Tab>∠<plug>\backepsilon ' +" }}} +" nBinaryRel1 {{{ +let s:pA4a = s:pA."&nBinaryRel1." +exe s:pA4a.'nless<Tab>≮ <plug>\nless ' +exe s:pA4a.'nleqslant<Tab>≰ <plug>\nleqslant ' +exe s:pA4a.'nleq<Tab> <plug>\nleq ' +exe s:pA4a.'lneq<Tab> <plug>\lneq ' +exe s:pA4a.'nleqq<Tab> <plug>\nleqq ' +exe s:pA4a.'lneqq<Tab>≨ <plug>\lneqq ' +exe s:pA4a.'lvertneqq<Tab> <plug>\lvertneqq ' +exe s:pA4a.'nprec<Tab>⊀ <plug>\nprec ' +exe s:pA4a.'npreceq<Tab>â‹  <plug>\npreceq ' +exe s:pA4a.'precneqq<Tab> <plug>\precneqq ' +exe s:pA4a.'lnsim<Tab>⋦ <plug>\lnsim ' +exe s:pA4a.'lnapprox<Tab> <plug>\lnapprox ' +exe s:pA4a.'precnsim<Tab>⋨ <plug>\precnsim ' +exe s:pA4a.'precnapprox<Tab> <plug>\precnapprox ' +exe s:pA4a.'notin<Tab>∉ <plug>\notin ' +exe s:pA4a.'nsubseteq<Tab>⊈ <plug>\nsubseteq ' +exe s:pA4a.'varsubsetneq<Tab> <plug>\varsubsetneq ' +exe s:pA4a.'subsetneq<Tab>⊊ <plug>\subsetneq ' +exe s:pA4a.'nsubseteqq<Tab> <plug>\nsubseteqq ' +exe s:pA4a.'varsubsetneqq<Tab> <plug>\varsubsetneqq ' +exe s:pA4a.'subsetneqq<Tab>⊈ <plug>\subsetneqq ' +exe s:pA4a.'nparallel<Tab>∦ <plug>\nparallel ' +exe s:pA4a.'nshortparallel<Tab> <plug>\nshortparallel ' +exe s:pA4a.'nvdash<Tab>⊬ <plug>\nvdash ' +exe s:pA4a.'nvDash<Tab>⊭ <plug>\nvDash ' +" }}} +" BinaryRel2 {{{ +let s:pA5 = s:pA."&BinaryRel2." +exe s:pA5.'gg<Tab>≫ <plug>\gg ' +exe s:pA5.'ggg<Tab>â‹™ <plug>\ggg ' +exe s:pA5.'gggtr<Tab>â‹™ <plug>\gggtr ' +exe s:pA5.'geqslant<Tab> <plug>\geqslant ' +exe s:pA5.'geq<Tab>≥ <plug>\geq ' +exe s:pA5.'geqq<Tab>≧ <plug>\geqq ' +exe s:pA5.'eqslantgtr<Tab> <plug>\eqslantgtr ' +exe s:pA5.'gtrdot<Tab>â‹— <plug>\gtrdot ' +exe s:pA5.'succ<Tab>≻ <plug>\succ ' +exe s:pA5.'succeq<Tab>≽ <plug>\succeq ' +exe s:pA5.'succcurlyeq<Tab>≽ <plug>\succcurlyeq ' +exe s:pA5.'curlyeqsucc<Tab>â‹Ÿ <plug>\curlyeqsucc ' +exe s:pA5.'gtrsim<Tab>≳ <plug>\gtrsim ' +exe s:pA5.'gtrapprox<Tab> <plug>\gtrapprox ' +exe s:pA5.'succsim<Tab>≿ <plug>\succsim ' +exe s:pA5.'succapprox<Tab> <plug>\succapprox ' +exe s:pA5.'ni<Tab>∋ <plug>\ni ' +exe s:pA5.'owns<Tab> <plug>\owns ' +exe s:pA5.'supset<Tab>⊃ <plug>\supset ' +exe s:pA5.'Supset<Tab>â‹‘ <plug>\Supset ' +exe s:pA5.'supseteq<Tab>⊇ <plug>\supseteq ' +exe s:pA5.'supseteqq<Tab> <plug>\supseteqq ' +exe s:pA5.'sqsupset<Tab>⊠<plug>\sqsupset ' +exe s:pA5.'sqsupseteq<Tab>⊒ <plug>\sqsupseteq ' +exe s:pA5.'frown<Tab>⌢ <plug>\frown ' +exe s:pA5.'smallfrown<Tab>⌢ <plug>\smallfrown ' +exe s:pA5.'mid<Tab>∣ <plug>\mid ' +exe s:pA5.'shortmid<Tab> <plug>\shortmid ' +exe s:pA5.'between<Tab>≬ <plug>\between ' +exe s:pA5.'Vdash<Tab>⊩ <plug>\Vdash ' +exe s:pA5.'bowtie<Tab>⋈ <plug>\bowtie ' +exe s:pA5.'Join<Tab>⋈ <plug>\Join ' +exe s:pA5.'pitchfork<Tab>â‹” <plug>\pitchfork ' +" }}} +" {{{ nBinaryRel2 +let s:pA5a = s:pA."n&BinaryRel2." "TODO: dorobiæ logarytmy +exe s:pA5a.'ngtr<Tab>≯ <plug>\ngtr ' +exe s:pA5a.'ngeqslant<Tab>≱ <plug>\ngeqslant ' +exe s:pA5a.'ngeq<Tab> <plug>\ngeq ' +exe s:pA5a.'gneq<Tab> <plug>\gneq ' +exe s:pA5a.'ngeqq<Tab> <plug>\ngeqq ' +exe s:pA5a.'gneqq<Tab>≩ <plug>\gneqq ' +exe s:pA5a.'nsucc<Tab>⊠<plug>\nsucc ' +exe s:pA5a.'nsucceq<Tab>â‹¡ <plug>\nsucceq ' +exe s:pA5a.'succneqq<Tab> <plug>\succneqq ' +exe s:pA5a.'gnsim<Tab>⋧ <plug>\gnsim ' +exe s:pA5a.'gnapprox<Tab> <plug>\gnapprox ' +exe s:pA5a.'succnsim<Tab>â‹© <plug>\succnsim ' +exe s:pA5a.'succnapprox<Tab> <plug>\succnapprox ' +exe s:pA5a.'nsupseteq<Tab>⊉ <plug>\nsupseteq ' +exe s:pA5a.'varsupsetneq<Tab> <plug>\varsupsetneq ' +exe s:pA5a.'supsetneq<Tab>⊋ <plug>\supsetneq ' +exe s:pA5a.'nsupseteqq<Tab> <plug>\nsupseteqq ' +exe s:pA5a.'varsupsetneqq<Tab> <plug>\varsupsetneqq ' +exe s:pA5a.'supsetneqq<Tab> <plug>\supsetneqq ' +exe s:pA5a.'nmid<Tab>∤ <plug>\nmid ' +exe s:pA5a.'nshortmid<Tab> <plug>\nshortmid ' +exe s:pA5a.'nVdash<Tab>⊮ <plug>\nVdash ' +" }}} +" {{{ BinaryRel3 +let s:pA6 = s:pA."&BinaryRel3." +exe s:pA6.'doteq<Tab>≠<plug>\doteq ' +exe s:pA6.'circeq<Tab>≗ <plug>\circeq ' +exe s:pA6.'eqcirc<Tab>≖ <plug>\eqcirc ' +exe s:pA6.'risingdotseq<Tab>≓ <plug>\risingdotseq ' +exe s:pA6.'doteqdot<Tab>≑ <plug>\doteqdot ' +exe s:pA6.'Doteq<Tab>≑ <plug>\Doteq ' +exe s:pA6.'fallingdotseq<Tab>≒ <plug>\fallingdotseq ' +exe s:pA6.'triangleq<Tab>≜ <plug>\triangleq ' +exe s:pA6.'bumpeq<Tab>≠<plug>\bumpeq ' +exe s:pA6.'Bumpeq<Tab>≎ <plug>\Bumpeq ' +exe s:pA6.'equiv<Tab>`=\ \ ≡ <plug>\equiv ' +exe s:pA6.'sim<Tab>∼ <plug>\sim ' +exe s:pA6.'thicksim<Tab>∼ <plug>\thicksim ' +exe s:pA6.'backsim<Tab>∽ <plug>\backsim ' +exe s:pA6.'simeq<Tab>≃ <plug>\simeq ' +exe s:pA6.'backsimeq<Tab>â‹ <plug>\backsimeq ' +exe s:pA6.'cong<Tab>≅ <plug>\cong ' +exe s:pA6.'approx<tab>=~\ \ ≈ <plug>\approx ' +exe s:pA6.'thickapprox<Tab>≈ <plug>\thickapprox ' +exe s:pA6.'approxeq<Tab>≊ <plug>\approxeq ' +exe s:pA6.'blacktriangleleft<Tab>â—€ <plug>\blacktriangleleft ' +exe s:pA6.'vartriangleleft<Tab>⊲ <plug>\vartriangleleft ' +exe s:pA6.'trianglelefteq<Tab>⊴ <plug>\trianglelefteq ' +exe s:pA6.'blacktriangleright<Tab>â–¶ <plug>\blacktriangleright ' +exe s:pA6.'vartriangleright<Tab>⊳ <plug>\vartriangleright ' +exe s:pA6.'trianglerighteq<Tab>⊵ <plug>\trianglerighteq ' +exe s:pA6.'perp<Tab>⊥ <plug>\perp ' +exe s:pA6.'asymp<Tab>≠<plug>\asymp ' +exe s:pA6.'Vvdash<Tab>⊪ <plug>\Vvdash ' +exe s:pA6.'propto<Tab>∠<plug>\propto ' +exe s:pA6.'varpropto<Tab>∠<plug>\varpropto ' +exe s:pA6.'because<Tab>∵ <plug>\because ' +" }}} +" {{{ nBinaryRel3 +let s:pA6a = s:pA."&nBinaryRel3." +exe s:pA6a.'neq<Tab>≠ <plug>\neq ' +exe s:pA6a.'nsim<Tab>≠<plug>\nsim ' +exe s:pA6a.'ncong<Tab>≆ <plug>\ncong ' +exe s:pA6a.'ntriangleleft<Tab>⋪ <plug>\ntriangleleft ' +exe s:pA6a.'ntrianglelefteq<Tab>⋬ <plug>\ntrianglelefteq ' +exe s:pA6a.'ntriangleright<Tab>â‹« <plug>\ntriangleright ' +exe s:pA6a.'ntrianglerighteq<Tab>â‹­ <plug>\ntrianglerighteq ' +" }}} +" {{{ BinaryRel4 +let s:pA7 = s:pA."&BinaryRel4." +exe s:pA7.'lessgtr<Tab>≶ <plug>\lessgtr ' +exe s:pA7.'gtrless<Tab>≷ <plug>\gtrless ' +exe s:pA7.'lesseqgtr<Tab>â‹š <plug>\lesseqgtr ' +exe s:pA7.'gtreqless<Tab>â‹› <plug>\gtreqless ' +exe s:pA7.'lesseqqgtr<Tab> <plug>\lesseqqgtr ' +exe s:pA7.'gtreqqless<Tab> <plug>\gtreqqless ' +" }}} +" {{{ BigOp +let s:pA8a = s:pA."&BigOp." +exe s:pA8a.'limits<Tab> <plug>\limits' +exe s:pA8a.'nolimits<Tab> <plug>\nolimits' +exe s:pA8a.'displaylimits<Tab> <plug>\displaylimits' +exe s:pA8a.'-seplimits- :' +exe s:pA8a.'bigcap<Tab>`-\ \ â‹‚ <plug>\bigcap' +exe s:pA8a.'bigcup<Tab>`+\ \ ⋃ <plug>\bigcup' +exe s:pA8a.'bigodot<Tab>⊙ <plug>\bigodot' +exe s:pA8a.'bigoplus<Tab>⊕ <plug>\bigoplus' +exe s:pA8a.'bigotimes<Tab>⊗ <plug>\bigotimes' +exe s:pA8a.'bigsqcup<Tab>⊔ <plug>\bigsqcup' +exe s:pA8a.'biguplus<Tab>⊎ <plug>\biguplus' +exe s:pA8a.'bigvee<Tab>â‹ <plug>\bigvee' +exe s:pA8a.'bigwedge<Tab>â‹€ <plug>\bigwedge' +exe s:pA8a.'coprod<Tab>∠<plug>\coprod' +exe s:pA8a.'int<Tab>∫ <plug>\int' +exe s:pA8a.'iint<Tab>∬ <plug>\int' +exe s:pA8a.'iiint<Tab>∭ <plug>\int' +exe s:pA8a.'oint<Tab>∮ <plug>\oint' +exe s:pA8a.'prod<Tab>∠<plug>\prod' +exe s:pA8a.'sum<Tab>∑ <plug>\sum' +" }}} +" {{{ BinaryOp +let s:pA8 = s:pA."&BinaryOp." +exe s:pA8.'pm<Tab>± <plug>\pm ' +exe s:pA8.'mp<Tab>∓ <plug>\mp ' +exe s:pA8.'dotplus<Tab>∔ <plug>\dotplus ' +exe s:pA8.'cdot<Tab>`.\ \ â‹… <plug>\cdot ' +exe s:pA8.'centerdot<Tab>â‹… <plug>\centerdot ' +exe s:pA8.'times<Tab>`*\ \ × <plug>\times ' +exe s:pA8.'ltimes<Tab>⋉ <plug>\ltimes ' +exe s:pA8.'rtimes<Tab>â‹Š <plug>\rtimes ' +exe s:pA8.'leftthreetimes<Tab>â‹‹ <plug>\leftthreetimes ' +exe s:pA8.'rightthreetimes<Tab>â‹Œ <plug>\rightthreetimes ' +exe s:pA8.'div<Tab>÷ <plug>\div ' +exe s:pA8.'divideontimes<Tab>⋇ <plug>\divideontimes ' +exe s:pA8.'bmod<Tab> <plug>\bmod ' +exe s:pA8.'ast<Tab>∗ <plug>\ast ' +exe s:pA8.'star<Tab>⋆ <plug>\star ' +exe s:pA8.'setminus<Tab>`\\\ \ ∖ <plug>\setminus ' +exe s:pA8.'smallsetminus<Tab>∖ <plug>\smallsetminus ' +exe s:pA8.'diamond<Tab>â‹„ <plug>\diamond ' +exe s:pA8.'wr<Tab>≀ <plug>\wr ' +exe s:pA8.'intercal<Tab>⊺ <plug>\intercal ' +exe s:pA8.'circ<Tab>`@\ \ ∘ <plug>\circ ' +exe s:pA8.'bigcirc<Tab>â—‹ <plug>\bigcirc ' +exe s:pA8.'bullet<Tab>∙ <plug>\bullet ' +exe s:pA8.'cap<Tab>∩ <plug>\cap ' +exe s:pA8.'Cap<Tab>â‹’ <plug>\Cap ' +exe s:pA8.'cup<Tab>∪ <plug>\cup ' +exe s:pA8.'Cup<Tab>â‹“ <plug>\Cup ' +exe s:pA8.'sqcap<Tab>⊓ <plug>\sqcap ' +exe s:pA8.'sqcup<Tab>⊔ <plug>\sqcup' +exe s:pA8.'amalg<Tab> <plug>\amalg ' +exe s:pA8.'uplus<Tab>⊎ <plug>\uplus ' +exe s:pA8.'triangleleft<Tab>â— <plug>\triangleleft ' +exe s:pA8.'triangleright<Tab>â–· <plug>\triangleright ' +exe s:pA8.'bigtriangleup<Tab>â–³ <plug>\bigtriangleup ' +exe s:pA8.'bigtriangledown<Tab>â–½ <plug>\bigtriangledown ' +exe s:pA8.'vee<Tab>∨ <plug>\vee ' +exe s:pA8.'veebar<Tab>⊻ <plug>\veebar ' +exe s:pA8.'curlyvee<Tab>â‹Ž <plug>\curlyvee ' +exe s:pA8.'wedge<Tab>`&\ \ ∧ <plug>\wedge ' +exe s:pA8.'barwedge<Tab>⊼ <plug>\barwedge ' +exe s:pA8.'doublebarwedge<Tab>⌆ <plug>\doublebarwedge ' +exe s:pA8.'curlywedge<Tab>â‹ <plug>\curlywedge ' +exe s:pA8.'oplus<Tab>⊕ <plug>\oplus ' +exe s:pA8.'ominus<Tab>⊖ <plug>\ominus ' +exe s:pA8.'otimes<Tab>⊗ <plug>\otimes ' +exe s:pA8.'oslash<Tab>⊘ <plug>\oslash ' +exe s:pA8.'boxplus<Tab>⊞ <plug>\boxplus ' +exe s:pA8.'boxminus<Tab>⊟ <plug>\boxminus ' +exe s:pA8.'boxtimes<Tab>⊠ <plug>\boxtimes ' +exe s:pA8.'boxdot<Tab>⊡ <plug>\boxdot ' +exe s:pA8.'odot<Tab>⊙ <plug>\odot ' +exe s:pA8.'circledast<Tab>⊛ <plug>\circledast ' +exe s:pA8.'circleddash<Tab>⊠<plug>\circleddash ' +exe s:pA8.'circledcirc<Tab>⊚ <plug>\circledcirc ' +exe s:pA8.'dagger<Tab>† <plug>\dagger ' +exe s:pA8.'ddagger<Tab>‡ <plug>\ddagger ' +exe s:pA8.'lhd<Tab>⊲ <plug>\lhd ' +exe s:pA8.'unlhd<Tab>⊴ <plug>\unlhd ' +exe s:pA8.'rhd<Tab>⊳ <plug>\rhd ' +exe s:pA8.'unrhd<Tab>⊵ <plug>\unrhd ' +" }}} +" {{{ Other1 +let s:pA9 = s:pA."&Other1." +exe s:pA9.'hat<Tab>â <plug>\hat ' +exe s:pA9.'check<Tab>ÇŽ <plug>\check ' +exe s:pA9.'grave<Tab>à <plug>\grave ' +exe s:pA9.'acute<Tab>á <plug>\acute ' +exe s:pA9.'dot<Tab>ȧ <plug>\dot ' +exe s:pA9.'ddot<Tab>ä <plug>\ddot ' +exe s:pA9.'tilde<Tab>`,\ \ ã <plug>\tilde ' +exe s:pA9.'breve<Tab>ă <plug>\breve ' +exe s:pA9.'bar<Tab>Ä <plug>\bar ' +exe s:pA9.'vec<Tab>a⃗ <plug>\vec ' +exe s:pA9.'aleph<Tab>× <plug>\aleph ' +exe s:pA9.'hbar<Tab>â„ <plug>\hbar ' +exe s:pA9.'imath<Tab> <plug>\imath ' +exe s:pA9.'jmath<Tab> <plug>\jmath ' +exe s:pA9.'ell<Tab>â„“ <plug>\ell ' +exe s:pA9.'wp<Tab>℘ <plug>\wp ' +exe s:pA9.'Re<Tab>â„œ <plug>\Re ' +exe s:pA9.'Im<Tab>â„‘ <plug>\Im ' +exe s:pA9.'partial<Tab>∂ <plug>\partial ' +exe s:pA9.'infty<Tab>`8\ \ ∞ <plug>\infty ' +exe s:pA9.'prime<Tab>′ <plug>\prime ' +exe s:pA9.'emptyset<Tab>∅ <plug>\emptyset ' +exe s:pA9.'nabla<Tab>∇ <plug>\nabla ' +exe s:pA9.'surd<Tab>√ <plug>\surd ' +exe s:pA9.'top<Tab>⊤ <plug>\top ' +exe s:pA9.'bot<Tab>⊥ <plug>\bot ' +exe s:pA9.'angle<Tab>∠ <plug>\angle ' +exe s:pA9.'triangle<Tab>â–³ <plug>\triangle ' +exe s:pA9.'backslash<Tab>\\ <plug>\backslash ' +exe s:pA9.'forall<Tab>∀ <plug>\forall ' +exe s:pA9.'exists<Tab>∃ <plug>\exists ' +exe s:pA9.'neg<Tab>¬ <plug>\neg ' +exe s:pA9.'flat<Tab>â™­ <plug>\flat ' +exe s:pA9.'natural<Tab>â™® <plug>\natural ' +exe s:pA9.'sharp<Tab>♯ <plug>\sharp ' +exe s:pA9.'clubsuit<Tab>♣ <plug>\clubsuit ' +exe s:pA9.'diamondsuit<Tab>♢ <plug>\diamondsuit ' +exe s:pA9.'heartsuit<Tab>♡ <plug>\heartsuit ' +exe s:pA9.'spadesuit<Tab>â™  <plug>\spadesuit ' +exe s:pA9.'S<Tab>§ <plug>\S ' +exe s:pA9.'P<Tab>¶ <plug>\P' +" }}} +" {{{ MathCreating +let s:pA10 = s:pA."&MathCreating." +exe s:pA10.'not<Tab> <plug>\not' +exe s:pA10.'mkern<Tab> <plug>\mkern' +exe s:pA10.'mathbin<Tab> <plug>\mathbin' +exe s:pA10.'mathrel<Tab> <plug>\mathrel' +exe s:pA10.'stackrel<Tab> <plug>\stackrel' +exe s:pA10.'mathord<Tab> <plug>\mathord' +" }}} +" {{{ Styles +let s:pA11 = s:pA."&Styles." +exe s:pA11.'displaystyle<Tab> <plug>\displaystyle' +exe s:pA11.'textstyle<Tab> <plug>\textstyle' +exe s:pA11.'scritpstyle<Tab> <plug>\scritpstyle' +exe s:pA11.'scriptscriptstyle<Tab> <plug>\scriptscriptstyle' +" }}} +" {{{ MathDiacritics +let s:pA12 = s:pA."&MathDiacritics." +exe s:pA12.'acute{}<Tab>á <plug><C-r>=IMAP_PutTextWithMovement("\\acute{<++>}<++>")<cr>' +exe s:pA12.'bar{}<Tab>`_\ \ Ä <plug><C-r>=IMAP_PutTextWithMovement("\\bar{<++>}<++>")<cr>' +exe s:pA12.'breve{}<Tab>ă <plug><C-r>=IMAP_PutTextWithMovement("\\breve{<++>}<++>")<cr>' +exe s:pA12.'check{}<Tab>ÇŽ <plug><C-r>=IMAP_PutTextWithMovement("\\check{<++>}<++>")<cr>' +exe s:pA12.'ddot{}<Tab>`:\ \ ä <plug><C-r>=IMAP_PutTextWithMovement("\\ddot{<++>}<++>")<cr>' +exe s:pA12.'dot{}<Tab>`;\ \ ȧ <plug><C-r>=IMAP_PutTextWithMovement("\\dot{<++>}<++>")<cr>' +exe s:pA12.'grave{}<Tab>à <plug><C-r>=IMAP_PutTextWithMovement("\\grave{<++>}<++>")<cr>' +exe s:pA12.'hat{}<Tab>`^\ \ â <plug><C-r>=IMAP_PutTextWithMovement("\\hat{<++>}<++>")<cr>' +exe s:pA12.'tilde{}<tab>`~\ \ ã <plug><C-r>=IMAP_PutTextWithMovement("\\tilde{<++>}<++>")<cr>' +exe s:pA12.'vec{}<Tab>a⃗ <plug><C-r>=IMAP_PutTextWithMovement("\\vec{<++>}<++>")<cr>' +exe s:pA12.'widehat{}<Tab> <plug><C-r>=IMAP_PutTextWithMovement("\\widehat{<++>}<++>")<cr>' +exe s:pA12.'widetilde{}<Tab> <plug><C-r>=IMAP_PutTextWithMovement("\\widetilde{<++>}<++>")<cr>' +exe s:pA12.'imath<Tab> <plug><C-r>=IMAP_PutTextWithMovement("\\imath")<cr>' +exe s:pA12.'jmath<Tab> <plug><C-r>=IMAP_PutTextWithMovement("\\jmath")<cr>' +" }}} +" {{{ OverlineAndCo +let s:pA13 = s:pA."&OverlineAndCo." +exe s:pA13.'overline{} <plug><C-r>=IMAP_PutTextWithMovement("\\overline{}")<cr>' +exe s:pA13.'underline{} <plug><C-r>=IMAP_PutTextWithMovement("\\underline{}")<cr>' +exe s:pA13.'overrightarrow{} <plug><C-r>=IMAP_PutTextWithMovement("\\overrightarrow{}")<cr>' +exe s:pA13.'overleftarrow{} <plug><C-r>=IMAP_PutTextWithMovement("\\overleftarrow{}")<cr>' +exe s:pA13.'overbrace{} <plug><C-r>=IMAP_PutTextWithMovement("\\overbrace{}")<cr>' +exe s:pA13.'underbrace{} <plug><C-r>=IMAP_PutTextWithMovement("\\underbrace{}")<cr>' +" }}} +" {{{ Symbols1 +let s:pA14a = s:pA."&Symbols1." +exe s:pA14a.'forall<Tab>∀ <plug>\forall ' +exe s:pA14a.'exists<Tab>∃ <plug>\exists ' +exe s:pA14a.'nexists<Tab>∄ <plug>\nexists ' +exe s:pA14a.'neg<Tab>¬ <plug>\neg ' +exe s:pA14a.'top<Tab>⊤ <plug>\top ' +exe s:pA14a.'bot<Tab>⊥ <plug>\bot ' +exe s:pA14a.'emptyset<Tab>∅ <plug>\emptyset ' +exe s:pA14a.'varnothing<Tab>⌀ <plug>\varnothing ' +exe s:pA14a.'infty<Tab>∞ <plug>\infty ' +exe s:pA14a.'aleph<Tab>× <plug>\aleph ' +exe s:pA14a.'beth<Tab>ב <plug>\beth ' +exe s:pA14a.'gimel<Tab>×’ <plug>\gimel ' +exe s:pA14a.'daleth<Tab>ד <plug>\daleth ' +exe s:pA14a.'hbar<Tab> <plug>\hbar ' +exe s:pA14a.'hslash<Tab>â„ <plug>\hslash ' +exe s:pA14a.'diagup<Tab>â„ <plug>\diagup ' +exe s:pA14a.'vert<Tab>\| <plug>\vert ' +exe s:pA14a.'Vert<Tab>∥ <plug>\Vert ' +exe s:pA14a.'backslash<Tab>\\ <plug>\backslash ' +exe s:pA14a.'diagdown<Tab> <plug>\diagdown ' +exe s:pA14a.'Bbbk<Tab>ᵕ <plug>\Bbbk ' +exe s:pA14a.'P<Tab>¶ <plug>\P ' +exe s:pA14a.'S<Tab>§ <plug>\S ' +" }}} +" {{{ Symbols2 +let s:pA14b = s:pA."&Symbols2." +exe s:pA14b.'# <plug>\# ' +exe s:pA14b.'% <plug>\% ' +exe s:pA14b.'_<Tab> <plug>\_ ' +exe s:pA14b.'$ <plug>\$ ' +exe s:pA14b.'& <plug>\& ' +exe s:pA14b.'imath<Tab> <plug>\imath ' +exe s:pA14b.'jmath<Tab> <plug>\jmath ' +exe s:pA14b.'ell<Tab>â„“ <plug>\ell ' +exe s:pA14b.'wp<Tab>℘ <plug>\wp ' +exe s:pA14b.'Re<Tab>â„œ <plug>\Re ' +exe s:pA14b.'Im<Tab>â„‘ <plug>\Im ' +exe s:pA14b.'prime<Tab>′ <plug>\prime ' +exe s:pA14b.'backprime<Tab>‵ <plug>\backprime ' +exe s:pA14b.'nabla<Tab>∇ <plug>\nabla ' +exe s:pA14b.'surd<Tab>√ <plug>\surd ' +exe s:pA14b.'flat<Tab>â™­ <plug>\flat ' +exe s:pA14b.'sharp<Tab>♯ <plug>\sharp ' +exe s:pA14b.'natural<Tab>â™® <plug>\natural ' +exe s:pA14b.'eth<Tab>ð <plug>\eth ' +exe s:pA14b.'bigstar<Tab>★ <plug>\bigstar ' +exe s:pA14b.'circledS<Tab>Ⓢ <plug>\circledS ' +exe s:pA14b.'Finv<Tab>Ⅎ <plug>\Finv ' +exe s:pA14b.'dag<Tab>† <plug>\dag ' +exe s:pA14b.'ddag<Tab>‡ <plug>\ddag ' +" }}} +" {{{ Symbols3 +let s:pA14c = s:pA."&Symbols3." +exe s:pA14c.'angle<Tab>∠ <plug>\angle ' +exe s:pA14c.'measuredangle<Tab>∡ <plug>\measuredangle ' +exe s:pA14c.'sphericalangle<Tab>∢ <plug>\sphericalangle ' +exe s:pA14c.'spadesuit<Tab>â™  <plug>\spadesuit ' +exe s:pA14c.'heartsuit<Tab>♡ <plug>\heartsuit ' +exe s:pA14c.'diamondsuit<Tab>♢ <plug>\diamondsuit ' +exe s:pA14c.'clubsuit<Tab>♣ <plug>\clubsuit ' +exe s:pA14c.'lozenge<Tab>â—Š <plug>\lozenge ' +exe s:pA14c.'blacklozenge<Tab>â—† <plug>\blacklozenge ' +exe s:pA14c.'Diamond<Tab>â—‡ <plug>\Diamond ' +exe s:pA14c.'triangle<Tab>â–³ <plug>\triangle ' +exe s:pA14c.'vartriangle<Tab>â–³ <plug>\vartriangle ' +exe s:pA14c.'blacktriangle<Tab>â–² <plug>\blacktriangle ' +exe s:pA14c.'triangledown<Tab>â–½ <plug>\triangledown ' +exe s:pA14c.'blacktriangledown<Tab>â–¼ <plug>\blacktriangledown ' +exe s:pA14c.'Box<Tab>â–¡ <plug>\Box ' +exe s:pA14c.'square<Tab>â–¡ <plug>\square ' +exe s:pA14c.'blacksquare<Tab>â–  <plug>\blacksquare ' +exe s:pA14c.'complement<Tab>∠<plug>\complement ' +exe s:pA14c.'mho<Tab>℧ <plug>\mho ' +exe s:pA14c.'Game<Tab>â… <plug>\Game ' +exe s:pA14c.'partial<Tab>`6\ \ ∂ <plug>\partial ' +exe s:pA14c.'smallint<Tab>∫ <plug>\smallint ' +" }}} +" {{{ Logic +let s:pA15 = s:pA."&Logic." +exe s:pA15.'lnot<Tab>¬ <plug>\lnot ' +exe s:pA15.'lor<Tab>∨ <plug>\lor ' +exe s:pA15.'land<Tab>∧ <plug>\land ' +" }}} +" {{{ Limits1 +let s:pA16 = s:pA."&Limits1." +exe s:pA16.'left<Tab>( <plug>\left' +exe s:pA16.'right<Tab>) <plug>\right' +exe s:pA16.'-sepbigl- :' +exe s:pA16.'bigl<Tab> <plug>\bigl' +exe s:pA16.'Bigl<Tab> <plug>\Bigl' +exe s:pA16.'biggl<Tab> <plug>\biggl' +exe s:pA16.'Biggl<Tab> <plug>\Biggl' +exe s:pA16.'-sepbigr- :' +exe s:pA16.'bigr<Tab> <plug>\bigr' +exe s:pA16.'Bigr<Tab> <plug>\Bigr' +exe s:pA16.'biggr<Tab> <plug>\biggr' +exe s:pA16.'Biggr<Tab> <plug>\Biggr' +exe s:pA16.'-sepbig- :' +exe s:pA16.'big<Tab> <plug>\big' +exe s:pA16.'bigm<Tab> <plug>\bigm' +exe s:pA16.'-sepfloor- :' +exe s:pA16.'lfloor<Tab>⌊ <plug>\lfloor ' +exe s:pA16.'lceil<Tab>⌈ <plug>\lceil ' +exe s:pA16.'rfloor<Tab>⌋ <plug>\rfloor ' +exe s:pA16.'rceil<Tab>⌉ <plug>\rceil ' +exe s:pA16.'-sepangle- :' +exe s:pA16.'langle<Tab>〈 <plug>\langle ' +exe s:pA16.'rangle<Tab>〉 <plug>\rangle ' +" }}} +" {{{ Limits2 +let s:pA16a = s:pA."&Limits2." +exe s:pA16a.'ulcorner<Tab>⌜ <plug>\ulcorner ' +exe s:pA16a.'urcorner<Tab>⌠<plug>\urcorner ' +exe s:pA16a.'llcorner<Tab>⌞ <plug>\llcorner ' +exe s:pA16a.'rlcorner<Tab>⌟ <plug>\rlcorner ' +exe s:pA16a.'-sepcorner- :' +exe s:pA16a.'vert<Tab>\| <plug>\vert ' +exe s:pA16a.'Vert<Tab>∥ <plug>\Vert ' +exe s:pA16a.'lvert<Tab> <plug>\lvert ' +exe s:pA16a.'lVert<Tab> <plug>\lVert ' +exe s:pA16a.'rvert<Tab> <plug>\rvert ' +exe s:pA16a.'rVert<Tab> <plug>\rVert ' +exe s:pA16a.'uparrow<Tab>↑ <plug>\uparrow ' +exe s:pA16a.'Uparrow<Tab>⇑ <plug>\Uparrow ' +exe s:pA16a.'downarrow<Tab>↓ <plug>\downarrow ' +exe s:pA16a.'Downarrow<Tab>⇓ <plug>\Downarrow ' +exe s:pA16a.'updownarrow<Tab>↕ <plug>\updownarrow ' +exe s:pA16a.'Updownarrow<Tab>⇕ <plug>\Updownarrow ' +exe s:pA16a.'lgroup<Tab> <plug>\lgroup ' +exe s:pA16a.'rgroup<Tab> <plug>\rgroup ' +exe s:pA16a.'lmoustache<Tab>∫ <plug>\lmoustache ' +exe s:pA16a.'rmoustache<Tab> <plug>\rmoustache ' +exe s:pA16a.'arrowvert<Tab> <plug>\arrowvert ' +exe s:pA16a.'Arrowvert<Tab> <plug>\Arrowvert ' +exe s:pA16a.'bracevert<Tab> <plug>\bracevert ' +" }}} +" {{{ Log-likes +let s:pA17 = s:pA."Lo&g-likes." +exe s:pA17.'arccos<Tab> <plug>\arccos ' +exe s:pA17.'arcsin<Tab> <plug>\arcsin ' +exe s:pA17.'arctan<Tab> <plug>\arctan ' +exe s:pA17.'arg<Tab> <plug>\arg ' +exe s:pA17.'cos<Tab> <plug>\cos ' +exe s:pA17.'cosh<Tab> <plug>\cosh ' +exe s:pA17.'cot<Tab> <plug>\cot ' +exe s:pA17.'coth<Tab> <plug>\coth ' +exe s:pA17.'csc<Tab> <plug>\csc ' +exe s:pA17.'deg<Tab> <plug>\deg ' +exe s:pA17.'det<Tab> <plug>\det ' +exe s:pA17.'dim<Tab> <plug>\dim ' +exe s:pA17.'exp<Tab> <plug>\exp ' +exe s:pA17.'gcd<Tab> <plug>\gcd ' +exe s:pA17.'hom<Tab> <plug>\hom ' +exe s:pA17.'inf<Tab> <plug>\inf ' +exe s:pA17.'injlim<Tab> <plug>\injlim ' +exe s:pA17.'ker<Tab> <plug>\ker ' +exe s:pA17.'lg<Tab> <plug>\lg ' +exe s:pA17.'lim<Tab> <plug>\lim ' +exe s:pA17.'liminf<Tab> <plug>\liminf ' +exe s:pA17.'limsup<Tab> <plug>\limsup ' +exe s:pA17.'ln<Tab> <plug>\ln ' +exe s:pA17.'log<Tab> <plug>\log ' +exe s:pA17.'max<Tab> <plug>\max ' +exe s:pA17.'min<Tab> <plug>\min ' +exe s:pA17.'Pr<Tab> <plug>\Pr ' +exe s:pA17.'projlim<Tab> <plug>\projlim ' +exe s:pA17.'sec<Tab> <plug>\sec ' +exe s:pA17.'sin<Tab> <plug>\sin ' +exe s:pA17.'sinh<Tab> <plug>\sinh ' +exe s:pA17.'sup<Tab> <plug>\sup ' +exe s:pA17.'tan<Tab> <plug>\tan ' +exe s:pA17.'tanh<Tab> <plug>\tanh ' +exe s:pA17.'varlimsup<Tab> <plug>\varlimsup ' +exe s:pA17.'varliminf<Tab> <plug>\varliminf ' +exe s:pA17.'varinjlim<Tab> <plug>\varinjlim ' +exe s:pA17.'varprojlim<Tab> <plug>\varprojlim ' +" }}} +" {{{ MathSpacing +let s:pA18 = s:pA."MathSpacing." +exe s:pA18.', <plug>\, ' +exe s:pA18.': <plug>\: ' +exe s:pA18.'; <plug>\; ' +exe s:pA18.'[space] <plug>\ ' +exe s:pA18.'quad<Tab> <plug>\quad ' +exe s:pA18.'qquad<Tab> <plug>\qquad ' +exe s:pA18.'! <plug>\! ' +exe s:pA18.'thinspace<Tab> <plug>\thinspace ' +exe s:pA18.'medspace<Tab> <plug>\medspace ' +exe s:pA18.'thickspace<Tab> <plug>\thickspace ' +exe s:pA18.'negthinspace<Tab> <plug>\negthinspace ' +exe s:pA18.'negmedspace<Tab> <plug>\negmedspace ' +exe s:pA18.'negthickspace<Tab> <plug>\negthickspace ' +" 1}}} + +" vim:fdm=marker:ff=unix:noet:ts=4:sw=4:fenc=utf-8 diff --git a/.vim/ftplugin/latex-suite/mathmacros.vim b/.vim/ftplugin/latex-suite/mathmacros.vim @@ -0,0 +1,730 @@ +"============================================================================= +" File: mathmacros.vim +" Author: Mikolaj Machowski +" Created: Tue Apr 23 06:00 PM 2002 PST +" +" Description: macros for everything mathematical in latex. +"============================================================================= + +if !(has('gui_running') && g:Tex_MathMenus && g:Tex_Menus) + finish +endif + +let s:MathMenuName = g:Tex_MenuPrefix.'&Math.' + +function! Tex_MathMenuRemove() + exe 'silent! aunmenu '.s:MathMenuName +endfunction + +let s:pA = 'amenu <silent> '.g:Tex_NextMenuLocation.' '.s:MathMenuName +let g:Tex_NextMenuLocation = g:Tex_NextMenuLocation + 1 + +" brackets and dollars {{{ +exe s:pA.'\\&[\ \\] <plug><C-r>=IMAP_PutTextWithMovement("\\[<++>\\]<++>")<cr>' +exe s:pA.'\\&(\ \\) <plug><C-r>=IMAP_PutTextWithMovement("\\(<++>\\)<++>")<cr>' +exe s:pA.'&$\ $ <plug>$$' +exe s:pA.'-sepmath1- :' +" }}} +" MATH arrows {{{ +let s:pA1 = s:pA."&Arrows." +exe s:pA1.'Leftarrow <plug>\leftarrow ' +exe s:pA1.'leftarrow <plug>\leftarrow' +exe s:pA1.'longleftarrow <plug>\longleftarrow ' +exe s:pA1.'Leftarrow <plug>\Leftarrow ' +exe s:pA1.'Longleftarrow <plug>\Longleftarrow ' +exe s:pA1.'rightarrow <plug>\rightarrow ' +exe s:pA1.'longrightarrow <plug>\longrightarrow ' +exe s:pA1.'Rightarrow <plug>\Rightarrow ' +exe s:pA1.'Longrightarrow <plug>\Longrightarrow ' +exe s:pA1.'leftrightarrow <plug>\leftrightarrow ' +exe s:pA1.'longleftrightarrow <plug>\longleftrightarrow ' +exe s:pA1.'Leftrightarrow <plug>\Leftrightarrow ' +exe s:pA1.'Longleftrightarrow <plug>\Longleftrightarrow ' +exe s:pA1.'uparrow <plug>\uparrow ' +exe s:pA1.'Uparrow <plug>\Uparrow ' +exe s:pA1.'downarrow <plug>\downarrow ' +exe s:pA1.'Downarrow <plug>\Downarrow ' +exe s:pA1.'updownarrow <plug>\updownarrow ' +exe s:pA1.'Updownarrow <plug>\Updownarrow ' +exe s:pA1.'nearrow <plug>\nearrow ' +exe s:pA1.'searrow <plug>\searrow ' +exe s:pA1.'swarrow <plug>\swarrow ' +exe s:pA1.'nwarrow <plug>\nwarrow ' +exe s:pA1.'mapsto <plug>\mapsto ' +exe s:pA1.'leadsto <plug>\leadsto ' +exe s:pA1.'longmapsto <plug>\longmapsto ' +exe s:pA1.'hookleftarrow <plug>\hookleftarrow ' +exe s:pA1.'hookrightarrow <plug>\hookrightarrow ' +exe s:pA1.'leftharpoonup <plug>\leftharpoonup ' +exe s:pA1.'leftharpoondown <plug>\leftharpoondown ' +exe s:pA1.'rightharpoonup <plug>\rightharpoonup ' +exe s:pA1.'rightharpoondown <plug>\rightharpoondown ' +exe s:pA1.'rightleftharpoons <plug>\rightleftharpoons ' +exe s:pA1.'overleftarrow <plug>\overleftarrow ' +exe s:pA1.'overrightarrow <plug>\overrightarrow ' +exe s:pA1.'overleftrightarrow <plug>\overleftrightarrow ' +exe s:pA1.'underleftarrow <plug>\underleftarrow ' +exe s:pA1.'underrightarrow <plug>\underrightarrow ' +exe s:pA1.'underleftrightarrow <plug>\underleftrightarrow ' +exe s:pA1.'xleftarrow <plug>\xleftarrow ' +exe s:pA1.'xrightarrow <plug>\xrightarrow ' +" }}} + + +" MATH nArrows {{{ +let s:pA1a = s:pA."&nArrows." +exe s:pA1a.'nleftarrow <plug>\nleftarrow ' +exe s:pA1a.'nLeftarrow <plug>\nLeftarrow ' +exe s:pA1a.'nleftrightarrow <plug>\nleftrightarrow ' +exe s:pA1a.'nrightarrow <plug>\nrightarrow ' +exe s:pA1a.'nRightarrow <plug>\nRightarrow ' +" }}} +" MATH Arrows2 {{{ +let s:pA1a = s:pA."Arrows2." +exe s:pA1a.'dashleftarrow <plug>\dashleftarrow ' +exe s:pA1a.'leftleftarrows <plug>\leftleftarrows ' +exe s:pA1a.'leftrightarrows <plug>\leftrightarrows ' +exe s:pA1a.'Lleftarrow <plug>\Lleftarrow ' +exe s:pA1a.'twoheadleftarrow <plug>\twoheadleftarrow ' +exe s:pA1a.'leftarrowtail <plug>\leftarrowtail ' +exe s:pA1a.'leftrightharpoons <plug>\leftrightharpoons ' +exe s:pA1a.'Lsh <plug>\Lsh ' +exe s:pA1a.'looparrowleft <plug>\looparrowleft ' +exe s:pA1a.'curvearrowleft <plug>\curvearrowleft ' +exe s:pA1a.'circlearrowleft <plug>\circlearrowleft ' +exe s:pA1a.'dashrightarrow <plug>\dashrightarrow ' +exe s:pA1a.'rightrightarrows <plug>\rightrightarrows ' +exe s:pA1a.'rightleftarrows <plug>\rightleftarrows ' +exe s:pA1a.'Rrightarrow <plug>\Rrightarrow ' +exe s:pA1a.'twoheadrightarrow <plug>\twoheadrightarrow ' +exe s:pA1a.'rightarrowtail <plug>\rightarrowtail ' +exe s:pA1a.'rightleftharpoons <plug>\rightleftharpoons ' +exe s:pA1a.'Rsh <plug>\Rsh ' +exe s:pA1a.'looparrowright <plug>\looparrowright ' +exe s:pA1a.'curvearrowright <plug>\curvearrowright ' +exe s:pA1a.'circlearrowright <plug>\circlearrowright ' +exe s:pA1a.'multimap <plug>\multimap ' +exe s:pA1a.'upuparrows <plug>\upuparrows ' +exe s:pA1a.'downdownarrows <plug>\downdownarrows ' +exe s:pA1a.'upharpoonleft <plug>\upharpoonleft ' +exe s:pA1a.'upharpoonright <plug>\upharpoonright ' +exe s:pA1a.'downharpoonleft <plug>\downharpoonleft ' +exe s:pA1a.'downharpoonright <plug>\downharpoonright ' +exe s:pA1a.'rightsquigarrow <plug>\rightsquigarrow ' +exe s:pA1a.'leftrightsquigarrow <plug>\leftrightsquigarrow ' +" }}} +" MATH Fonts {{{ +let s:pA2a = s:pA."&MathFonts." +exe s:pA2a.'mathbf{} <plug><C-r>=IMAP_PutTextWithMovement("\\mathbf{<++>}<++>")<cr>' +exe s:pA2a.'mathrm{} <plug><C-r>=IMAP_PutTextWithMovement("\\mathrm{<++>}<++>")<cr>' +exe s:pA2a.'mathsf{} <plug><C-r>=IMAP_PutTextWithMovement("\\mathsf{<++>}<++>")<cr>' +exe s:pA2a.'mathtt{} <plug><C-r>=IMAP_PutTextWithMovement("\\mathtt{<++>}<++>")<cr>' +exe s:pA2a.'mathit{} <plug><C-r>=IMAP_PutTextWithMovement("\\mathit{<++>}<++>")<cr>' +exe s:pA2a.'mathfrak{} <plug><C-r>=IMAP_PutTextWithMovement("\\mathfrak{<++>}<++>")<cr>' +exe s:pA2a.'mathcal{} <plug><C-r>=IMAP_PutTextWithMovement("\\mathcal{<++>}<++>")<cr>' +exe s:pA2a.'mathscr{} <plug><C-r>=IMAP_PutTextWithMovement("\\mathscr{<++>}<++>")<cr>' +exe s:pA2a.'mathbb{} <plug><C-r>=IMAP_PutTextWithMovement("\\mathbb{<++>}<++>")<cr>' +" }}} +" Greek Letters small {{{ +let s:pA2 = s:pA."&Greek.&Small." +exe s:pA2.'alpha<Tab>`a <plug>\alpha ' +exe s:pA2.'beta<Tab>`b <plug>\beta ' +exe s:pA2.'gamma<Tab>`g <plug>\gamma ' +exe s:pA2.'delta<Tab>`d <plug>\delta ' +exe s:pA2.'epsilon <plug>\epsilon ' +exe s:pA2.'varepsilon<Tab>`e <plug>\varepsilon ' +exe s:pA2.'zeta<Tab>`z <plug>\zeta ' +exe s:pA2.'eta<Tab>`h <plug>\eta ' +exe s:pA2.'theta<Tab>`q <plug>\theta ' +exe s:pA2.'vartheta <plug>\vartheta ' +exe s:pA2.'iota<Tab>`i <plug>\iota ' +exe s:pA2.'kappa<Tab>`k <plug>\kappa ' +exe s:pA2.'lambda<Tab>`l <plug>\lambda ' +exe s:pA2.'mu<Tab>`m <plug>\mu ' +exe s:pA2.'nu<Tab>`n <plug>\nu ' +exe s:pA2.'xi<Tab>`x <plug>\xi ' +exe s:pA2.'pi<Tab>`p <plug>\pi ' +exe s:pA2.'varpi <plug>\varpi ' +exe s:pA2.'rho<Tab>`r <plug>\rho ' +exe s:pA2.'varrho <plug>\varrho ' +exe s:pA2.'sigma<Tab>`s <plug>\sigma ' +exe s:pA2.'varsigma<Tab>`v <plug>\varsigma ' +exe s:pA2.'tau<Tab>`t <plug>\tau ' +exe s:pA2.'upsilon<Tab>`u <plug>\upsilon ' +exe s:pA2.'phi <plug>\phi ' +exe s:pA2.'varphi<Tab>`f <plug>\varphi ' +exe s:pA2.'chi<Tab>`c <plug>\chi ' +exe s:pA2.'psi<Tab>`y <plug>\psi ' +exe s:pA2.'omega<Tab>`w <plug>\omega ' +" }}} +" Greek Letters big {{{ +let s:pA3 = s:pA.'&Greek.&Big.' +exe s:pA3.'Alpha<Tab>`A <plug>\Alpha ' +exe s:pA3.'Beta<Tab>`B <plug>\Beta ' +exe s:pA3.'Gamma<Tab>`G <plug>\Gamma ' +exe s:pA3.'Delta<Tab>`D <plug>\Delta ' +exe s:pA3.'Epsilon<Tab>`E <plug>\Epsilon ' +exe s:pA3.'Zeta<Tab>`Z <plug>\mathrm{Z} ' +exe s:pA3.'Eta<Tab>`H <plug>\Eta ' +exe s:pA3.'Theta <plug>\Theta ' +exe s:pA3.'Iota <plug>\mathrm{I} ' +exe s:pA3.'Kappa<Tab>`K <plug>\Kappa ' +exe s:pA3.'Lambda<Tab>`L <plug>\Lambda ' +exe s:pA3.'Mu<Tab>`M <plug>\Mu ' +exe s:pA3.'Nu<Tab>`N <plug>\Nu ' +exe s:pA3.'Xi<Tab>`X <plug>\Xi ' +exe s:pA3.'Pi<Tab>`P <plug>\Pi ' +exe s:pA3.'Rho<Tab>`R <plug>\Rho ' +exe s:pA3.'Sigma<Tab>`S <plug>\Sigma ' +exe s:pA3.'Tau<Tab>`T <plug>\Tau ' +exe s:pA3.'Upsilon<Tab>`U <plug>\Upsilon ' +exe s:pA3.'Phi <plug>\Phi ' +exe s:pA3.'Chi<Tab>`C <plug>\Chi ' +exe s:pA3.'Psi<Tab>`Y <plug>\Psi ' +exe s:pA3.'Omega<Tab>`W <plug>\Omega ' +" }}} +" BinaryRel1 {{{ +let s:pA4 = s:pA."&BinaryRel1." +exe s:pA4.'ll <plug>\ll ' +exe s:pA4.'lll <plug>\lll ' +exe s:pA4.'leqslant <plug>\leqslant ' +exe s:pA4.'leq <plug>\leq ' +exe s:pA4.'leqq <plug>\leqq ' +exe s:pA4.'eqslantless <plug>\eqslantless ' +exe s:pA4.'lessdot <plug>\lessdot ' +exe s:pA4.'prec <plug>\prec ' +exe s:pA4.'preceq <plug>\preceq ' +exe s:pA4.'preccurlyeq <plug>\preccurlyeq ' +exe s:pA4.'curlyeqprec <plug>\curlyeqprec ' +exe s:pA4.'lesssim <plug>\lesssim ' +exe s:pA4.'lessapprox <plug>\lessapprox ' +exe s:pA4.'precsim <plug>\precsim ' +exe s:pA4.'precapprox <plug>\precapprox ' +exe s:pA4.'in <plug>\in ' +exe s:pA4.'subset<Tab>`( <plug>\subset ' +exe s:pA4.'Subset<Tab>`) <plug>\Subset ' +exe s:pA4.'subseteq <plug>\subseteq ' +exe s:pA4.'subseteqq <plug>\subseteqq ' +exe s:pA4.'sqsubset <plug>\sqsubset ' +exe s:pA4.'sqsubseteq <plug>\sqsubseteq ' +exe s:pA4.'smile <plug>\smile ' +exe s:pA4.'smallsmile <plug>\smallsmile ' +exe s:pA4.'parallel <plug>\parallel ' +exe s:pA4.'shortparallel <plug>\shortparallel ' +exe s:pA4.'dashv <plug>\dashv ' +exe s:pA4.'vdash <plug>\vdash ' +exe s:pA4.'vDash <plug>\vDash ' +exe s:pA4.'models <plug>\models ' +exe s:pA4.'therefore <plug>\therefore ' +exe s:pA4.'backepsilon <plug>\backepsilon ' +" }}} +" nBinaryRel1 {{{ +let s:pA4a = s:pA."&nBinaryRel1." +exe s:pA4a.'nless <plug>\nless ' +exe s:pA4a.'nleqslant <plug>\nleqslant ' +exe s:pA4a.'nleq <plug>\nleq ' +exe s:pA4a.'lneq <plug>\lneq ' +exe s:pA4a.'nleqq <plug>\nleqq ' +exe s:pA4a.'lneqq <plug>\lneqq ' +exe s:pA4a.'lvertneqq <plug>\lvertneqq ' +exe s:pA4a.'nprec <plug>\nprec ' +exe s:pA4a.'npreceq <plug>\npreceq ' +exe s:pA4a.'precneqq <plug>\precneqq ' +exe s:pA4a.'lnsim <plug>\lnsim ' +exe s:pA4a.'lnapprox <plug>\lnapprox ' +exe s:pA4a.'precnsim <plug>\precnsim ' +exe s:pA4a.'precnapprox <plug>\precnapprox ' +exe s:pA4a.'notin <plug>\notin ' +exe s:pA4a.'nsubseteq <plug>\nsubseteq ' +exe s:pA4a.'varsubsetneq <plug>\varsubsetneq ' +exe s:pA4a.'subsetneq <plug>\subsetneq ' +exe s:pA4a.'nsubseteqq <plug>\nsubseteqq ' +exe s:pA4a.'varsubsetneqq <plug>\varsubsetneqq ' +exe s:pA4a.'subsetneqq <plug>\subsetneqq ' +exe s:pA4a.'nparallel <plug>\nparallel ' +exe s:pA4a.'nshortparallel <plug>\nshortparallel ' +exe s:pA4a.'nvdash <plug>\nvdash ' +exe s:pA4a.'nvDash <plug>\nvDash ' +" }}} +" BinaryRel2 {{{ +let s:pA5 = s:pA."&BinaryRel2." +exe s:pA5.'gg <plug>\gg ' +exe s:pA5.'ggg <plug>\ggg ' +exe s:pA5.'gggtr <plug>\gggtr ' +exe s:pA5.'geqslant <plug>\geqslant ' +exe s:pA5.'geq <plug>\geq ' +exe s:pA5.'geqq <plug>\geqq ' +exe s:pA5.'eqslantgtr <plug>\eqslantgtr ' +exe s:pA5.'gtrdot <plug>\gtrdot ' +exe s:pA5.'succ <plug>\succ ' +exe s:pA5.'succeq <plug>\succeq ' +exe s:pA5.'succcurlyeq <plug>\succcurlyeq ' +exe s:pA5.'curlyeqsucc <plug>\curlyeqsucc ' +exe s:pA5.'gtrsim <plug>\gtrsim ' +exe s:pA5.'gtrapprox <plug>\gtrapprox ' +exe s:pA5.'succsim <plug>\succsim ' +exe s:pA5.'succapprox <plug>\succapprox ' +exe s:pA5.'ni <plug>\ni ' +exe s:pA5.'owns <plug>\owns ' +exe s:pA5.'supset <plug>\supset ' +exe s:pA5.'Supset <plug>\Supset ' +exe s:pA5.'supseteq <plug>\supseteq ' +exe s:pA5.'supseteqq <plug>\supseteqq ' +exe s:pA5.'sqsupset <plug>\sqsupset ' +exe s:pA5.'sqsupseteq <plug>\sqsupseteq ' +exe s:pA5.'frown <plug>\frown ' +exe s:pA5.'smallfrown <plug>\smallfrown ' +exe s:pA5.'mid <plug>\mid ' +exe s:pA5.'shortmid <plug>\shortmid ' +exe s:pA5.'between <plug>\between ' +exe s:pA5.'Vdash <plug>\Vdash ' +exe s:pA5.'bowtie <plug>\bowtie ' +exe s:pA5.'Join <plug>\Join ' +exe s:pA5.'pitchfork <plug>\pitchfork ' +" }}} +" {{{ nBinaryRel2 +let s:pA5a = s:pA."n&BinaryRel2." "TODO: dorobiæ logarytmy +exe s:pA5a.'ngtr <plug>\ngtr ' +exe s:pA5a.'ngeqslant <plug>\ngeqslant ' +exe s:pA5a.'ngeq <plug>\ngeq ' +exe s:pA5a.'gneq <plug>\gneq ' +exe s:pA5a.'ngeqq <plug>\ngeqq ' +exe s:pA5a.'gneqq <plug>\gneqq ' +exe s:pA5a.'nsucc <plug>\nsucc ' +exe s:pA5a.'nsucceq <plug>\nsucceq ' +exe s:pA5a.'succneqq <plug>\succneqq ' +exe s:pA5a.'gnsim <plug>\gnsim ' +exe s:pA5a.'gnapprox <plug>\gnapprox ' +exe s:pA5a.'succnsim <plug>\succnsim ' +exe s:pA5a.'succnapprox <plug>\succnapprox ' +exe s:pA5a.'nsupseteq <plug>\nsupseteq ' +exe s:pA5a.'varsupsetneq <plug>\varsupsetneq ' +exe s:pA5a.'supsetneq <plug>\supsetneq ' +exe s:pA5a.'nsupseteqq <plug>\nsupseteqq ' +exe s:pA5a.'varsupsetneqq <plug>\varsupsetneqq ' +exe s:pA5a.'supsetneqq <plug>\supsetneqq ' +exe s:pA5a.'nmid <plug>\nmid ' +exe s:pA5a.'nshortmid <plug>\nshortmid ' +exe s:pA5a.'nVdash <plug>\nVdash ' +" }}} +" {{{ BinaryRel3 +let s:pA6 = s:pA."&BinaryRel3." +exe s:pA6.'doteq <plug>\doteq ' +exe s:pA6.'circeq <plug>\circeq ' +exe s:pA6.'eqcirc <plug>\eqcirc ' +exe s:pA6.'risingdotseq <plug>\risingdotseq ' +exe s:pA6.'doteqdot <plug>\doteqdot ' +exe s:pA6.'Doteq <plug>\Doteq ' +exe s:pA6.'fallingdotseq <plug>\fallingdotseq ' +exe s:pA6.'triangleq <plug>\triangleq ' +exe s:pA6.'bumpeq <plug>\bumpeq ' +exe s:pA6.'Bumpeq <plug>\Bumpeq ' +exe s:pA6.'equiv<Tab>`= <plug>\equiv ' +exe s:pA6.'sim <plug>\sim ' +exe s:pA6.'thicksim <plug>\thicksim ' +exe s:pA6.'backsim <plug>\backsim ' +exe s:pA6.'simeq <plug>\simeq ' +exe s:pA6.'backsimeq <plug>\backsimeq ' +exe s:pA6.'cong <plug>\cong ' +exe s:pA6.'approx<tab>=~ <plug>\approx ' +exe s:pA6.'thickapprox <plug>\thickapprox ' +exe s:pA6.'approxeq <plug>\approxeq ' +exe s:pA6.'blacktriangleleft <plug>\blacktriangleleft ' +exe s:pA6.'vartriangleleft <plug>\vartriangleleft ' +exe s:pA6.'trianglelefteq <plug>\trianglelefteq ' +exe s:pA6.'blacktriangleright <plug>\blacktriangleright ' +exe s:pA6.'vartriangleright <plug>\vartriangleright ' +exe s:pA6.'trianglerighteq <plug>\trianglerighteq ' +exe s:pA6.'perp <plug>\perp ' +exe s:pA6.'asymp <plug>\asymp ' +exe s:pA6.'Vvdash <plug>\Vvdash ' +exe s:pA6.'propto <plug>\propto ' +exe s:pA6.'varpropto <plug>\varpropto ' +exe s:pA6.'because <plug>\because ' +" }}} +" {{{ nBinaryRel3 +let s:pA6a = s:pA."&nBinaryRel3." +exe s:pA6a.'neq <plug>\neq ' +exe s:pA6a.'nsim <plug>\nsim ' +exe s:pA6a.'ncong <plug>\ncong ' +exe s:pA6a.'ntriangleleft <plug>\ntriangleleft ' +exe s:pA6a.'ntrianglelefteq <plug>\ntrianglelefteq ' +exe s:pA6a.'ntriangleright <plug>\ntriangleright ' +exe s:pA6a.'ntrianglerighteq <plug>\ntrianglerighteq ' +" }}} +" {{{ BinaryRel4 +let s:pA7 = s:pA."&BinaryRel4." +exe s:pA7.'lessgtr <plug>\lessgtr ' +exe s:pA7.'gtrless <plug>\gtrless ' +exe s:pA7.'lesseqgtr <plug>\lesseqgtr ' +exe s:pA7.'gtreqless <plug>\gtreqless ' +exe s:pA7.'lesseqqgtr <plug>\lesseqqgtr ' +exe s:pA7.'gtreqqless <plug>\gtreqqless ' +" }}} +" {{{ BigOp +let s:pA8a = s:pA."&BigOp." +exe s:pA8a.'limits <plug>\limits' +exe s:pA8a.'nolimits <plug>\nolimits' +exe s:pA8a.'displaylimits <plug>\displaylimits' +exe s:pA8a.'-seplimits- :' +exe s:pA8a.'bigcap<Tab>`- <plug>\bigcap' +exe s:pA8a.'bigcup<Tab>`+ <plug>\bigcup' +exe s:pA8a.'bigodot <plug>\bigodot' +exe s:pA8a.'bigoplus <plug>\bigoplus' +exe s:pA8a.'bigotimes <plug>\bigotimes' +exe s:pA8a.'bigsqcup <plug>\bigsqcup' +exe s:pA8a.'biguplus <plug>\biguplus' +exe s:pA8a.'bigvee <plug>\bigvee' +exe s:pA8a.'bigwedge <plug>\bigwedge' +exe s:pA8a.'coprod <plug>\coprod' +exe s:pA8a.'int <plug>\int' +exe s:pA8a.'oint <plug>\oint' +exe s:pA8a.'prod <plug>\prod' +exe s:pA8a.'sum <plug>\sum' +" }}} +" {{{ BinaryOp +let s:pA8 = s:pA."&BinaryOp." +exe s:pA8.'pm <plug>\pm ' +exe s:pA8.'mp <plug>\mp ' +exe s:pA8.'dotplus <plug>\dotplus ' +exe s:pA8.'cdot<Tab>`. <plug>\cdot ' +exe s:pA8.'centerdot <plug>\centerdot ' +exe s:pA8.'times<Tab>`* <plug>\times ' +exe s:pA8.'ltimes <plug>\ltimes ' +exe s:pA8.'rtimes <plug>\rtimes ' +exe s:pA8.'leftthreetimes <plug>\leftthreetimes ' +exe s:pA8.'rightthreetimes <plug>\rightthreetimes ' +exe s:pA8.'div <plug>\div ' +exe s:pA8.'divideontimes <plug>\divideontimes ' +exe s:pA8.'bmod <plug>\bmod ' +exe s:pA8.'ast <plug>\ast ' +exe s:pA8.'star <plug>\star ' +exe s:pA8.'setminus<Tab>`\\ <plug>\setminus ' +exe s:pA8.'smallsetminus <plug>\smallsetminus ' +exe s:pA8.'diamond <plug>\diamond ' +exe s:pA8.'wr <plug>\wr ' +exe s:pA8.'intercal <plug>\intercal ' +exe s:pA8.'circ<Tab>`@ <plug>\circ ' +exe s:pA8.'bigcirc <plug>\bigcirc ' +exe s:pA8.'bullet <plug>\bullet ' +exe s:pA8.'cap <plug>\cap ' +exe s:pA8.'Cap <plug>\Cap ' +exe s:pA8.'cup <plug>\cup ' +exe s:pA8.'Cup <plug>\Cup ' +exe s:pA8.'sqcap <plug>\sqcap ' +exe s:pA8.'sqcup <plug>\sqcup' +exe s:pA8.'amalg <plug>\amalg ' +exe s:pA8.'uplus <plug>\uplus ' +exe s:pA8.'triangleleft <plug>\triangleleft ' +exe s:pA8.'triangleright <plug>\triangleright ' +exe s:pA8.'bigtriangleup <plug>\bigtriangleup ' +exe s:pA8.'bigtriangledown <plug>\bigtriangledown ' +exe s:pA8.'vee <plug>\vee ' +exe s:pA8.'veebar <plug>\veebar ' +exe s:pA8.'curlyvee <plug>\curlyvee ' +exe s:pA8.'wedge<Tab>`& <plug>\wedge ' +exe s:pA8.'barwedge <plug>\barwedge ' +exe s:pA8.'doublebarwedge <plug>\doublebarwedge ' +exe s:pA8.'curlywedge <plug>\curlywedge ' +exe s:pA8.'oplus <plug>\oplus ' +exe s:pA8.'ominus <plug>\ominus ' +exe s:pA8.'otimes <plug>\otimes ' +exe s:pA8.'oslash <plug>\oslash ' +exe s:pA8.'boxplus <plug>\boxplus ' +exe s:pA8.'boxminus <plug>\boxminus ' +exe s:pA8.'boxtimes <plug>\boxtimes ' +exe s:pA8.'boxdot <plug>\boxdot ' +exe s:pA8.'odot <plug>\odot ' +exe s:pA8.'circledast <plug>\circledast ' +exe s:pA8.'circleddash <plug>\circleddash ' +exe s:pA8.'circledcirc <plug>\circledcirc ' +exe s:pA8.'dagger <plug>\dagger ' +exe s:pA8.'ddagger <plug>\ddagger ' +exe s:pA8.'lhd <plug>\lhd ' +exe s:pA8.'unlhd <plug>\unlhd ' +exe s:pA8.'rhd <plug>\rhd ' +exe s:pA8.'unrhd <plug>\unrhd ' +" }}} +" {{{ Other1 +let s:pA9 = s:pA."&Other1." +exe s:pA9.'hat <plug>\hat ' +exe s:pA9.'check <plug>\check ' +exe s:pA9.'grave <plug>\grave ' +exe s:pA9.'acute <plug>\acute ' +exe s:pA9.'dot <plug>\dot ' +exe s:pA9.'ddot <plug>\ddot ' +exe s:pA9.'tilde<Tab>`, <plug>\tilde ' +exe s:pA9.'breve <plug>\breve ' +exe s:pA9.'bar <plug>\bar ' +exe s:pA9.'vec <plug>\vec ' +exe s:pA9.'aleph <plug>\aleph ' +exe s:pA9.'hbar <plug>\hbar ' +exe s:pA9.'imath <plug>\imath ' +exe s:pA9.'jmath <plug>\jmath ' +exe s:pA9.'ell <plug>\ell ' +exe s:pA9.'wp <plug>\wp ' +exe s:pA9.'Re <plug>\Re ' +exe s:pA9.'Im <plug>\Im ' +exe s:pA9.'partial <plug>\partial ' +exe s:pA9.'infty<Tab>`8 <plug>\infty ' +exe s:pA9.'prime <plug>\prime ' +exe s:pA9.'emptyset <plug>\emptyset ' +exe s:pA9.'nabla <plug>\nabla ' +exe s:pA9.'surd <plug>\surd ' +exe s:pA9.'top <plug>\top ' +exe s:pA9.'bot <plug>\bot ' +exe s:pA9.'angle <plug>\angle ' +exe s:pA9.'triangle <plug>\triangle ' +exe s:pA9.'backslash <plug>\backslash ' +exe s:pA9.'forall <plug>\forall ' +exe s:pA9.'exists <plug>\exists ' +exe s:pA9.'neg <plug>\neg ' +exe s:pA9.'flat <plug>\flat ' +exe s:pA9.'natural <plug>\natural ' +exe s:pA9.'sharp <plug>\sharp ' +exe s:pA9.'clubsuit <plug>\clubsuit ' +exe s:pA9.'diamondsuit <plug>\diamondsuit ' +exe s:pA9.'heartsuit <plug>\heartsuit ' +exe s:pA9.'spadesuit <plug>\spadesuit ' +exe s:pA9.'S <plug>\S ' +exe s:pA9.'P <plug>\P' +" }}} +" {{{ MathCreating +let s:pA10 = s:pA."&MathCreating." +exe s:pA10.'not <plug>\not' +exe s:pA10.'mkern <plug>\mkern' +exe s:pA10.'mathbin <plug>\mathbin' +exe s:pA10.'mathrel <plug>\mathrel' +exe s:pA10.'stackrel <plug>\stackrel' +exe s:pA10.'mathord <plug>\mathord' +" }}} +" {{{ Styles +let s:pA11 = s:pA."&Styles." +exe s:pA11.'displaystyle <plug>\displaystyle' +exe s:pA11.'textstyle <plug>\textstyle' +exe s:pA11.'scritpstyle <plug>\scritpstyle' +exe s:pA11.'scriptscriptstyle <plug>\scriptscriptstyle' +" }}} +" {{{ MathDiacritics +let s:pA12 = s:pA."&MathDiacritics." +exe s:pA12.'acute{} <plug><C-r>=IMAP_PutTextWithMovement("\\acute{<++>}<++>")<cr>' +exe s:pA12.'bar{}<Tab>`_ <plug><C-r>=IMAP_PutTextWithMovement("\\bar{<++>}<++>")<cr>' +exe s:pA12.'breve{} <plug><C-r>=IMAP_PutTextWithMovement("\\breve{<++>}<++>")<cr>' +exe s:pA12.'check{} <plug><C-r>=IMAP_PutTextWithMovement("\\check{<++>}<++>")<cr>' +exe s:pA12.'ddot{}<Tab>`: <plug><C-r>=IMAP_PutTextWithMovement("\\ddot{<++>}<++>")<cr>' +exe s:pA12.'dot{}<Tab>`; <plug><C-r>=IMAP_PutTextWithMovement("\\dot{<++>}<++>")<cr>' +exe s:pA12.'grave{} <plug><C-r>=IMAP_PutTextWithMovement("\\grave{<++>}<++>")<cr>' +exe s:pA12.'hat{}<Tab>`^ <plug><C-r>=IMAP_PutTextWithMovement("\\hat{<++>}<++>")<cr>' +exe s:pA12.'tilde{}<tab>`~ <plug><C-r>=IMAP_PutTextWithMovement("\\tilde{<++>}<++>")<cr>' +exe s:pA12.'vec{} <plug><C-r>=IMAP_PutTextWithMovement("\\vec{<++>}<++>")<cr>' +exe s:pA12.'widehat{} <plug><C-r>=IMAP_PutTextWithMovement("\\widehat{<++>}<++>")<cr>' +exe s:pA12.'widetilde{} <plug><C-r>=IMAP_PutTextWithMovement("\\widetilde{<++>}<++>")<cr>' +exe s:pA12.'imath <plug><C-r>=IMAP_PutTextWithMovement("\\imath")<cr>' +exe s:pA12.'jmath <plug><C-r>=IMAP_PutTextWithMovement("\\jmath")<cr>' +" }}} +" {{{ OverlineAndCo +let s:pA13 = s:pA."&OverlineAndCo." +exe s:pA13.'overline{} <plug><C-r>=IMAP_PutTextWithMovement("\\overline{}")<cr>' +exe s:pA13.'underline{} <plug><C-r>=IMAP_PutTextWithMovement("\\underline{}")<cr>' +exe s:pA13.'overrightarrow{} <plug><C-r>=IMAP_PutTextWithMovement("\\overrightarrow{}")<cr>' +exe s:pA13.'overleftarrow{} <plug><C-r>=IMAP_PutTextWithMovement("\\overleftarrow{}")<cr>' +exe s:pA13.'overbrace{} <plug><C-r>=IMAP_PutTextWithMovement("\\overbrace{}")<cr>' +exe s:pA13.'underbrace{} <plug><C-r>=IMAP_PutTextWithMovement("\\underbrace{}")<cr>' +" }}} +" {{{ Symbols1 +let s:pA14a = s:pA."&Symbols1." +exe s:pA14a.'forall <plug>\forall ' +exe s:pA14a.'exists <plug>\exists ' +exe s:pA14a.'nexists <plug>\nexists ' +exe s:pA14a.'neg <plug>\neg ' +exe s:pA14a.'top <plug>\top ' +exe s:pA14a.'bot <plug>\bot ' +exe s:pA14a.'emptyset <plug>\emptyset ' +exe s:pA14a.'varnothing <plug>\varnothing ' +exe s:pA14a.'infty <plug>\infty ' +exe s:pA14a.'aleph <plug>\aleph ' +exe s:pA14a.'beth <plug>\beth ' +exe s:pA14a.'gimel <plug>\gimel ' +exe s:pA14a.'daleth <plug>\daleth ' +exe s:pA14a.'hbar <plug>\hbar ' +exe s:pA14a.'hslash <plug>\hslash ' +exe s:pA14a.'diagup <plug>\diagup ' +exe s:pA14a.'vert <plug>\vert ' +exe s:pA14a.'Vert <plug>\Vert ' +exe s:pA14a.'backslash <plug>\backslash ' +exe s:pA14a.'diagdown <plug>\diagdown ' +exe s:pA14a.'Bbbk <plug>\Bbbk ' +exe s:pA14a.'P <plug>\P ' +exe s:pA14a.'S <plug>\S ' +" }}} +" {{{ Symbols2 +let s:pA14b = s:pA."&Symbols2." +exe s:pA14b.'# <plug>\# ' +exe s:pA14b.'% <plug>\% ' +exe s:pA14b.'_ <plug>\_ ' +exe s:pA14b.'$ <plug>\$ ' +exe s:pA14b.'& <plug>\& ' +exe s:pA14b.'imath <plug>\imath ' +exe s:pA14b.'jmath <plug>\jmath ' +exe s:pA14b.'ell <plug>\ell ' +exe s:pA14b.'wp <plug>\wp ' +exe s:pA14b.'Re <plug>\Re ' +exe s:pA14b.'Im <plug>\Im ' +exe s:pA14b.'prime <plug>\prime ' +exe s:pA14b.'backprime <plug>\backprime ' +exe s:pA14b.'nabla <plug>\nabla ' +exe s:pA14b.'surd <plug>\surd ' +exe s:pA14b.'flat <plug>\flat ' +exe s:pA14b.'sharp <plug>\sharp ' +exe s:pA14b.'natural <plug>\natural ' +exe s:pA14b.'eth <plug>\eth ' +exe s:pA14b.'bigstar <plug>\bigstar ' +exe s:pA14b.'circledS <plug>\circledS ' +exe s:pA14b.'Finv <plug>\Finv ' +exe s:pA14b.'dag <plug>\dag ' +exe s:pA14b.'ddag <plug>\ddag ' +" }}} +" {{{ Symbols3 +let s:pA14c = s:pA."&Symbols3." +exe s:pA14c.'angle <plug>\angle ' +exe s:pA14c.'measuredangle <plug>\measuredangle ' +exe s:pA14c.'sphericalangle <plug>\sphericalangle ' +exe s:pA14c.'spadesuit <plug>\spadesuit ' +exe s:pA14c.'heartsuit <plug>\heartsuit ' +exe s:pA14c.'diamondsuit <plug>\diamondsuit ' +exe s:pA14c.'clubsuit <plug>\clubsuit ' +exe s:pA14c.'lozenge <plug>\lozenge ' +exe s:pA14c.'blacklozenge <plug>\blacklozenge ' +exe s:pA14c.'Diamond <plug>\Diamond ' +exe s:pA14c.'triangle <plug>\triangle ' +exe s:pA14c.'vartriangle <plug>\vartriangle ' +exe s:pA14c.'blacktriangle <plug>\blacktriangle ' +exe s:pA14c.'triangledown <plug>\triangledown ' +exe s:pA14c.'blacktriangledown <plug>\blacktriangledown ' +exe s:pA14c.'Box <plug>\Box ' +exe s:pA14c.'square <plug>\square ' +exe s:pA14c.'blacksquare <plug>\blacksquare ' +exe s:pA14c.'complement <plug>\complement ' +exe s:pA14c.'mho <plug>\mho ' +exe s:pA14c.'Game <plug>\Game ' +exe s:pA14c.'partial<Tab>`6 <plug>\partial ' +exe s:pA14c.'smallint <plug>\smallint ' +" }}} +" {{{ Logic +let s:pA15 = s:pA."&Logic." +exe s:pA15.'lnot <plug>\lnot ' +exe s:pA15.'lor <plug>\lor ' +exe s:pA15.'land <plug>\land ' +" }}} +" {{{ Limits1 +let s:pA16 = s:pA."&Limits1." +exe s:pA16.'left <plug>\left' +exe s:pA16.'right <plug>\right' +exe s:pA16.'-sepbigl- :' +exe s:pA16.'bigl <plug>\bigl' +exe s:pA16.'Bigl <plug>\Bigl' +exe s:pA16.'biggl <plug>\biggl' +exe s:pA16.'Biggl <plug>\Biggl' +exe s:pA16.'-sepbigr- :' +exe s:pA16.'bigr <plug>\bigr' +exe s:pA16.'Bigr <plug>\Bigr' +exe s:pA16.'biggr <plug>\biggr' +exe s:pA16.'Biggr <plug>\Biggr' +exe s:pA16.'-sepbig- :' +exe s:pA16.'big <plug>\big' +exe s:pA16.'bigm <plug>\bigm' +exe s:pA16.'-sepfloor- :' +exe s:pA16.'lfloor <plug>\lfloor ' +exe s:pA16.'lceil <plug>\lceil ' +exe s:pA16.'rfloor <plug>\rfloor ' +exe s:pA16.'rceil <plug>\rceil ' +exe s:pA16.'-sepangle- :' +exe s:pA16.'langle <plug>\langle ' +exe s:pA16.'rangle <plug>\rangle ' +" }}} +" {{{ Limits2 +let s:pA16a = s:pA."&Limits2." +exe s:pA16a.'ulcorner <plug>\ulcorner ' +exe s:pA16a.'urcorner <plug>\urcorner ' +exe s:pA16a.'llcorner <plug>\llcorner ' +exe s:pA16a.'rlcorner <plug>\rlcorner ' +exe s:pA16a.'-sepcorner- :' +exe s:pA16a.'vert <plug>\vert ' +exe s:pA16a.'Vert <plug>\Vert ' +exe s:pA16a.'lvert <plug>\lvert ' +exe s:pA16a.'lVert <plug>\lVert ' +exe s:pA16a.'rvert <plug>\rvert ' +exe s:pA16a.'rVert <plug>\rVert ' +exe s:pA16a.'uparrow <plug>\uparrow ' +exe s:pA16a.'Uparrow <plug>\Uparrow ' +exe s:pA16a.'downarrow <plug>\downarrow ' +exe s:pA16a.'Downarrow <plug>\Downarrow ' +exe s:pA16a.'updownarrow <plug>\updownarrow ' +exe s:pA16a.'Updownarrow <plug>\Updownarrow ' +exe s:pA16a.'lgroup <plug>\lgroup ' +exe s:pA16a.'rgroup <plug>\rgroup ' +exe s:pA16a.'lmoustache <plug>\lmoustache ' +exe s:pA16a.'rmoustache <plug>\rmoustache ' +exe s:pA16a.'arrowvert <plug>\arrowvert ' +exe s:pA16a.'Arrowvert <plug>\Arrowvert ' +exe s:pA16a.'bracevert <plug>\bracevert ' +" }}} +" {{{ Log-likes +let s:pA17 = s:pA."Lo&g-likes." +exe s:pA17.'arccos <plug>\arccos ' +exe s:pA17.'arcsin <plug>\arcsin ' +exe s:pA17.'arctan <plug>\arctan ' +exe s:pA17.'arg <plug>\arg ' +exe s:pA17.'cos <plug>\cos ' +exe s:pA17.'cosh <plug>\cosh ' +exe s:pA17.'cot <plug>\cot ' +exe s:pA17.'coth <plug>\coth ' +exe s:pA17.'csc <plug>\csc ' +exe s:pA17.'deg <plug>\deg ' +exe s:pA17.'det <plug>\det ' +exe s:pA17.'dim <plug>\dim ' +exe s:pA17.'exp <plug>\exp ' +exe s:pA17.'gcd <plug>\gcd ' +exe s:pA17.'hom <plug>\hom ' +exe s:pA17.'inf <plug>\inf ' +exe s:pA17.'injlim <plug>\injlim ' +exe s:pA17.'ker <plug>\ker ' +exe s:pA17.'lg <plug>\lg ' +exe s:pA17.'lim <plug>\lim ' +exe s:pA17.'liminf <plug>\liminf ' +exe s:pA17.'limsup <plug>\limsup ' +exe s:pA17.'ln <plug>\ln ' +exe s:pA17.'log <plug>\log ' +exe s:pA17.'max <plug>\max ' +exe s:pA17.'min <plug>\min ' +exe s:pA17.'Pr <plug>\Pr ' +exe s:pA17.'projlim <plug>\projlim ' +exe s:pA17.'sec <plug>\sec ' +exe s:pA17.'sin <plug>\sin ' +exe s:pA17.'sinh <plug>\sinh ' +exe s:pA17.'sup <plug>\sup ' +exe s:pA17.'tan <plug>\tan ' +exe s:pA17.'tanh <plug>\tanh ' +exe s:pA17.'varlimsup <plug>\varlimsup ' +exe s:pA17.'varliminf <plug>\varliminf ' +exe s:pA17.'varinjlim <plug>\varinjlim ' +exe s:pA17.'varprojlim <plug>\varprojlim ' +" }}} +" {{{ MathSpacing +let s:pA18 = s:pA."MathSpacing." +exe s:pA18.', <plug>\, ' +exe s:pA18.': <plug>\: ' +exe s:pA18.'; <plug>\; ' +exe s:pA18.'[space] <plug>\ ' +exe s:pA18.'quad <plug>\quad ' +exe s:pA18.'qquad <plug>\qquad ' +exe s:pA18.'! <plug>\! ' +exe s:pA18.'thinspace <plug>\thinspace ' +exe s:pA18.'medspace <plug>\medspace ' +exe s:pA18.'thickspace <plug>\thickspace ' +exe s:pA18.'negthinspace <plug>\negthinspace ' +exe s:pA18.'negmedspace <plug>\negmedspace ' +exe s:pA18.'negthickspace <plug>\negthickspace ' +" 1}}} + +" vim:fdm=marker:ff=unix:noet:ts=4:sw=4 diff --git a/.vim/ftplugin/latex-suite/multicompile.vim b/.vim/ftplugin/latex-suite/multicompile.vim @@ -0,0 +1,17 @@ +" ============================================================================ +" File: multicompile.vim +" Author: Srinath Avadhanula +" Created: Sat Jul 05 03:00 PM 2003 +" Description: compile a .tex file multiple times to get cross references +" right. +" License: Vim Charityware License +" Part of vim-latexSuite: http://vim-latex.sourceforge.net +" CVS: $Id: multicompile.vim 997 2006-03-20 09:45:45Z srinathava $ +" ============================================================================ + +" The contents of this file have been moved to compiler.vim, the file which +" contains all functions relevant to compiling and viewing. +" This file is kept empty on purpose so that it will over-write previous +" versions of multicompile.vim, therby preventing conflicts. + +" vim:fdm=marker:nowrap:noet:ff=unix:ts=4:sw=4 diff --git a/.vim/ftplugin/latex-suite/outline.py b/.vim/ftplugin/latex-suite/outline.py @@ -0,0 +1,194 @@ +#!/usr/bin/python + +# Part of Latex-Suite +# +# Copyright: Srinath Avadhanula +# Description: +# This file implements a simple outline creation for latex documents. + +import re +import os +import sys +import StringIO + +# getFileContents {{{ +def getFileContents(fname): + if type(fname) is not str: + fname = fname.group(3) + + # If neither the file or file.tex exists, then we just give up. + if not os.path.isfile(fname): + if os.path.isfile(fname + '.tex'): + fname += '.tex' + else: + return '' + + try: + # This longish thing is to make sure that all files are converted into + # \n seperated lines. + contents = '\n'.join(open(fname).read().splitlines()) + except IOError: + return '' + + # TODO what are all the ways in which a tex file can include another? + pat = re.compile(r'^\\(@?)(include|input){(.*?)}', re.M) + contents = re.sub(pat, getFileContents, contents) + + return ('%%==== FILENAME: %s' % fname) + '\n' + contents + +# }}} +# stripComments {{{ +def stripComments(contents): + # remove all comments except those of the form + # %%==== FILENAME: <filename.tex> + # BUG: This comment right after a new paragraph is not recognized: foo\\%comment + uncomm = [re.sub('(?<!\\\\)%(?!==== FILENAME: ).*', '', line) for line in contents.splitlines()] + # also remove all only-whitespace lines. + nonempty = [line for line in uncomm if line.strip()] + + return nonempty +# }}} +# addFileNameAndNumber {{{ +def addFileNameAndNumber(lines): + filename = '' + retval = '' + for line in lines: + if re.match('%==== FILENAME: ', line): + filename = line.split('%==== FILENAME: ')[1] + else: + retval += '<%s>%s\n' % (filename, line) + + return retval +# }}} +# getSectionLabels_Root {{{ +def getSectionLabels_Root(lineinfo, section_prefix, label_prefix): + prev_txt = '' + inside_env = 0 + prev_env = '' + outstr = StringIO.StringIO('') + pres_depth = len(section_prefix) + + #print '+getSectionLabels_Root: lineinfo = [%s]' % lineinfo + for line in lineinfo.splitlines(): + if not line: + continue + + # throw away leading white-space + m = re.search('<(.*?)>(.*)', line) + + fname = m.group(1) + line = m.group(2).lstrip() + + # we found a label! + m = re.search(r'\\label{(%s.*?)}' % label_prefix, line) + if m: + # add the current line (except the \label command) to the text + # which will be displayed below this label + prev_txt += re.search(r'(^.*?)\\label{', line).group(1) + + # for the figure environment however, just display the caption. + # instead of everything since the \begin command. + if prev_env == 'figure': + cm = re.search(r'\caption(\[.*?\]\s*)?{(.*?)}', prev_txt) + if cm: + prev_txt = cm.group(2) + + # print a nice formatted text entry like so + # + # > eqn:label + # : e^{i\pi} + 1 = 0 + # + # Use the current "section depth" for the leading indentation. + print >>outstr, '>%s%s\t\t<%s>' % (' '*(2*pres_depth+2), + m.group(1), fname) + print >>outstr, ':%s%s' % (' '*(2*pres_depth+4), prev_txt) + prev_txt = '' + + # If we just encoutered the start or end of an environment or a + # label, then do not remember this line. + # NOTE: This assumes that there is no equation text on the same + # line as the \begin or \end command. The text on the same line as + # the \label was already handled. + if re.search(r'\\begin{(equation|eqnarray|align|figure)', line): + prev_txt = '' + prev_env = re.search(r'\\begin{(.*?)}', line).group(1) + inside_env = 1 + + elif re.search(r'\\label', line): + prev_txt = '' + + elif re.search(r'\\end{(equation|eqnarray|align|figure)', line): + inside_env = 0 + prev_env = '' + + else: + # If we are inside an environment, then the text displayed with + # the label is the complete text within the environment, + # otherwise its just the previous line. + if inside_env: + prev_txt += line + else: + prev_txt = line + + return outstr.getvalue() + +# }}} +# getSectionLabels {{{ +def getSectionLabels(lineinfo, + sectypes=['chapter', 'section', 'subsection', 'subsubsection'], + section_prefix='', label_prefix=''): + + if not sectypes: + return getSectionLabels_Root(lineinfo, section_prefix, label_prefix) + + ##print 'sectypes[0] = %s, section_prefix = [%s], lineinfo = [%s]' % ( + ## sectypes[0], section_prefix, lineinfo) + + sections = re.split(r'(<.*?>\\%s{.*})' % sectypes[0], lineinfo) + + # there will 1+2n sections, the first containing the "preamble" and the + # others containing the child sections as paris of [section_name, + # section_text] + + rettext = getSectionLabels(sections[0], sectypes[1:], section_prefix, label_prefix) + + for i in range(1,len(sections),2): + sec_num = (i+1)/2 + section_name = re.search(r'\\%s{(.*?)}' % sectypes[0], sections[i]).group(1) + section_label_text = getSectionLabels(sections[i] + sections[i+1], sectypes[1:], + section_prefix+('%d.' % sec_num), label_prefix) + + if section_label_text: + sec_heading = 2*' '*len(section_prefix) + section_prefix + sec_heading += '%d. %s' % (sec_num, section_name) + sec_heading += '<<<%d\n' % (len(section_prefix)/2+1) + + rettext += sec_heading + section_label_text + + return rettext + +# }}} + +# main {{{ +def main(fname, label_prefix): + [head, tail] = os.path.split(fname) + if head: + os.chdir(head) + + contents = getFileContents(fname) + nonempty = stripComments(contents) + lineinfo = addFileNameAndNumber(nonempty) + + return getSectionLabels(lineinfo, label_prefix=label_prefix) +# }}} + +if __name__ == "__main__": + if len(sys.argv) > 2: + prefix = sys.argv[2] + else: + prefix = '' + + print main(sys.argv[1], prefix) + + +# vim: fdm=marker diff --git a/.vim/ftplugin/latex-suite/packages.vim b/.vim/ftplugin/latex-suite/packages.vim @@ -0,0 +1,677 @@ +"============================================================================= +" File: packages.vim +" Author: Mikolaj Machowski +" Created: Tue Apr 23 06:00 PM 2002 PST +" CVS: $Id: packages.vim 1071 2009-09-30 12:17:28Z tmaas $ +" +" Description: handling packages from within vim +"============================================================================= + +" avoid reinclusion. +if !g:Tex_PackagesMenu || exists('s:doneOnce') + finish +endif +let s:doneOnce = 1 + +let s:path = fnameescape(expand("<sfile>:p:h")) + +let s:menu_div = 20 + +com! -nargs=0 TPackageUpdate :silent! call Tex_pack_updateall(1) +com! -nargs=0 TPackageUpdateAll :silent! call Tex_pack_updateall(1) + +" Custom command-line completion of Tcommands is very useful but this feature +" is available only in Vim 6.2 and above. Check number of version and choose +" proper command and function. +if v:version >= 602 + com! -complete=custom,Tex_CompletePackageName -nargs=* TPackage let s:retVal = Tex_pack_one(<f-args>) <bar> normal! i<C-r>=s:retVal<CR> + + " Tex_CompletePackageName: for completing names in TPackage command {{{ + " Description: get list of package names with globpath(), remove full path + " and return list of names separated with newlines. + " + function! Tex_CompletePackageName(A,P,L) + " Get name of packages from all runtimepath directories + let packnames = Tex_FindInRtp('', 'packages') + let packnames = substitute(packnames, '^,', '', 'e') + " Separate names with \n not , + let packnames = substitute(packnames,',','\n','g') + return packnames + endfunction + " }}} + +else + com! -nargs=* TPackage let s:retVal = Tex_pack_one(<f-args>) <bar> normal! i<C-r>=s:retVal<CR> + +endif + +imap <silent> <plug> <Nop> +nmap <silent> <plug> i + +let g:Tex_package_supported = '' +let g:Tex_package_detected = '' +" Remember the defaults because we want g:Tex_PromptedEnvironments to contain +" in addition to the default, \newenvironments, and the \newenvironments might +" change... +let g:Tex_PromptedEnvironmentsDefault = g:Tex_PromptedEnvironments +let g:Tex_PromptedCommandsDefault = g:Tex_PromptedCommands + + +" Tex_pack_check: creates the package menu and adds to 'dict' setting. {{{ +" +function! Tex_pack_check(package) + " Use Tex_FindInRtp() function to get first name from packages list in all + " rtp directories conforming with latex-suite directories hierarchy + " Store names in variables to process functions only once. + let packname = Tex_FindInRtp(a:package, 'packages') + if packname != '' + exe 'runtime! ftplugin/latex-suite/packages/' . a:package + if has("gui_running") + call Tex_pack(a:package) + endif + if g:Tex_package_supported !~ a:package + let g:Tex_package_supported = g:Tex_package_supported.','.a:package + endif + endif + " Return full list of dictionaries (separated with ,) for package in &rtp + call Tex_Debug("Tex_pack_check: searching for ".a:package." in dictionaries/ in &rtp", "pack") + let dictname = Tex_FindInRtp(a:package, 'dictionaries', ':p') + if dictname != '' + exe 'setlocal dict^=' . dictname + call Tex_Debug('Tex_pack_check: setlocal dict^=' . dictname, 'pack') + if g:Tex_package_supported !~ a:package + let g:Tex_package_supported = g:Tex_package_supported.','.a:package + endif + endif + if g:Tex_package_detected !~ '\<'.a:package.'\>' + let g:Tex_package_detected = g:Tex_package_detected.','.a:package + endif + let g:Tex_package_detected = substitute(g:Tex_package_detected, '^,', '', '') + let g:Tex_package_supported = substitute(g:Tex_package_supported, '^,', '', '') +endfunction + +" }}} +" Tex_pack_uncheck: removes package from menu and 'dict' settings. {{{ +function! Tex_pack_uncheck(package) + if has("gui_running") && Tex_FindInRtp(a:package, 'packages') != '' + exe 'silent! aunmenu '.g:Tex_PackagesMenuLocation.'-sep'.a:package.'-' + exe 'silent! aunmenu '.g:Tex_PackagesMenuLocation.a:package.'\ Options' + exe 'silent! aunmenu '.g:Tex_PackagesMenuLocation.a:package.'\ Commands' + endif + if Tex_FindInRtp(a:package, 'dictionaries') != '' + exe 'setlocal dict-='.Tex_FindInRtp(a:package, 'dictionaries') + endif +endfunction + +" }}} +" Tex_pack_updateall: updates the TeX-Packages menu {{{ +" Description: +" This function first calls Tex_pack_all to scan for \usepackage's etc if +" necessary. After that, it 'supports' and 'unsupports' packages as needed +" in such a way as to not repeat work. +function! Tex_pack_updateall(force) + call Tex_Debug('+Tex_pack_updateall', 'pack') + + " Find out which file we need to scan. + let fname = Tex_GetMainFileName(':p') + + " If this is the same as last time, don't repeat. + if !a:force && exists('s:lastScannedFile') && + \ s:lastScannedFile == fname + return + endif + " Remember which file we scanned for next time. + let s:lastScannedFile = fname + + " Remember which packages we detected last time. + if exists('g:Tex_package_detected') + let oldpackages = g:Tex_package_detected + else + let oldpackages = '' + endif + + " This sets up a global variable of all detected packages. + let g:Tex_package_detected = '' + " reset the environments and commands. + let g:Tex_PromptedEnvironments = g:Tex_PromptedEnvironmentsDefault + let g:Tex_PromptedCommands = g:Tex_PromptedCommandsDefault + + if expand('%:p') != fname + call Tex_Debug(':Tex_pack_updateall: sview '.Tex_EscapeSpaces(fname), 'pack') + exe 'sview '.Tex_EscapeSpaces(fname) + else + call Tex_Debug(':Tex_pack_updateall: split', 'pack') + split + endif + + call Tex_ScanForPackages() + q + + call Tex_Debug(':Tex_pack_updateall: detected ['.g:Tex_package_detected.'] in first run', 'pack') + + " Now for each package find out if this is a custom package and if so, + " scan that as well. We will use the ':find' command in vim to let vim + " search through the file paths for us. + " + " NOTE: This while loop will also take into account packages included + " within packages to any level of recursion as long as + " g:Tex_package_detected is always padded with new package names + " from the end. + " + " First set the &path setting to the user's TEXINPUTS setting. + let _path = &path + let _suffixesadd = &suffixesadd + + let &path = '.,'.g:Tex_TEXINPUTS + let &suffixesadd = '.sty,.tex' + + let scannedPackages = '' + + let i = 1 + let packname = Tex_Strntok(g:Tex_package_detected, ',', i) + while packname != '' + + call Tex_Debug(':Tex_pack_updateall: scanning package '.packname, 'pack') + + " Scan this package only if we have not scanned it before in this + " run. + if scannedPackages =~ '\<'.packname.'\>' + let i = i + 1 + + call Tex_Debug(':Tex_pack_updateall: '.packname.' already scanned', 'pack') + let packname = Tex_Strntok(g:Tex_package_detected, ',', i) + continue + endif + + " Split this window in two. The packages/files being found will open + " in this new window and we also need not bother with files being + " modified etc. + split + + call Tex_Debug(':Tex_pack_updateall: silent! find '.Tex_EscapeSpaces(packname).'.sty', 'pack') + let thisbufnum = bufnr('%') + exec 'silent! find '.Tex_EscapeSpaces(packname).'.sty' + call Tex_Debug(':Tex_pack_updateall: present file = '.bufname('%'), 'pack') + + " If this file was not found, assume that it means its not a + " custom package and mark it "scanned". + " A package is not found if we stay in the same buffer as before and + " its not the one where we want to go. + if bufnr('%') == thisbufnum && bufnr('%') != bufnr(packname.'.sty') + let scannedPackages = scannedPackages.','.packname + q + + call Tex_Debug(':Tex_pack_updateall: '.packname.' not found anywhere', 'pack') + let i = i + 1 + let packname = Tex_Strntok(g:Tex_package_detected, ',', i) + continue + endif + + " otherwise we are presently editing a custom package, scan it for + " more \usepackage lines from the first line to the last. + let packpath = expand('%:p') + let &complete = &complete.'s'.packpath + + call Tex_Debug(':Tex_pack_updateall: found custom package '.packpath, 'pack') + call Tex_ScanForPackages(line('$'), line('$')) + call Tex_Debug(':Tex_pack_updateall: After scanning, g:Tex_package_detected = '.g:Tex_package_detected, 'pack') + + let scannedPackages = scannedPackages.','.packname + " Do not use bwipe, but that leads to excessive buffer number + " consumption. Besides, its intuitive for a custom package to remain + " on the buffer list. + q + + let i = i + 1 + let packname = Tex_Strntok(g:Tex_package_detected, ',', i) + endwhile + + let &path = _path + let &suffixesadd = _suffixesadd + + " Now only support packages we didn't last time. + " First remove packages which were used last time but are no longer used. + let i = 1 + let oldPackName = Tex_Strntok(oldpackages, ',', i) + while oldPackName != '' + if g:Tex_package_detected !~ oldPackName + call Tex_pack_uncheck(oldPackName) + endif + let i = i + 1 + let oldPackName = Tex_Strntok(oldpackages, ',', i) + endwhile + + " Then support packages which are used this time but weren't used last + " time. + let i = 1 + let newPackName = Tex_Strntok(g:Tex_package_detected, ',', i) + while newPackName != '' + if oldpackages !~ newPackName + call Tex_pack_one(newPackName) + endif + let i = i + 1 + let newPackName = Tex_Strntok(g:Tex_package_detected, ',', i) + endwhile + + " Throw an event that we are done scanning packages. Some packages might + " use this to change behavior based on which options have been used etc. + call Tex_Debug(":Tex_pack_updateall: throwing LatexSuiteScannedPackages event", "pack") + silent! do LatexSuite User LatexSuiteScannedPackages + + call Tex_Debug("-Tex_pack_updateall", "pack") +endfunction + +" }}} +" Tex_pack_one: supports each package in the argument list.{{{ +" Description: +" If no arguments are supplied, then the user is asked to choose from the +" packages found in the packages/ directory +function! Tex_pack_one(...) + if a:0 == 0 || (a:0 > 0 && a:1 == '') + let packlist = Tex_FindInRtp('', 'packages') + let packname = Tex_ChooseFromPrompt( + \ "Choose a package: \n" . + \ Tex_CreatePrompt(packlist, '3', ',') . + \ "\nEnter number or filename :", + \ packlist, ',') + if packname != '' + return Tex_pack_one(packname) + else + return '' + endif + else + " Support the packages supplied. This function can be called with + " multiple arguments in which case, support each of them in turn. + let retVal = '' + let omega = 1 + while omega <= a:0 + let packname = a:{omega} + if Tex_FindInRtp(packname, 'packages') != '' + call Tex_pack_check(packname) + if exists('g:TeX_package_option_'.packname) + \ && g:TeX_package_option_{packname} != '' + let retVal = retVal.'\usepackage[<++>]{'.packname.'}<++>' + else + let retVal = retVal.'\usepackage{'.packname.'}'."\<CR>" + endif + else + let retVal = retVal.'\usepackage{'.packname.'}'."\<CR>" + endif + let omega = omega + 1 + endwhile + return IMAP_PutTextWithMovement(substitute(retVal, "\<CR>$", '', ''), '<+', '+>') + endif +endfunction +" }}} +" Tex_ScanForPackages: scans the current file for \usepackage{} lines {{{ +" and if supported, loads the options and commands found in the +" corresponding package file. Also scans for \newenvironment and +" \newcommand lines and adds names to g:Tex_Prompted variables, they can be +" easy available through <F5> and <F7> shortcuts +function! Tex_ScanForPackages(...) + call Tex_Debug("+Tex_ScanForPackages", "pack") + + let pos = Tex_GetPos() + + " For package files without \begin and \end{document}, we might be told to + " search from beginning to end. + if a:0 < 2 + 0 + let beginline = search('\\begin{document}', 'W') + let endline = search('\\end{document}', 'W') + 0 + else + let beginline = a:1 + let endline = a:2 + endif + + call Tex_Debug(":Tex_ScanForPackages: Begining scans in [".bufname('%')."], beginline = ".beginline, "pack") + + + " Scan the file. First open up all the folds, because the command + " /somepattern + " issued in a closed fold _always_ goes to the first match. + let erm = v:errmsg + silent! normal! ggVGzO + let v:errmsg = erm + + call Tex_Debug(":Tex_ScanForPackages: beginning scan for \\usepackage lines", "pack") + " The wrap trick enables us to match \usepackage on the first line as + " well. + let wrap = 'w' + while search('^\s*\\usepackage\_.\{-}{\_.\+}', wrap) + let wrap = 'W' + + if line('.') > beginline + break + endif + + let saveUnnamed = @" + let saveA = @a + + " If there are options, then find those. + if getline('.') =~ '\\usepackage\[.\{-}\]' + let options = matchstr(getline('.'), '\\usepackage\[\zs.\{-}\ze\]') + elseif getline('.') =~ '\\usepackage\[' + " Entering here means that the user has split the \usepackage + " across newlines. Therefore, use yank. + exec "normal! /{\<CR>\"ayi}" + let options = @a + else + let options = '' + endif + + " The following statement puts the stuff between the { }'s of a + " \usepackage{stuff,foo} into @a. Do not use matchstr() and the like + " because we can have things split across lines and such. + exec "normal! /{\<CR>\"ay/}\<CR>" + + " now remove all whitespace from @a. We need to remove \n and \r + " because we can encounter stuff like + " \usepackage{pack1, + " newpackonanotherline} + let @a = substitute(@a, "[ \t\n\r]", '', 'g') + + " Now we have something like pack1,pack2,pack3 with possibly commas + " and stuff before the first package and after the last package name. + " Remove those. + let @a = substitute(@a, '\(^\W*\|\W*$\)', '', 'g') + + " This gets us a string like 'pack1,pack2,pack3' + " TODO: This will contain duplicates if the user has duplicates. + " Should we bother taking care of this? + let g:Tex_package_detected = g:Tex_package_detected.','.@a + + " For each package found, form a global variable of the form + " g:Tex_{packagename}_options + " which contains a list of the options. + let j = 1 + while Tex_Strntok(@a, ',', j) != '' + let g:Tex_{Tex_Strntok(@a, ',', j)}_options = options + let j = j + 1 + endwhile + + " Finally convert @a into something like '"pack1","pack2"' + let @a = substitute(@a, '^\|$', '"', 'g') + let @a = substitute(@a, ',', '","', 'g') + + call Tex_Debug(":Tex_ScanForPackages: found package(s) [".@a."] on line ".line('.'), "pack") + + " restore @a + let @a = saveA + let @" = saveUnnamed + endwhile + call Tex_Debug(":Tex_ScanForPackages: End scan \\usepackage, detected packages = ".g:Tex_package_detected, "pack") + + " TODO: This needs to be changed. In the future, we might have + " functionality to remember the fold-state before opening up all the folds + " and then re-creating them. Use mkview.vim. + let erm = v:errmsg + silent! normal! ggVGzC + let v:errmsg = erm + + " Because creating list of detected packages gives string + " ',pack1,pack2,pack3' remove leading , + let g:Tex_package_detected = substitute(g:Tex_package_detected, '^,', '', '') + + call Tex_Debug(":Tex_ScanForPackages: Beginning scan for \\newcommand's", "pack") + " Scans whole file (up to \end{document}) for \newcommand and adds this + " commands to g:Tex_PromptedCommands variable, it is easily available + " through <F7> + 0 + while search('^\s*\\newcommand\*\?{.\{-}}', 'W') + + if line('.') > endline + break + endif + + let newcommand = matchstr(getline('.'), '\\newcommand\*\?{\\\zs.\{-}\ze}') + let g:Tex_PromptedCommands = g:Tex_PromptedCommands . ',' . newcommand + + endwhile + + " Scans whole file (up to \end{document}) for \newenvironment and adds this + " environments to g:Tex_PromptedEnvironments variable, it is easily available + " through <F5> + 0 + call Tex_Debug(":Tex_ScanForPackages: Beginning scan for \\newenvironment's", 'pack') + + while search('^\s*\\newenvironment\*\?{.\{-}}', 'W') + call Tex_Debug('found newenvironment on '.line('.'), 'pack') + + if line('.') > endline + break + endif + + let newenvironment = matchstr(getline('.'), '\\newenvironment\*\?{\zs.\{-}\ze}') + let g:Tex_PromptedEnvironments = g:Tex_PromptedEnvironments . ',' . newenvironment + + endwhile + + call Tex_SetPos(pos) + " first make a random search so that we push at least one item onto the + " search history. Since vim puts only one item in the history per function + " call, this way we make sure that one and only item is put into the + " search history. + normal! /^<CR> + " now delete it... + call histdel('/', -1) + + call Tex_Debug("-Tex_ScanForPackages", "pack") +endfunction + +" }}} +" Tex_pack_supp_menu: sets up a menu for package files {{{ +" found in the packages directory groups the packages thus found into groups +" of 20... +function! Tex_pack_supp_menu() + let suplist = Tex_FindInRtp('', 'packages') + + call Tex_MakeSubmenu(suplist, g:Tex_PackagesMenuLocation.'Supported.', + \ '<plug><C-r>=Tex_pack_one("', '")<CR>') +endfunction + +" }}} +" Tex_pack: loads the options (and commands) for the given package {{{ +function! Tex_pack(pack) + if exists('g:TeX_package_'.a:pack) + + let optionList = g:TeX_package_option_{a:pack}.',' + let commandList = g:TeX_package_{a:pack}.',' + + " Don't create separator if in package file are only Vim commands. + " Rare but possible. + if !(commandList == ',' && optionList == ',') + exec 'amenu '.g:Tex_PackagesMenuLocation.'-sep'.a:pack.'- <Nop>' + endif + + if optionList != '' + + let mainMenuName = g:Tex_PackagesMenuLocation.a:pack.'\ Options.' + call s:GroupPackageMenuItems(optionList, mainMenuName, + \ '<plug><C-r>=IMAP_PutTextWithMovement("', ',")<CR>') + + endif + + if commandList != '' + + let mainMenuName = g:Tex_PackagesMenuLocation.a:pack.'\ Commands.' + call s:GroupPackageMenuItems(commandList, mainMenuName, + \ '<plug><C-r>=Tex_ProcessPackageCommand("', '")<CR>', + \ '<SID>FilterPackageMenuLHS') + endif + endif +endfunction + +" }}} + +" ============================================================================== +" Menu Functions +" Creating menu items for the all the package files found in the packages/ +" directory as well as creating menus for each supported package found in the +" preamble. +" ============================================================================== +" Tex_MakeSubmenu: makes a submenu given a list of items {{{ +" Description: +" This function takes a comma seperated list of menu items and creates a +" 'grouped' menu. i.e, it groups the items into s:menu_div items each and +" puts them in submenus of the given mainMenu. +" Each menu item is linked to the HandlerFunc. +" If an additional argument is supplied, then it is used to filter each of +" the menu items to generate better names for the menu display. +" +function! Tex_MakeSubmenu(menuList, mainMenuName, + \ handlerFuncLHS, handlerFuncRHS, ...) + + let extractFunction = (a:0 > 0 ? a:1 : '' ) + let menuList = substitute(a:menuList, '[^,]$', ',', '') + + let doneMenuSubmenu = 0 + + while menuList != '' + + " Extract upto s:menu_div menus at once. + let menuBunch = matchstr(menuList, '\v(.{-},){,'.s:menu_div.'}') + + " The remaining menus go into the list. + let menuList = strpart(menuList, strlen(menuBunch)) + + let submenu = '' + " If there is something remaining, then we got s:menu_div items. + " therefore put these menu items into a submenu. + if strlen(menuList) || doneMenuSubmenu + exec 'let firstMenu = '.extractFunction."(matchstr(menuBunch, '\\v^.{-}\\ze,'))" + exec 'let lastMenu = '.extractFunction."(matchstr(menuBunch, '\\v[^,]{-}\\ze,$'))" + + let submenu = firstMenu.'\ \-\ '.lastMenu.'.' + + let doneMenuSubmenu = 1 + endif + + " Now for each menu create a menu under the submenu + let i = 1 + let menuName = Tex_Strntok(menuBunch, ',', i) + while menuName != '' + exec 'let menuItem = '.extractFunction.'(menuName)' + execute 'amenu '.a:mainMenuName.submenu.menuItem + \ ' '.a:handlerFuncLHS.menuName.a:handlerFuncRHS + + let i = i + 1 + let menuName = Tex_Strntok(menuBunch, ',', i) + endwhile + endwhile +endfunction + +" }}} +" GroupPackageMenuItems: uses the sbr: to split menus into groups {{{ +" Description: +" This function first splits up the menuList into groups based on the +" special sbr: tag and then calls Tex_MakeSubmenu +" +function! <SID>GroupPackageMenuItems(menuList, menuName, + \ handlerFuncLHS, handlerFuncRHS,...) + + if a:0 > 0 + let extractFunction = a:1 + else + let extractFunction = '' + endif + let menuList = a:menuList + + while matchstr(menuList, 'sbr:') != '' + let groupName = matchstr(menuList, '\v^sbr:\zs.{-}\ze,') + let menuList = strpart(menuList, strlen('sbr:'.groupName.',')) + if matchstr(menuList, 'sbr:') != '' + let menuGroup = matchstr(menuList, '\v^.{-},\zesbr:') + else + let menuGroup = menuList + endif + + call Tex_MakeSubmenu(menuGroup, a:menuName.groupName.'.', + \ a:handlerFuncLHS, a:handlerFuncRHS, extractFunction) + + let menuList = strpart(menuList, strlen(menuGroup)) + endwhile + + call Tex_MakeSubmenu(menuList, a:menuName, + \ a:handlerFuncLHS, a:handlerFuncRHS, extractFunction) + +endfunction " }}} +" Definition of what to do for various package commands {{{ +let s:CommandSpec_brs = '\<+replace+><++>' +let s:CommandSpec_bra = '\<+replace+>{<++>}<++>' +let s:CommandSpec_brd = '\<+replace+>{<++>}{<++>}<++>' + +let s:CommandSpec_nor = '\<+replace+>' +let s:CommandSpec_noo = '\<+replace+>[<++>]' +let s:CommandSpec_nob = '\<+replace+>[<++>]{<++>}{<++>}<++>' + +let s:CommandSpec_env = '\begin{<+replace+>}'."\<CR><++>\<CR>".'\end{<+replace+>}<++>' +let s:CommandSpec_ens = '\begin{<+replace+>}<+extra+>'."\<CR><++>\<CR>".'\end{<+replace+>}<++>' +let s:CommandSpec_eno = '\begin[<++>]{<+replace+>}'."\<CR><++>\<CR>".'\end{<+replace+>}' + +let s:CommandSpec_spe = '<+replace+>' +let s:CommandSpec_ = '\<+replace+>' + +let s:MenuLHS_bra = '\\&<+replace+>{}' +let s:MenuLHS_brs = '\\&<+replace+>{}' +let s:MenuLHS_brd = '\\&<+replace+>{}{}' +let s:MenuLHS_env = '&<+replace+>\ (E)' +let s:MenuLHS_ens = '&<+replace+>\ (E)' +let s:MenuLHS_eno = '&<+replace+>\ (E)' +let s:MenuLHS_nor = '\\&<+replace+>' +let s:MenuLHS_noo = '\\&<+replace+>[]' +let s:MenuLHS_nob = '\\&<+replace+>[]{}{}' +let s:MenuLHS_spe = '&<+replace+>' +let s:MenuLHS_sep = '-sep<+replace+>-' +let s:MenuLHS_ = '\\&<+replace+>' +" }}} +" Tex_ProcessPackageCommand: processes a command from the package menu {{{ +" Description: +function! Tex_ProcessPackageCommand(command) + if a:command =~ ':' + let commandType = matchstr(a:command, '^\w\+\ze:') + let commandName = matchstr(a:command, '^\w\+:\zs[^:]\+\ze:\?') + let extrapart = strpart(a:command, strlen(commandType.':'.commandName.':')) + else + let commandType = '' + let commandName = a:command + let extrapart = '' + endif + + let command = s:CommandSpec_{commandType} + let command = substitute(command, '<+replace+>', commandName, 'g') + let command = substitute(command, '<+extra+>', extrapart, 'g') + return IMAP_PutTextWithMovement(command) +endfunction +" }}} +" FilterPackageMenuLHS: filters the command description to provide a better menu item {{{ +" Description: +function! <SID>FilterPackageMenuLHS(command) + let commandType = matchstr(a:command, '^\w\+\ze:') + if commandType != '' + let commandName = strpart(a:command, strlen(commandType.':')) + else + let commandName = a:command + endif + + return substitute(s:MenuLHS_{commandType}, '<+replace+>', commandName, 'g') +endfunction " }}} + +if g:Tex_Menus + exe 'amenu '.g:Tex_PackagesMenuLocation.'&UpdatePackage :call Tex_pack(expand("<cword>"))<cr>' + exe 'amenu '.g:Tex_PackagesMenuLocation.'&UpdateAll :call Tex_pack_updateall(1)<cr>' + + call Tex_pack_supp_menu() +endif + +augroup LatexSuite + au LatexSuite User LatexSuiteFileType + \ call Tex_Debug('packages.vim: Catching LatexSuiteFileType event', 'pack') | + \ let s:save_clipboard = &clipboard | + \ set clipboard= | + \ call Tex_pack_updateall(0) | + \ let &clipboard=s:save_clipboard +augroup END + +" vim:fdm=marker:ts=4:sw=4:noet:ff=unix diff --git a/.vim/ftplugin/latex-suite/packages/SIunits b/.vim/ftplugin/latex-suite/packages/SIunits @@ -0,0 +1,315 @@ +if exists("SIunits_package_file") + finish +endif +let SIunits_package_file = 1 + +let g:TeX_package_SIunits = +\'nor:addprefix,'. +\'nor:addunit,'. +\'nor:ampere,'. +\'nor:amperemetresecond,'. +\'nor:amperepermetre,'. +\'nor:amperepermetrenp,'. +\'nor:amperepersquaremetre,'. +\'nor:amperepersquaremetrenp,'. +\'nor:angstrom,'. +\'nor:arad,'. +\'nor:arcminute,'. +\'nor:arcsecond,'. +\'nor:are,'. +\'nor:atomicmass,'. +\'nor:atto,'. +\'nor:attod,'. +\'nor:barn,'. +\'nor:bbar,'. +\'nor:becquerel,'. +\'nor:becquerelbase,'. +\'nor:bel,'. +\'nor:candela,'. +\'nor:candelapersquaremetre,'. +\'nor:candelapersquaremetrenp,'. +\'nor:celsius,'. +\'nor:Celsius,'. +\'nor:celsiusbase,'. +\'nor:centi,'. +\'nor:centid,'. +\'nor:coulomb,'. +\'nor:coulombbase,'. +\'nor:coulombpercubicmetre,'. +\'nor:coulombpercubicmetrenp,'. +\'nor:coulombperkilogram,'. +\'nor:coulombperkilogramnp,'. +\'nor:coulombpermol,'. +\'nor:coulombpermolnp,'. +\'nor:coulombpersquaremetre,'. +\'nor:coulombpersquaremetrenp,'. +\'nor:cubed,'. +\'nor:cubic,'. +\'nor:cubicmetre,'. +\'nor:cubicmetreperkilogram,'. +\'nor:cubicmetrepersecond,'. +\'nor:curie,'. +\'nor:dday,'. +\'nor:deca,'. +\'nor:decad,'. +\'nor:deci,'. +\'nor:decid,'. +\'nor:degree,'. +\'nor:degreecelsius,'. +\'nor:deka,'. +\'nor:dekad,'. +\'nor:derbecquerel,'. +\'nor:dercelsius,'. +\'nor:dercoulomb,'. +\'nor:derfarad,'. +\'nor:dergray,'. +\'nor:derhenry,'. +\'nor:derhertz,'. +\'nor:derjoule,'. +\'nor:derkatal,'. +\'nor:derlumen,'. +\'nor:derlux,'. +\'nor:dernewton,'. +\'nor:derohm,'. +\'nor:derpascal,'. +\'nor:derradian,'. +\'nor:dersiemens,'. +\'nor:dersievert,'. +\'nor:dersteradian,'. +\'nor:dertesla,'. +\'nor:dervolt,'. +\'nor:derwatt,'. +\'nor:derweber,'. +\'nor:electronvolt,'. +\'nor:exa,'. +\'nor:exad,'. +\'nor:farad,'. +\'nor:faradbase,'. +\'nor:faradpermetre,'. +\'nor:faradpermetrenp,'. +\'nor:femto,'. +\'nor:femtod,'. +\'nor:fourth,'. +\'nor:gal,'. +\'nor:giga,'. +\'nor:gigad,'. +\'nor:gram,'. +\'nor:graybase,'. +\'nor:graypersecond,'. +\'nor:graypersecondnp,'. +\'nor:hectare,'. +\'nor:hecto,'. +\'nor:hectod,'. +\'nor:henry,'. +\'nor:henrybase,'. +\'nor:henrypermetre,'. +\'nor:henrypermetrenp,'. +\'nor:hertz,'. +\'nor:hertzbase,'. +\'nor:hour,'. +\'nor:joule,'. +\'nor:joulebase,'. +\'nor:joulepercubicmetre,'. +\'nor:joulepercubicmetrenp,'. +\'nor:jouleperkelvin,'. +\'nor:jouleperkelvinnp,'. +\'nor:jouleperkilogram,'. +\'nor:jouleperkilogramkelvin,'. +\'nor:jouleperkilogramkelvinnp,'. +\'nor:jouleperkilogramnp,'. +\'nor:joulepermole,'. +\'nor:joulepermolekelvin,'. +\'nor:joulepermolekelvinnp,'. +\'nor:joulepermolenp,'. +\'nor:joulepersquaremetre,'. +\'nor:joulepersquaremetrenp,'. +\'nor:joulepertesla,'. +\'nor:jouleperteslanp,'. +\'nor:katal,'. +\'nor:katalbase,'. +\'nor:katalpercubicmetre,'. +\'nor:katalpercubicmetrenp,'. +\'nor:kelvin,'. +\'nor:kilo,'. +\'nor:kilod,'. +\'nor:kilogram,'. +\'nor:kilogrammetrepersecond,'. +\'nor:kilogrammetrepersecondnp,'. +\'nor:kilogrammetrepersquaresecond,'. +\'nor:kilogrammetrepersquaresecondnp,'. +\'nor:kilogrampercubicmetre,'. +\'nor:kilogrampercubicmetrecoulomb,'. +\'nor:kilogrampercubicmetrecoulombnp,'. +\'nor:kilogrampercubicmetrenp,'. +\'nor:kilogramperkilomole,'. +\'nor:kilogramperkilomolenp,'. +\'nor:kilogrampermetre,'. +\'nor:kilogrampermetrenp,'. +\'nor:kilogrampersecond,'. +\'nor:kilogrampersecondcubicmetre,'. +\'nor:kilogrampersecondcubicmetrenp,'. +\'nor:kilogrampersecondnp,'. +\'nor:kilogrampersquaremetre,'. +\'nor:kilogrampersquaremetrenp,'. +\'nor:kilogrampersquaremetresecond,'. +\'nor:kilogrampersquaremetresecondnp,'. +\'nor:kilogramsquaremetre,'. +\'nor:kilogramsquaremetrenp,'. +\'nor:kilogramsquaremetrepersecond,'. +\'nor:kilogramsquaremetrepersecondnp,'. +\'nor:kilowatthour,'. +\'nor:liter,'. +\'nor:litre,'. +\'nor:lumen,'. +\'nor:lumenbase,'. +\'nor:lux,'. +\'nor:luxbase,'. +\'nor:mega,'. +\'nor:megad,'. +\'nor:meter,'. +\'nor:metre,'. +\'nor:metrepersecond,'. +\'nor:metrepersecondnp,'. +\'nor:metrepersquaresecond,'. +\'nor:metrepersquaresecondnp,'. +\'nor:micro,'. +\'nor:microd,'. +\'nor:milli,'. +\'nor:millid,'. +\'nor:minute,'. +\'nor:mole,'. +\'nor:molepercubicmetre,'. +\'nor:molepercubicmetrenp,'. +\'nor:nano,'. +\'nor:nanod,'. +\'nor:neper,'. +\'nor:newton,'. +\'nor:newtonbase,'. +\'nor:newtonmetre,'. +\'nor:newtonpercubicmetre,'. +\'nor:newtonpercubicmetrenp,'. +\'nor:newtonperkilogram,'. +\'nor:newtonperkilogramnp,'. +\'nor:newtonpermetre,'. +\'nor:newtonpermetrenp,'. +\'nor:newtonpersquaremetre,'. +\'nor:newtonpersquaremetrenp,'. +\'nor:NoAMS,'. +\'nor:no@qsk,'. +\'nor:ohm,'. +\'nor:ohmbase,'. +\'nor:ohmmetre,'. +\'nor:one,'. +\'nor:paminute,'. +\'nor:pascal,'. +\'nor:pascalbase,'. +\'nor:pascalsecond,'. +\'nor:pasecond,'. +\'nor:per,'. +\'nor:period@active,'. +\'nor:persquaremetresecond,'. +\'nor:persquaremetresecondnp,'. +\'nor:peta,'. +\'nor:petad,'. +\'nor:pico,'. +\'nor:picod,'. +\'nor:power,'. +\'nor:@qsk,'. +\'nor:quantityskip,'. +\'nor:rad,'. +\'nor:radian,'. +\'nor:radianbase,'. +\'nor:radianpersecond,'. +\'nor:radianpersecondnp,'. +\'nor:radianpersquaresecond,'. +\'nor:radianpersquaresecondnp,'. +\'nor:reciprocal,'. +\'nor:rem,'. +\'nor:roentgen,'. +\'nor:rp,'. +\'nor:rpcubed,'. +\'nor:rpcubic,'. +\'nor:rpcubicmetreperkilogram,'. +\'nor:rpcubicmetrepersecond,'. +\'nor:rperminute,'. +\'nor:rpersecond,'. +\'nor:rpfourth,'. +\'nor:rpsquare,'. +\'nor:rpsquared,'. +\'nor:rpsquaremetreperkilogram,'. +\'nor:second,'. +\'nor:siemens,'. +\'nor:siemensbase,'. +\'nor:sievert,'. +\'nor:sievertbase,'. +\'nor:square,'. +\'nor:squared,'. +\'nor:squaremetre,'. +\'nor:squaremetrepercubicmetre,'. +\'nor:squaremetrepercubicmetrenp,'. +\'nor:squaremetrepercubicsecond,'. +\'nor:squaremetrepercubicsecondnp,'. +\'nor:squaremetreperkilogram,'. +\'nor:squaremetrepernewtonsecond,'. +\'nor:squaremetrepernewtonsecondnp,'. +\'nor:squaremetrepersecond,'. +\'nor:squaremetrepersecondnp,'. +\'nor:squaremetrepersquaresecond,'. +\'nor:squaremetrepersquaresecondnp,'. +\'nor:steradian,'. +\'nor:steradianbase,'. +\'nor:tera,'. +\'nor:terad,'. +\'nor:tesla,'. +\'nor:teslabase,'. +\'nor:ton,'. +\'nor:tonne,'. +\'nor:unit,'. +\'nor:unitskip,'. +\'nor:usk,'. +\'nor:volt,'. +\'nor:voltbase,'. +\'nor:voltpermetre,'. +\'nor:voltpermetrenp,'. +\'nor:watt,'. +\'nor:wattbase,'. +\'nor:wattpercubicmetre,'. +\'nor:wattpercubicmetrenp,'. +\'nor:wattperkilogram,'. +\'nor:wattperkilogramnp,'. +\'nor:wattpermetrekelvin,'. +\'nor:wattpermetrekelvinnp,'. +\'nor:wattpersquaremetre,'. +\'nor:wattpersquaremetrenp,'. +\'nor:wattpersquaremetresteradian,'. +\'nor:wattpersquaremetresteradiannp,'. +\'nor:weber,'. +\'nor:weberbase,'. +\'nor:yocto,'. +\'nor:yoctod,'. +\'nor:yotta,'. +\'nor:yottad,'. +\'nor:zepto,'. +\'nor:zeptod,'. +\'nor:zetta,'. +\'nor:zettad' + +let g:TeX_package_option_SIunits = +\'amssymb,'. +\'binary,'. +\'cdot,'. +\'derived,'. +\'derivedinbase,'. +\'Gray,'. +\'mediumqspace,'. +\'mediumspace,'. +\'noams,'. +\'pstricks,'. +\'squaren,'. +\'textstyle,'. +\'thickqspace,'. +\'thickspace,'. +\'thinqspace,'. +\'thinspace' + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/accents b/.vim/ftplugin/latex-suite/packages/accents @@ -0,0 +1,28 @@ +if exists("accents_package_file") + finish +endif +let accents_package_file = 1 + +let g:TeX_package_option_accents = +\ 'nonscript,' +\.'single' + +let g:TeX_package_accents = +\ 'bra:grave,' +\.'bra:acute,' +\.'bra:check,' +\.'bra:breve,' +\.'bra:bar,' +\.'bra:ring,' +\.'bra:hat,' +\.'bra:dot,' +\.'bra:tilde,' +\.'bra:undertilde,' +\.'bra:ddot,' +\.'bra:dddot,' +\.'bra:ddddot,' +\.'bra:vec,' +\.'brd:accentset,' +\.'brd:underaccent' + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/acromake b/.vim/ftplugin/latex-suite/packages/acromake @@ -0,0 +1,10 @@ +if exists("acromake_package_file") + finish +endif +let acromake_package_file = 1 + +let g:TeX_package_option_acromake = '' + +let g:TeX_package_acromake = 'brs:acromake{<++>}{<++>}{<++>}' + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/afterpage b/.vim/ftplugin/latex-suite/packages/afterpage @@ -0,0 +1,10 @@ +if exists("afterpage_package_file") + finish +endif +let afterpage_package_file = 1 + +let g:TeX_package_option_afterpage = '' + +let g:TeX_package_afterpage = 'bra:afterpage' + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/alltt b/.vim/ftplugin/latex-suite/packages/alltt @@ -0,0 +1,12 @@ +if exists("alltt_package_file") + finish +endif +let alltt_package_file = 1 + +let g:TeX_package_option_alltt = '' + +let g:TeX_package_alltt = 'env:alltt' + +syn region texZone start="\\begin{alltt}" end="\\end{alltt}\|%stopzone\>" fold + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/amsmath b/.vim/ftplugin/latex-suite/packages/amsmath @@ -0,0 +1,106 @@ +if exists("amsmath_package_file") + finish +endif +let amsmath_package_file = 1 + +let g:TeX_package_option_amsmath = +\ 'centertags,' +\.'tbtags,' +\.'sumlimits,' +\.'nosumlimits,' +\.'intlimits,' +\.'nointlimits,' +\.'namelimits,' +\.'nonamelimits,' +\.'leqno,' +\.'reqno,' +\.'fleqno' + +let g:TeX_package_amsmath = +\ 'sbr:Environments,' +\.'env:equation,' +\.'env:equation*,' +\.'env:align,' +\.'env:align*,' +\.'env:gather,' +\.'env:gather*,' +\.'env:flalign,' +\.'env:flalign*,' +\.'env:multline,' +\.'env:multline*,' +\.'ens:alignat:{<+arg1+>}{<+arg2+>},' +\.'env:alignat,' +\.'ens:alignat*:{<+arg1+>}{<+arg2+>},,' +\.'env:alignat*,' +\.'env:subequations,' +\.'env:subarray,' +\.'env:split,' +\.'env:cases,' +\.'sbr:Matrices,' +\.'env:matrix,' +\.'env:pmatrix,' +\.'env:bmatrix,' +\.'env:Bmatrix,' +\.'env:vmatrix,' +\.'env:Vmatrix,' +\.'env:smallmatrix,' +\.'bra:hdotsfor,' +\.'sbr:Dots,' +\.'dotsc,' +\.'dotsb,' +\.'dotsm,' +\.'dotsi,' +\.'dotso,' +\.'sbr:ItalicGreek,' +\.'nor:varGamma,' +\.'nor:varDelta,' +\.'nor:varTheta,' +\.'nor:varLambda,' +\.'nor:varXi,' +\.'nor:varPi,' +\.'nor:varSigma,' +\.'nor:varUpsilon,' +\.'nor:varPhi,' +\.'nor:varPsi,' +\.'nor:varOmega,' +\.'sbr:Mod,' +\.'nor:mod,' +\.'nor:bmod,' +\.'nor:pmod,' +\.'nor:pod,' +\.'sbr:CreatingSymbols,' +\.'brd:overset,' +\.'brd:underset,' +\.'brd:sideset,' +\.'sbr:Fractions,' +\.'brd:frac,' +\.'brd:dfrac,' +\.'brd:tfrac,' +\.'brd:cfrac,' +\.'brd:binom,' +\.'brd:dbinom,' +\.'brd:tbinom,' +\.'brs:genfrac{<+ldelim+>}{<+rdelim+>}{<+thick+>}{<+style+>}{<+numer+>}{<+denom+>},' +\.'sbr:Commands,' +\.'nob:smash,' +\.'bra:substack,' +\.'bra:tag,' +\.'bra:tag*,' +\.'nor:notag,' +\.'bra:raisetag,' +\.'bra:shoveleft,' +\.'bra:shoveright,' +\.'bra:intertext,' +\.'bra:text,' +\.'nor:displaybreak,' +\.'noo:displaybreak,' +\.'noo:allowdisplaybreaks,' +\.'nor:nobreakdash,' +\.'brs:numberwithin{<+env+>}{<+parent+>},' +\.'bra:leftroot,' +\.'bra:uproot,' +\.'bra:boxed,' +\.'brs:DeclareMathSymbol{<++>}{<++>}{<++>}{<++>},' +\.'bra:eqref' + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/amsthm b/.vim/ftplugin/latex-suite/packages/amsthm @@ -0,0 +1,21 @@ +if exists("amsthm_package_file") + finish +endif +let amsthm_package_file = 1 + +let TeX_package_option_amsthm = '' + +let TeX_package_amsthm = +\ 'env:proof,' +\.'nor:swapnumbers,' +\.'brd:newtheorem,' +\.'brd:newtheorem*,' +\.'nor:theoremstyle{plain},' +\.'nor:theoremstyle{definition},' +\.'nor:theoremstyle{remark},' +\.'nor:newtheoremstyle,' +\.'nor:qedsymbol,' +\.'nor:qed,' +\.'nor:qedhere' + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/amsxtra b/.vim/ftplugin/latex-suite/packages/amsxtra @@ -0,0 +1,12 @@ +if exists("amsxtra_package_file") + finish +endif +let amsxtra_package_file = 1 + +let g:TeX_package_option_amsxtra = '' + +let g:TeX_package_amsxtra = +\ 'nor:sphat,' +\.'nor:sptilde' + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/arabic b/.vim/ftplugin/latex-suite/packages/arabic @@ -0,0 +1,10 @@ +if exists("arabic_package_file") + finish +endif +let arabic_package_file = 1 + +let g:TeX_package_option_arabic = '' + +let g:TeX_package_arabic = 'bra:arabicnumeral' + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/array b/.vim/ftplugin/latex-suite/packages/array @@ -0,0 +1,17 @@ +if exists("array_package_file") + finish +endif +let array_package_file = 1 + +let g:TeX_package_option_array = '' + +let g:TeX_package_array = +\ 'brs:newcolumntype{<+type+>}[<+no+>]{<+preamble+>},' +\.'arraycolsep,' +\.'tabcolsep,' +\.'arrayrulewidth,' +\.'doublerulesep,' +\.'arraystretch,' +\.'extrarowheight' + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/babel b/.vim/ftplugin/latex-suite/packages/babel @@ -0,0 +1,98 @@ +if exists("babel_package_file") + finish +endif +let babel_package_file = 1 + +" This package sets some language specific options. +" Since it needs to find out which options the user used with the babel +" package, it needs to wait till latex-suite is done scanning packages. It +" then catches the LatexSuiteScannedPackages event which +" Tex_pack_updateall() throws at which time g:Tex_pack_detected and +" g:Tex_babel_options contain the necessary information. + +let g:TeX_package_option_babel = +\ 'afrikaans,' +\.'bahasa,' +\.'basque,' +\.'breton,' +\.'bulgarian,' +\.'catalan,' +\.'croatian,' +\.'chech,' +\.'danish,' +\.'dutch,' +\.'english,USenglish,american,UKenglish,british,canadian,' +\.'esperanto,' +\.'estonian,' +\.'finnish,' +\.'french,francais,canadien,acadian,' +\.'galician,' +\.'austrian,german,germanb,ngerman,naustrian,' +\.'greek,polutonikogreek,' +\.'hebrew,' +\.'magyar,hungarian,' +\.'icelandic,' +\.'irish,' +\.'italian,' +\.'latin,' +\.'lowersorbian,' +\.'samin,' +\.'norsk,nynorsk,' +\.'polish,' +\.'portuges,portuguese,brazilian,brazil,' +\.'romanian,' +\.'russian,' +\.'scottish,' +\.'spanish,' +\.'slovak,' +\.'slovene,' +\.'swedish,' +\.'serbian,' +\.'turkish,' +\.'ukrainian,' +\.'uppersorbian,' +\.'welsh' + +let g:TeX_package_babel = +\ 'bra:selectlanguage,' +\.'env:otherlanguage,' +\.'env:otherlanguage*,' +\.'env:hyphenrules,' +\.'brd:foreignlanguage,' +\.'spe:iflanguage{<+name+>}{<+true+>}{<+false+>},' +\.'languagename,' +\.'bra:useshorthands,' +\.'brd:defineshorthand,' +\.'brd:aliasshorthand,' +\.'bra:languageshorthans,' +\.'bra:shorthandon,' +\.'bra:shorthandoff,' +\.'brd:languageattribute' + +" vim:ft=vim:ff=unix: +if exists('s:doneOnce') + finish +endif +let s:doneOnce = 1 + +augroup LatexSuite + au LatexSuite User LatexSuiteScannedPackages + \ call Tex_Debug('babel: catching LatexSuiteScannedPackages event') | + \ call s:SetQuotes() +augroup END + +let s:path = expand('<sfile>:p:h') + +" SetQuotes: sets quotes for various languages {{{ +" Description: +function! <SID>SetQuotes() + if g:Tex_package_detected =~ '\<babel\>' + if g:Tex_babel_options =~ '\<german\>' + exec 'so '.s:path.'/german' + elseif g:Tex_babel_options =~ '\<ngerman\>' + exec 'so '.s:path.'/ngerman' + endif + endif +endfunction " }}} + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/bar b/.vim/ftplugin/latex-suite/packages/bar @@ -0,0 +1,27 @@ +if exists("bar_package_file") + finish +endif +let bar_package_file = 1 + +let g:TeX_package_option_bar = '' + +let g:TeX_package_bar = +\ 'env:barenv,' +\.'brs:bar{<+height+>}{<+index+>}[<+desc+>],' +\.'hlineon,' +\.'brs:legend{<+index+>}{<+text+>},' +\.'bra:setdepth,' +\.'bra:sethspace,' +\.'brs:setlinestyle{<+solid-dotted+>},' +\.'brs:setnumberpos{<+empty-axis-down-inside-outside-up+>},' +\.'bra:setprecision,' +\.'bra:setstretch,' +\.'bra:setstyle,' +\.'bra:setwidth,' +\.'brs:setxaxis{<+w1+>}{<+w2+>}{<+step+>},' +\.'brs:setyaxis[<+n+>]{<+w1+>}{<+w2+>}{<+step+>},' +\.'brs:setxname[<+lrbt+>]{<+etiquette+>},' +\.'brs:setyname[<+lrbt+>]{<+etiquette+>},' +\.'brs:setxvaluetyp{<+day-month+>}' + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/biblatex b/.vim/ftplugin/latex-suite/packages/biblatex @@ -0,0 +1,159 @@ +" Biblatex package support v 0.1 2010-02-17 +" This file has been written by +" Andreas Wagner <Andreas dot Wagner at em dot uni-frankfurt dot de> +" based on the documentation of +" biblatex 0.8e, July 4 2009. +" It can be used, modified and distributed according to the vim license. + + +if exists("biblatex_package_file") + finish +endif +let biblatex_package_file = 1 + +let g:TeX_package_option_biblatex = +\ 'style=,' +\.'citestyle=,' +\.'bibstyle=,' +\.'natbib=,' +\.'sorting=,' +\.'sortlos=,' +\.'sortcites=,' +\.'maxnames=,' +\.'minnames=,' +\.'maxitems=,' +\.'minitems=,' +\.'autocite=,' +\.'autopunct=,' +\.'babel=,' +\.'block=,' +\.'hyperref=,' +\.'backref=,' +\.'indexing=,' +\.'loadfiles=,' +\.'refsection=,' +\.'refsegment=,' +\.'citereset=,' +\.'abbreviate=,' +\.'date=,' +\.'urldate=,' +\.'defernums=,' +\.'punctfont=,' +\.'arxiv=,' +\.'backend=,' +\.'mincrossrefs=,' +\.'bibencoding=,' +\.'useauthor=,' +\.'useeditor=,' +\.'usetranslator=,' +\.'useprefix=,' +\.'skipbib=,' +\.'skiplos=,' +\.'skiplab=,' +\.'dataonly=,' +\.'pagetracker=,' +\.'citetracker=,' +\.'ibidtracker=,' +\.'idemtracker=,' +\.'opcittracker=,' +\.'loccittracker=,' +\.'firstinits=,' +\.'terseinits=,' +\.'labelalpha=,' +\.'labelnumber=,' +\.'labelyear=,' +\.'singletitle=,' +\.'uniquename=,' +\.'openbib' + +let g:TeX_package_biblatex = +\ 'sbr:preamble,' +\.'bra:ExecuteBibliographyOptions{<+key=value+>},' +\.'bra:Bibliography{<+file+>},' +\.'sbr:localization,' +\.'brd:DefineBibliographyStrings{<+lang+>}{<+definitions+>},' +\.'brd:DefineBibliographyExtras{<+lang+>}{<+code+>},' +\.'brd:UndefineBibliographyExtras{<+lang+>}{<+code+>},' +\.'brd:DefineHyphenationExceptions{<+lang+>}{<+text+>},' +\.'bra:NewBibliographyString{<+key+>},' +\.'sbr:main_commands,' +\.'brs:cite[<+prenote+>][<+postnote+>]{<+key+>},' +\.'brs:Cite[<+prenote+>][<+postnote+>]{<+key+>},' +\.'brs:cite*[<+prenote+>][<+postnote+>]{<+key+>},' +\.'brs:parencite[<+prenote+>][<+postnote+>]{<+key+>},' +\.'brs:Parencite[<+prenote+>][<+postnote+>]{<+key+>},' +\.'brs:parencite*[<+prenote+>][<+postnote+>]{<+key+>},' +\.'brs:footcite[<+prenote+>][<+postnote+>]{<+key+>},' +\.'brs:Footcite[<+prenote+>][<+postnote+>]{<+key+>},' +\.'brs:textcite[<+prenote+>][<+postnote+>]{<+key+>},' +\.'brs:Textcite[<+prenote+>][<+postnote+>]{<+key+>},' +\.'bra:supercite{<+key+>},' +\.'brs:autocite[<+prenote+>][<+postnote+>]{<+key+>},' +\.'brs:Autocite[<+prenote+>][<+postnote+>]{<+key+>},' +\.'brs:autocite*[<+prenote+>][<+postnote+>]{<+key+>},' +\.'brs:Autocite*[<+prenote+>][<+postnote+>]{<+key+>},' +\.'sbr:multicites,' +\.'brs:cites(<+prenote+>)(<+postnote+>)[<+prenote+>][<+postnote+>]{<+key+>}[<+prenote+>][<+postnote+>]{<+key+>},' +\.'brs:Cites(<+prenote+>)(<+postnote+>)[<+prenote+>][<+postnote+>]{<+key+>}[<+prenote+>][<+postnote+>]{<+key+>}[<+prenote+>][<+postnote+>]{<+key+>},' +\.'brs:parencites(<+prenote+>)(<+postnote+>)[<+prenote+>][<+postnote+>]{<+key+>}[<+prenote+>][<+postnote+>]{<+key+>}[<+prenote+>][<+postnote+>]{<+key+>},' +\.'brs:Parencites(<+prenote+>)(<+postnote+>)[<+prenote+>][<+postnote+>]{<+key+>}[<+prenote+>][<+postnote+>]{<+key+>}[<+prenote+>][<+postnote+>]{<+key+>},' +\.'brs:footcites(<+prenote+>)(<+postnote+>)[<+prenote+>][<+postnote+>]{<+key+>}[<+prenote+>][<+postnote+>]{<+key+>}[<+prenote+>][<+postnote+>]{<+key+>},' +\.'brs:Footcites(<+prenote+>)(<+postnote+>)[<+prenote+>][<+postnote+>]{<+key+>}[<+prenote+>][<+postnote+>]{<+key+>}[<+prenote+>][<+postnote+>]{<+key+>},' +\.'brs:textcites(<+prenote+>)(<+postnote+>)[<+prenote+>][<+postnote+>]{<+key+>}[<+prenote+>][<+postnote+>]{<+key+>}[<+prenote+>][<+postnote+>]{<+key+>},' +\.'brs:Textcites(<+prenote+>)(<+postnote+>)[<+prenote+>][<+postnote+>]{<+key+>}[<+prenote+>][<+postnote+>]{<+key+>}[<+prenote+>][<+postnote+>]{<+key+>},' +\.'brs:supercites(<+prenote+>)(<+postnote+>){<+key+>}{<+key+>},' +\.'brs:autocites(<+prenote+>)(<+postnote+>)[<+prenote+>][<+postnote+>]{<+key+>}[<+prenote+>][<+postnote+>]{<+key+>},' +\.'brs:Autocites(<+prenote+>)(<+postnote+>)[<+prenote+>][<+postnote+>]{<+key+>}[<+prenote+>][<+postnote+>]{<+key+>}[<+prenote+>][<+postnote+>]{<+key+>},' +\.'sbr:text_commands,' +\.'brs:citeauthor[<+prenote+>][<+postnote+>]{<+key+>},' +\.'brs:Citeauthor[<+prenote+>][<+postnote+>]{<+key+>},' +\.'brs:citetitle[<+prenote+>][<+postnote+>]{<+key+>},' +\.'brs:citetitle*[<+prenote+>][<+postnote+>]{<+key+>},' +\.'brs:citeyear[<+prenote+>][<+postnote+>]{<+key+>},' +\.'brs:citeurl[<+prenote+>][<+postnote+>]{<+key+>},' +\.'sbr:special_commands,' +\.'bra:nocite{<+key+>},' +\.'nor:citereset,' +\.'nor:citereset*,' +\.'nor:mancite,' +\.'brs:fullcite[<+prenote+>][<+postnote+>]{<+key+>},' +\.'brs:footfullcite[<+prenote+>][<+postnote+>]{<+key+>},' +\.'brs:volcite[<+prenote+>]{<+volume+>}[<+page+>]{<+key+>},' +\.'brs:Volcite[<+prenote+>]{<+volume+>}[<+page+>]{<+key+>},' +\.'brs:pvolcite[<+prenote+>]{<+volume+>}[<+page+>]{<+key+>},' +\.'brs:Pvolcite[<+prenote+>]{<+volume+>}[<+page+>]{<+key+>},' +\.'brs:fvolcite[<+prenote+>]{<+volume+>}[<+page+>]{<+key+>},' +\.'brs:Fvolcite[<+prenote+>]{<+volume+>}[<+page+>]{<+key+>},' +\.'brs:tvolcite[<+prenote+>]{<+volume+>}[<+page+>]{<+key+>},' +\.'brs:Tvolcite[<+prenote+>]{<+volume+>}[<+page+>]{<+key+>},' +\.'brs:avolcite[<+prenote+>]{<+volume+>}[<+page+>]{<+key+>},' +\.'brs:Avolcite[<+prenote+>]{<+volume+>}[<+page+>]{<+key+>},' +\.'brs:notecite[<+prenote+>][<+postnote+>]{<+key+>},' +\.'brs:Notecite[<+prenote+>][<+postnote+>]{<+key+>},' +\.'brs:pnotecite[<+prenote+>][<+postnote+>]{<+key+>},' +\.'brs:Pnotecite[<+prenote+>][<+postnote+>]{<+key+>},' +\.'brs:fnotecite[<+prenote+>][<+postnote+>]{<+key+>},' +\.'brs:Fnotecite[<+prenote+>][<+postnote+>]{<+key+>},' +\.'brs:citename[<+prenote+>][<+postnote+>]{<+key+>}[<+format+>]{<+list+>},' +\.'brs:citelist[<+prenote+>][<+postnote+>]{<+key+>}[<+format+>]{<+list+>},' +\.'brs:citefield[<+prenote+>][<+postnote+>]{<+key+>}[<+format+>]{<+field+>},' +\.'sbr:sorting,' +\.'eno:refsection[<+bibfiles+>],' +\.'noo:newrefsection[<+bibfiles+>],' +\.'eno:refsegment[<+bibfiles+>],' +\.'noo:newsegment[<+bibfiles+>],' +\.'bra:DeclareBibliographyCategory{<+category+>},' +\.'brd:addtocategory{<+category+>}{<+key+>},' +\.'brd:defbibheading{<+name+>}{<+code+>},' +\.'brd:defbibnote{<+name+>}{<+text+>},' +\.'bra:segment,' +\.'bra:type,' +\.'bra:keyword,' +\.'bra:category,' +\.'sbr:endmatter,' +\.'noo:printbibliography[<+key=value+>],' +\.'noo:printshorthands[<+key=value+>],' +\.'noo:bibbysection[<+key=value+>],' +\.'noo:bibbysegment[<+key=value+>],' +\.'noo:bibbycategory[<+key=value+>]' + diff --git a/.vim/ftplugin/latex-suite/packages/bm b/.vim/ftplugin/latex-suite/packages/bm @@ -0,0 +1,10 @@ +if exists("bm_package_file") + finish +endif +let bm_package_file = 1 + +let g:TeX_package_option_bm = '' + +let g:TeX_package_bm = 'bra:bm' + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/bophook b/.vim/ftplugin/latex-suite/packages/bophook @@ -0,0 +1,12 @@ +if exists("bophook_package_file") + finish +endif +let bophook_package_file = 1 + +let g:TeX_package_option_bophook = '' + +let g:TeX_package_bophook = +\ 'bra:AtBeginPage,' +\.'bra:PageLayout' + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/boxedminipage b/.vim/ftplugin/latex-suite/packages/boxedminipage @@ -0,0 +1,10 @@ +if exists("boxedminipage_package_file") + finish +endif +let boxedminipage_package_file = 1 + +let g:TeX_package_option_boxedminipage = '' + +let g:TeX_package_boxedminipage = 'ens:boxedminipage:[<+pos+>]{<+size+>}' + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/caption2 b/.vim/ftplugin/latex-suite/packages/caption2 @@ -0,0 +1,43 @@ +if exists("caption2_package_file") + finish +endif +let caption2_package_file = 1 + +let g:TeX_package_option_caption2 = +\ 'scriptsize,' +\.'footnotesize,' +\.'small,' +\.'normalsize,' +\.'large,' +\.'Large,' +\.'up,' +\.'it,' +\.'sl,' +\.'sc,' +\.'md,' +\.'bf,' +\.'rm,' +\.'sf,' +\.'tt,' +\.'ruled,' +\.'boxed,' +\.'centerlast,' +\.'anne,' +\.'center,' +\.'flushleft,' +\.'flushright,' +\.'oneline,' +\.'nooneline,' +\.'hang,' +\.'isu,' +\.'indent,' +\.'longtable' + +let g:TeX_package_caption2 = +\ 'bra:captionsize,' +\.'bra:captionfont,' +\.'bra:captionlabelfont,' +\.'bra:setcaptionmargin,' +\.'bra:setcaptionwidth' + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/cases b/.vim/ftplugin/latex-suite/packages/cases @@ -0,0 +1,12 @@ +if exists("cases_package_file") + finish +endif +let cases_package_file = 1 + +let g:TeX_package_option_cases = '' + +let g:TeX_package_cases = +\ 'ens:numcases:{<+label+>},' +\.'ens:subnumcases:{<+label+>}' + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/ccaption b/.vim/ftplugin/latex-suite/packages/ccaption @@ -0,0 +1,20 @@ +if exists("ccaption_package_file") + finish +endif +let ccaption_package_file = 1 + +let g:TeX_package_option_ccaption = '' + +let g:TeX_package_ccaption = +\ 'bra:contcaption,' +\.'bra:legend,' +\.'bra:namedlegend,' +\.'abovelegendskip,' +\.'belowlegendskip,' +\.'brd:newfixedcaption,' +\.'brd:renewfixedcaption,' +\.'brd:providefixedcaption,' +\.'brs:newfloatenv[<+counter+>]{<+name+>}{<+ext+>}{<+etiq+>},' +\.'brd:listfloats' + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/changebar b/.vim/ftplugin/latex-suite/packages/changebar @@ -0,0 +1,35 @@ +if exists("changebar_package_file") + finish +endif +let changebar_package_file = 1 + +let g:TeX_package_option_changebar = +\ 'DVItoLN03,' +\.'dvitoln03,' +\.'DVItoPS,' +\.'dvitops,' +\.'DVIps,' +\.'dvips,' +\.'emTeX,' +\.'emtex,' +\.'textures,' +\.'Textures,' +\.'outerbars,' +\.'innerbars,' +\.'leftbars,' +\.'rightbars,' +\.'traceon,' +\.'traceoff' + +let g:TeX_package_changebar = +\ 'ens:changebar:[<+thickness+>],' +\.'noo:cbstart,' +\.'cbend,' +\.'cbdelete,' +\.'changebarwidth,' +\.'deletebarwidth,' +\.'changebarsep,' +\.'spe:changebargrey,' +\.'nochangebars' + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/chapterbib b/.vim/ftplugin/latex-suite/packages/chapterbib @@ -0,0 +1,24 @@ +if exists("chapterbib_package_file") + finish +endif +let chapterbib_package_file = 1 + +let g:TeX_package_option_chapterbib = +\ 'sectionbib,' +\.'rootbib,' +\.'gather,' +\.'duplicate' + +let g:TeX_package_chapterbib = +\ 'env:cbunit,' +\.'brd:sectionbib,' +\.'bra:cbinput,' +\.'sep:redefine,' +\.'bra:citeform,' +\.'bra:citepunct,' +\.'bra:citeleft,' +\.'bra:citeright,' +\.'bra:citemid,' +\.'bra:citedash' + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/cite b/.vim/ftplugin/latex-suite/packages/cite @@ -0,0 +1,32 @@ +if exists("cite_package_file") + finish +endif +let cite_package_file = 1 + +let g:TeX_package_option_cite = +\ 'verbose,' +\.'nospace,' +\.'space,' +\.'nosort,' +\.'sort,' +\.'noadjust' + +let g:TeX_package_cite = +\ 'bra:cite,' +\.'bra:citen,' +\.'bra:citenum,' +\.'bra:citeonline,' +\.'bra:nocite,' +\.'sep:redefine,' +\.'bra:citeform,' +\.'bra:citepunct,' +\.'bra:citeleft,' +\.'bra:citeright,' +\.'bra:citemid,' +\.'bra:citedash' + +syn region texRefZone matchgroup=texStatement start="\\citen\([tp]\*\=\)\={" keepend end="}\|%stopzone\>" contains=texComment,texDelimiter +syn region texRefZone matchgroup=texStatement start="\\citenum\([tp]\*\=\)\={" keepend end="}\|%stopzone\>" contains=texComment,texDelimiter +syn region texRefZone matchgroup=texStatement start="\\citeonline\([tp]\*\=\)\={" keepend end="}\|%stopzone\>" contains=texComment,texDelimiter + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/color b/.vim/ftplugin/latex-suite/packages/color @@ -0,0 +1,43 @@ +if exists("color_package_file") + finish +endif +let color_package_file = 1 + +let g:TeX_package_option_color = +\ 'monochrome,' +\.'debugshow,' +\.'dvips,' +\.'xdvi,' +\.'dvipdf,' +\.'pdftex,' +\.'dvipsone,' +\.'dviwindo,' +\.'emtex,' +\.'dviwin,' +\.'oztex,' +\.'textures,' +\.'pctexps,' +\.'pctexwin,' +\.'pctexhp,' +\.'pctex32,' +\.'truetex,' +\.'tcidvi,' +\.'dvipsnames,' +\.'nodvipsnames,' +\.'usenames' + +let g:TeX_package_color = +\ 'brs:definecolor{<++>}{<++>}{<++>},' +\.'brs:DefineNamedColor{<++>}{<++>}{<++>}{<++>},' +\.'bra:color,' +\.'nob:color,' +\.'brd:textcolor,' +\.'brs:textcolor[<++>]{<++>}{<++>},' +\.'brd:colorbox,' +\.'brs:colorbox[<++>]{<++>}{<++>},' +\.'brs:fcolorbox{<++>}{<++>}{<++>},' +\.'brs:fcolorbox[<++>]{<++>}{<++>}{<++>},' +\.'brd:pagecolor,' +\.'nob:pagecolor' + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/comma b/.vim/ftplugin/latex-suite/packages/comma @@ -0,0 +1,12 @@ +if exists("comma_package_file") + finish +endif +let comma_package_file = 1 + +let g:TeX_package_option_comma = '' + +let g:TeX_package_comma = +\ 'bra:commaform,' +\.'bra:commaformtoken' + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/csquotes b/.vim/ftplugin/latex-suite/packages/csquotes @@ -0,0 +1,104 @@ +" Csquotes package support v 0.1 2010-02-17 +" This file has been written by +" Andreas Wagner <Andreas dot Wagner at em dot uni-frankfurt dot de> +" based on the documentation of +" csquotes 4.4a, July 4 2009 +" It can be used, modified and distributed according to the vim license. + + +if exists("csquotes_package_file") + finish +endif +let csquotes_package_file = 1 + +let g:TeX_package_option_csquotes = +\ 'strict=,' +\.'babel=,' +\.'maxlevel=,' +\.'style=,' +\.'danish=,' +\.'english=,' +\.'french=,' +\.'german=,' +\.'italian=,' +\.'norwegian=,' +\.'portuguese=,' +\.'spanish=,' +\.'swedish=' + +let g:TeX_package_csquotes = +\ 'sbr:basic,' +\.'bra:enquote{<+text+>},' +\.'bra:enquote*{<+text+>},' +\.'brs:textquote[<+cite+>][<+punct+>]{<+text+>},' +\.'brs:textquote*[<+cite+>][<+punct+>]{<+text+>},' +\.'brs:blockquote[<+cite+>][<+punct+>]{<+text+>},' +\.'sbr:foreign_text,' +\.'brd:foreignquote{<+lang+>}{<+text+>},' +\.'brd:foreignquote*{<+lang+>}{<+text+>},' +\.'brd:hyphenquote{<+lang+>}{<+text+>},' +\.'brd:hyphenquote*{<+lang+>}{<+text+>},' +\.'brs:foreigntextquote{<+lang+>}[<+cite+>][<+punct+>]{<+text+>},' +\.'brs:foreigntextquote*{<+lang+>}[<+cite+>][<+punct+>]{<+text+>},' +\.'brs:hyphentextquote{<+lang+>}[<+cite+>][<+punct+>]{<+text+>},' +\.'brs:hyphentextquote*{<+lang+>}[<+cite+>][<+punct+>]{<+text+>},' +\.'brs:foreignblockquote{<+lang+>}[<+cite+>][<+punct+>]{<+text+>},' +\.'brs:hyphenblockquote{<+lang+>}[<+cite+>][<+punct+>]{<+text+>},' +\.'sbr:active_quotes,' +\.'bra:MakeOuterQuote{<+character+>},' +\.'bra:MakeInnerQuote{<+character+>},' +\.'brd:MakeAutoQuote{<+opening_character+>}{<+closing_character+>},' +\.'brd:MakeAutoQuote*{<+opening_character+>}{<+closing_character+>},' +\.'brs:MakeForeignQuote{<+lang+>}{<+opening_character+>}{<+closing_character+>},' +\.'brs:MakeForeignQuote*{<+lang+>}{<+opening_character+>}{<+closing_character+>},' +\.'brs:MakeHyphenQuote{<+lang+>}{<+opening_character+>}{<+closing_character+>},' +\.'brs:MakeHyphenQuote*{<+lang+>}{<+opening_character+>}{<+closing_character+>},' +\.'brs:MakeBlockQuote{<+opening_character+>}{<+delimiter+>}{<+closing_character+>},' +\.'brs:MakeForeignBlockQuote{<+lang+>}{<+opening_character+>}{<+delimiter+>}{<+closing_character+>},' +\.'brs:MakeHyphenBlockQuote{<+lang+>}{<+opening_character+>}{<+delimiter+>}{<+closing_character+>},' +\.'nor:EnableQuote,' +\.'nor:DisableQuotes,' +\.'nor:VerbatimQuotes,' +\.'nor:DeleteQuotes,' +\.'sbr:automatic_citation,' +\.'brs:textcquote[<+prenote+>][<+postnote+>]{<+key+>}[<+punct+>]{<+text+>},' +\.'brs:textcquote*[<+prenote+>][<+postnote+>]{<+key+>}[<+punct+>]{<+text+>},' +\.'brs:foreigntextcquote{<+lang+>}[<+prenote+>][<+postnote+>]{<+key+>}[<+punct+>]{<+text+>},' +\.'brs:foreigntextcquote*{<+lang+>}[<+prenote+>][<+postnote+>]{<+key+>}[<+punct+>]{<+text+>},' +\.'brs:hyphentextcquote{<+lang+>}[<+prenote+>][<+postnote+>]{<+key+>}[<+punct+>]{<+text+>},' +\.'brs:hyphentextcquote*{<+x+>}[<+prenote+>][<+postnote+>]{<+key+>}[<+punct+>]{<+text+>},' +\.'brs:blockcquote[<+prenote+>][<+postnote+>]{<+key+>}[<+punct+>]{<+text+>},' +\.'brs:foreignblockcquote{<+lang+>}[<+prenote+>][<+postnote+>]{<+key+>}[<+punct+>]{<+text+>},' +\.'brs:hyphenblockcquote{<+lang+>}[<+prenote+>][<+postnote+>]{<+key+>}[<+punct+>]{<+text+>},' +\.'sbr:display_quotes,' +\.'ens:displayquote:[<+cite+>][<+punct+>],' +\.'ens:foreigndisplayquote:{<+lang+>}[<+cite+>][<+punct+>],' +\.'ens:hyphendisplayquote:{<+lang+>}[<+cite+>][<+punct+>],' +\.'ens:displaycquote:[<+prenote+>][<+postnote+>]{<+key+>}[<+punct+>],' +\.'ens:foreigndisplaycquote:{<+lang+>}[<+prenote+>][<+postnote+>]{<+key+>}[<+punct+>],' +\.'ens:hyphendisplaycquote:{<+lang+>}[<+prenote+>][<+postnote+>]{<+key+>}[<+punct+>],' +\.'sbr:config,' +\.'nob:setquotestyle,' +\.'nor:setquotestyle*,' +\.'brs:DeclareQuoteStyle[<+variant+>]{<+style+>}[<+outer_init+>][<+inner_init+>]{<+opening_outer_mark+>}[<+middle_outer_mark+>]{<+closing_outer_mark+>}[<+kern+>]{<+opening_inner_mark+>}[<+middle_inner_mark+>]{<+closing_inner_mark+>},' +\.'brs:DeclareQuoteAlias[<+variant+>]{<+style+>}{<+alias+>},' +\.'bra:DeclareQuoteOption{<+style+>},' +\.'bra:ExecuteQuoteOptions{<+key=value+>},' +\.'brs:DeclarePlainStyle{<+opening_outer_mark+>}{<+closing_outer_mark+>}{<+opening_inner_mark+>}{<+closing_inner_mark+>},' +\.'bra:SetBlockThreshold{<+integer+>},' +\.'bra:SetBlockEnvironment{<+environment+>},' +\.'bra:SetCiteCommand{<+command+>},' +\.'sbr:helper_expressions,' +\.'brd:ifblockquote,' +\.'brd:ifquotepunct,' +\.'brd:ifquoteterm,' +\.'brd:ifquotecolon,' +\.'brd:ifquotecomma,' +\.'brd:ifquoteexcmlam,' +\.'brd:ifquotequestion,' +\.'brd:ifquotesemicolon,' +\.'brs:ifstringblank{<+string+>}{<+true+>}{<+false+>}' + +let g:TeX_SmartQuoteOpen = "\\enquote\{" +let g:TeX_SmartQuoteClose = "\}" + diff --git a/.vim/ftplugin/latex-suite/packages/deleq b/.vim/ftplugin/latex-suite/packages/deleq @@ -0,0 +1,36 @@ +if exists("deleq_package_file") + finish +endif +let deleq_package_file = 1 + +let g:TeX_package_option_deleq = '' + +let g:TeX_package_deleq = +\.'env:deqn,' +\.'env:ddeqn,' +\.'env:deqarr,' +\.'env:ddeqar,' +\.'env:deqrarr,' +\.'nor:nydeqno,' +\.'nor:heqno,' +\.'bra:reqno,' +\.'bra:rndeqno,' +\.'bra:rdeqno,' +\.'nob:eqreqno,' +\.'nob:deqreqno,' +\.'nob:ddeqreqno,' +\.'bra:arrlabel,' +\.'nor:where,' +\.'bra:remtext,' +\.'nor:nydeleqno,' +\.'nor:deleqno,' +\.'nor:jotbaseline' + +if !exists("tex_no_math") + syn region texMathZoneA start="\\begin\s*{\s*deqn\*\s*}" end="\\end\s*{\s*deqn\*\s*}" keepend fold contains=@texMathZoneGroup + syn region texMathZoneB start="\\begin\s*{\s*ddeqn\*\s*}" end="\\end\s*{\s*ddeqn\*\s*}" keepend fold contains=@texMathZoneGroup + syn region texMathZoneC start="\\begin\s*{\s*deqarr\s*}" end="\\end\s*{\s*deqarr\s*}" keepend fold contains=@texMathZoneGroup + syn region texMathZoneD start="\\begin\s*{\s*ddeqar\s*}" end="\\end\s*{\s*ddeqar\s*}" keepend fold contains=@texMathZoneGroup + syn region texMathZoneE start="\\begin\s*{\s*deqrarr\*\s*}" end="\\end\s*{\s*deqrarr\*\s*}" keepend fold contains=@texMathZoneGroup +endif +" vim:ft=vim:ff=unix:noet:ts=4: diff --git a/.vim/ftplugin/latex-suite/packages/drftcite b/.vim/ftplugin/latex-suite/packages/drftcite @@ -0,0 +1,29 @@ +if exists("drftcite_package_file") + finish +endif +let drftcite_package_file = 1 + +let g:TeX_package_option_drftcite = +\ 'verbose,' +\.'nospace,' +\.'space,' +\.'breakcites,' +\.'manualsort,' +\.'tt,' +\.'shownumbers,' +\.'nocitecount' + +let g:TeX_package_drftcite = +\ 'bra:cite,' +\.'bra:citen,' +\.'sep:redefine,' +\.'bra:citeform,' +\.'bra:citepunct,' +\.'bra:citeleft,' +\.'bra:citeright,' +\.'bra:citemid,' +\.'bra:citedash' + +syn region texRefZone matchgroup=texStatement start="\\citen\([tp]\*\=\)\={" keepend end="}\|%stopzone\>" contains=texComment,texDelimiter + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/dropping b/.vim/ftplugin/latex-suite/packages/dropping @@ -0,0 +1,12 @@ +if exists("dropping_package_file") + finish +endif +let dropping_package_file = 1 + +let g:TeX_package_option_dropping = '' + +let g:TeX_package_dropping = +\ 'brs:bigdrop{<+indent+>}{<+big+>}{<+font+>}{<+text+>},' +\.'brs:dropping[<+indent+>]{<+big+>}{<+text+>}' + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/enumerate b/.vim/ftplugin/latex-suite/packages/enumerate @@ -0,0 +1,10 @@ +if exists("enumerate_package_file") + finish +endif +let enumerate_package_file = 1 + +let g:TeX_package_option_enumerate = '' + +let g:TeX_package_enumerate = 'ens:enumerate:[<+prefix+>]' + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/eqlist b/.vim/ftplugin/latex-suite/packages/eqlist @@ -0,0 +1,19 @@ +if exists("eqlist_package_file") + finish +endif +let eqlist_package_file = 1 + +let g:TeX_package_option_eqlist = '' + +let g:TeX_package_eqlist = +\ 'env:eqlist,' +\.'env:eqlist*,' +\.'env:Eqlist,' +\.'env:Eqlist*,' +\.'sep:modificators,' +\.'eqlistinit,' +\.'eqliststarinit,' +\.'eqlistinitpar,' +\.'eqlistlabel' + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/eqparbox b/.vim/ftplugin/latex-suite/packages/eqparbox @@ -0,0 +1,12 @@ +if exists("eqparbox_package_file") + finish +endif +let eqparbox_package_file = 1 + +let g:TeX_package_option_eqparbox = '' + +let g:TeX_package_eqparbox = +\ 'brs:eqparbox[<+pos+>][<+height+>][<+inner-pos+>]{<+tag+>}{<+text+>},' +\.'bra:eqboxwidth' + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/everyshi b/.vim/ftplugin/latex-suite/packages/everyshi @@ -0,0 +1,10 @@ +if exists("everyshi_package_file") + finish +endif +let everyshi_package_file = 1 + +let g:TeX_package_option_everyshi = '' + +let g:TeX_package_everyshi = 'bra:EveryShipOut' + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/exmpl b/.vim/ftplugin/latex-suite/packages/exmpl @@ -0,0 +1,55 @@ +if exists("exmpl_package_file") + finish +endif +let exmpl_package_file = 1 + +" Author: Mikolaj Machowski +" Date: 10.04.2002 +" Example plugin for packages in latexSuite +" + +" This variable creates Options submenu in package menu. Even when no options are +" given for this package it HAS to exist in form +" let TeX_package_option_exmpl = "" +" Options and commands are delimited with comma , + +let g:TeX_package_option_exmpl = "OpcjaA=,OpcjaB,OpcjaC" + +" Most command should have some definition before. Package menu system can +" recognize type of command and behave in good manner: +" env: (environment) creates simple environment template +" \begin{command} +" x <- cursor here +" \end{command} +" +" bra: (brackets) useful when inserting brackets commands +" \command{x}<<>> <- cursor at x, and placeholders as in other menu entries +" +" nor: (normal) nor: and pla: are `highlighted' in menu with `'' +" \command<Space> +" +" pla: (plain) +" command<Space> +" +" spe: (special) +" command <-literal insertion of command, in future here should go +" commands with special characters +" +" sep: (separator) creates separator. Good for aesthetics and usability :) +" +" Command can be also given with no prefix:. The result is +" \command (as in nor: but without <Space>) + + +let g:TeX_package_exmpl = "env:AEnvFirst,env:aEnvSec,env:BThi," + \ . "sep:a,env:zzzz," + \ . "bra:aBraFirst,bra:bBraSec,bra:cBraThi," + \ . "sep:b," + \ . "nor:aNorPri,nor:bNorSec,nor:cNorTer," + \ . "sep:c," + \ . "pla:aPla1,pla:bPla2,pla:cPla3," + \ . "sep:d," + \ . "spe:aSpe1,spe:bSpe2,spe:cSpe3," + \ . "sep:e," + \ . "aNo1,bNo2,cNo3" +" vim:ft=vim diff --git a/.vim/ftplugin/latex-suite/packages/fixme b/.vim/ftplugin/latex-suite/packages/fixme @@ -0,0 +1,42 @@ +" Fixme package support v 0.1 2010-02-17 +" This file has been written by +" Andreas Wagner <Andreas dot Wagner at em dot uni-frankfurt dot de> +" based on the documentation of +" fixme November 28 2007 +" It can be used, modified and distributed according to the vim license. + + +if exists("fixme_package_file") + finish +endif +let fixme_package_file = 1 + +let g:TeX_package_option_fixme = +\ 'draft,' +\.'final,' +\.'silent,' +\.'nosilent,' +\.'inline,' +\.'margin,' +\.'marginclue,' +\.'footnote,' +\.'index,' +\.'noinline,' +\.'nomargin,' +\.'nomarginclue,' +\.'nofootnote,' +\.'noindex' + +let g:TeX_package_fixme = +\ 'sbr:simple,' +\.'nob:fixme[<+layout+>]{<+note+>},' +\.'nob:fxnote[<+layout+>]{<+note+>},' +\.'nob:fxwarning[<+layout+>]{<+note+>},' +\.'nob:fxerror[<+layout+>]{<+note+>},' +\.'sbr:environments,' +\.'eno:afixme[<+summary+>],' +\.'eno:anfxnote[<+summary+>],' +\.'eno:anfxwarning[<+summary+>],' +\.'eno:anfxerror[<+summary+>],' +\.'sbr:other,' +\.'nor:listoffixmes' diff --git a/.vim/ftplugin/latex-suite/packages/flafter b/.vim/ftplugin/latex-suite/packages/flafter @@ -0,0 +1,10 @@ +if exists("flafter_package_file") + finish +endif +let flafter_package_file = 1 + +let g:TeX_package_option_flafter = '' + +let g:TeX_package_flafter = 'noo:suppressfloats,noo:suppress' + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/float b/.vim/ftplugin/latex-suite/packages/float @@ -0,0 +1,16 @@ +if exists("float_package_file") + finish +endif +let float_package_file = 1 + +let g:TeX_package_option_float = '' + +let g:TeX_package_float = +\ 'bra:floatstyle,' +\.'brs:newfloat{<++>}{<++>}{<++>}[<++>],' +\.'brd:floatname,' +\.'brd:listof,' +\.'bra:restylefloat,' +\.'brd:floatplacement' + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/floatflt b/.vim/ftplugin/latex-suite/packages/floatflt @@ -0,0 +1,12 @@ +if exists("floatflt_package_file") + finish +endif +let floatflt_package_file = 1 + +let g:TeX_package_option_floatflt = 'rflt,lflt,vflt' + +let g:TeX_package_floatflt = +\ 'ens:floatingfigure:[<+loc+>]{<+spec+>},' +\.'ens:floatingtable:[<+loc+>]{<+spec+>}' + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/fn2end b/.vim/ftplugin/latex-suite/packages/fn2end @@ -0,0 +1,10 @@ +if exists("fn2end_package_file") + finish +endif +let fn2end_package_file = 1 + +let g:TeX_package_option_fn2end = '' + +let g:TeX_package_fn2end = 'makeendnotes,theendnotes' + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/footmisc b/.vim/ftplugin/latex-suite/packages/footmisc @@ -0,0 +1,21 @@ +if exists("footmisc_package_file") + finish +endif +let footmisc_package_file = 1 + +let g:TeX_package_option_footmisc = +\ 'bottom,' +\.'flushmargin,' +\.'marginal,' +\.'multiple,' +\.'norule,' +\.'para,' +\.'perpage,' +\.'splitrule,' +\.'stable,' +\.'symbol,' +\.'symbol+' + +let g:TeX_package_footmisc = '' + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/geometry b/.vim/ftplugin/latex-suite/packages/geometry @@ -0,0 +1,93 @@ +if exists("geometry_package_file") + finish +endif +let geometry_package_file = 1 + +let g:TeX_package_option_geometry = +\ 'sbr:Boolean,' +\.'verbose,' +\.'landscape,' +\.'portrait,' +\.'twoside,' +\.'includemp,' +\.'reversemp,' +\.'reversemarginpar,' +\.'nohead,' +\.'nofoot,' +\.'noheadfoot,' +\.'dvips,' +\.'pdftex,' +\.'vtex,' +\.'truedimen,' +\.'reset,' +\.'sbr:BooleanDimensions,' +\.'a0paper,' +\.'a1paper,' +\.'a2paper,' +\.'a3paper,' +\.'a4paper,' +\.'a5paper,' +\.'a6paper,' +\.'b0paper,' +\.'b1paper,' +\.'b2paper,' +\.'b3paper,' +\.'b4paper,' +\.'b5paper,' +\.'b6paper,' +\.'letterpaper,' +\.'executivepaper,' +\.'legalpaper,' +\.'sbr:SingleValueOption,' +\.'paper=,' +\.'papername=,' +\.'paperwidth=,' +\.'paperheight=,' +\.'width=,' +\.'totalwidth=,' +\.'height=,' +\.'totalheight=,' +\.'left=,' +\.'lmargin=,' +\.'right=,' +\.'rmargin=,' +\.'top=,' +\.'tmargin=,' +\.'bottom=,' +\.'bmargin=,' +\.'hscale=,' +\.'vscale=,' +\.'textwidth=,' +\.'textheight=,' +\.'marginparwidth=,' +\.'marginpar=,' +\.'marginparsep=,' +\.'headheight=,' +\.'head=,' +\.'headsep=,' +\.'footskip=,' +\.'hoffset=,' +\.'voffset=,' +\.'twosideshift=,' +\.'mag=,' +\.'columnsep=,' +\.'footnotesep=,' +\.'sbr:TwoValueOptions,' +\.'papersize={<++>},' +\.'total={<++>},' +\.'body={<++>},' +\.'text={<++>},' +\.'scale={<++>},' +\.'hmargin={<++>},' +\.'vmargin={<++>},' +\.'margin={<++>},' +\.'offset={<++>},' +\.'sbr:ThreeValueOptions,' +\.'hdivide={<++>},' +\.'vdivide={<++>},' +\.'divide={<++>}' + +let g:TeX_package_geometry = +\ 'bra:geometry' + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/german b/.vim/ftplugin/latex-suite/packages/german @@ -0,0 +1,12 @@ +if exists("german_package_file") + finish +endif +let german_package_file = 1 + +let g:TeX_package_german = '' +let g:TeX_package_option_german = '' +" For now just define the smart quotes. +let b:Tex_SmartQuoteOpen = '"`' +let b:Tex_SmartQuoteClose = "\"'" + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/graphicx b/.vim/ftplugin/latex-suite/packages/graphicx @@ -0,0 +1,69 @@ +if exists("graphicx_package_file") + finish +endif +let graphicx_package_file = 1 + +let g:TeX_package_option_graphicx = +\ 'sbr:Drivers,' +\.'xdvi,' +\.'dvipdf,' +\.'dvipdfm,' +\.'pdftex,' +\.'dvipsone,' +\.'dviwindo,' +\.'emtex,' +\.'dviwin,' +\.'oztex,' +\.'textures,' +\.'pctexps,' +\.'pctexwin,' +\.'pctexhp,' +\.'pctex32,' +\.'truetex,' +\.'tcidvi,' +\.'vtex,' +\.'sbr:Rest,' +\.'debugshow,' +\.'draft,' +\.'final,' +\.'hiderotate,' +\.'hiresbb,' +\.'hidescale,' +\.'unknownkeysallowed,' +\.'unknownkeyserror' + +let g:TeX_package_graphicx = +\ 'sbr:Includegraphics,' +\.'brs:includegraphics[<++>]{<++>},' +\.'spe:height=,' +\.'spe:width=,' +\.'spe:keepaspectratio=,' +\.'spe:totalheight=,' +\.'spe:angle=,' +\.'spe:scale=,' +\.'spe:origin=,' +\.'spe:clip,' +\.'spe:bb=,' +\.'spe:viewport=,' +\.'spe:trim=,' +\.'spe:draft,' +\.'spe:hiresbb,' +\.'spe:type=,' +\.'spe:ext=,' +\.'spe:read=,' +\.'spe:command=,' +\.'sbr:Rotatebox,' +\.'brs:rotatebox[<++>]{<++>}{<++>},' +\.'spe:origin=,' +\.'spe:x=,' +\.'spe:y=,' +\.'spe:units=,' +\.'sbr:Rest,' +\.'brs:scalebox{<++>}[<++>]{<++>},' +\.'brs:resizebox{<++>}{<++>}{<++>},' +\.'brs:resizebox*{<++>}{<++>}{<++>},' +\.'bra:DeclareGraphicsExtensions,' +\.'brs:DeclareGraphicsRule{<++>}{<++>}{<++>}{<++>},' +\.'bra:graphicspath' + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/graphpap b/.vim/ftplugin/latex-suite/packages/graphpap @@ -0,0 +1,10 @@ +if exists("graphpap_package_file") + finish +endif +let graphpap_package_file = 1 + +let g:TeX_package_option_graphpap = '' + +let g:TeX_package_graphpap = 'brs:graphpaper[<+step+>](<+x1,y1+>)(<+x2,y2+>)' + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/harpoon b/.vim/ftplugin/latex-suite/packages/harpoon @@ -0,0 +1,18 @@ +if exists("harpoon_package_file") + finish +endif +let harpoon_package_file = 1 + +let g:TeX_package_option_harpoon = '' + +let g:TeX_package_harpoon = +\ 'bra:overleftharp,' +\.'bra:overrightharp,' +\.'bra:overleftharpdown,' +\.'bra:overrightharpdown,' +\.'bra:underleftharp,' +\.'bra:underrightharp,' +\.'bra:underleftharpdown,' +\.'bra:underrightharpdown' + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/hhline b/.vim/ftplugin/latex-suite/packages/hhline @@ -0,0 +1,21 @@ +if exists("hhline_package_file") + finish +endif +let hhline_package_file = 1 + +let g:TeX_package_option_hhline = '' + +let g:TeX_package_hhline = +\ 'bra:hhline,' +\.'sep:a,' +\.'spe:=,' +\.'spe:-,' +\.'spe:~,' +\."spe:\\\|," +\.'spe::,' +\.'spe:#,' +\.'spe:t,' +\.'spe:b,' +\.'spe:*' + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/histogram b/.vim/ftplugin/latex-suite/packages/histogram @@ -0,0 +1,13 @@ +if exists("histogram_package_file") + finish +endif +let histogram_package_file = 1 + +let g:TeX_package_option_histogram = '' + +let g:TeX_package_histogram = +\ 'histogram,' +\.'noverticallines,' +\.'verticallines' + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/hyperref b/.vim/ftplugin/latex-suite/packages/hyperref @@ -0,0 +1,167 @@ +if exists("hyperref_package_file") + finish +endif +let hyperref_package_file = 1 + +let g:TeX_package_option_hyperref = +\ '4=,' +\.'a4paper,' +\.'a5paper,' +\.'anchorcolor=,' +\.'b5paper,' +\.'backref=,' +\.'baseurl={<++>},' +\.'bookmarks=,' +\.'bookmarksnumbered=,' +\.'bookmarksopen=,' +\.'bookmarksopenlevel=,' +\.'bookmarkstype=,' +\.'breaklinks=,' +\.'citebordercolor=,' +\.'citecolor=,' +\.'colorlinks=,' +\.'debug=,' +\.'draft,' +\.'dvipdf,' +\.'dvipdfm,' +\.'dvips,' +\.'dvipsone,' +\.'dviwindo,' +\.'executivepaper,' +\.'extension=,' +\.'filebordercolor=,' +\.'filecolor=,' +\.'frenchlinks=,' +\.'hyperfigures=,' +\.'hyperindex=,' +\.'hypertex,' +\.'hypertexnames=,' +\.'implicit=,' +\.'latex2html,' +\.'legalpaper,' +\.'letterpaper,' +\.'linkbordercolor=,' +\.'linkcolor=,' +\.'linktocpage=,' +\.'menubordercolor=,' +\.'menucolor=,' +\.'naturalnames,' +\.'nesting=,' +\.'pageanchor=,' +\.'pagebackref=,' +\.'pagebordercolor=,' +\.'pagecolor=,' +\.'pdfauthor={<++>},' +\.'pdfborder=,' +\.'pdfcenterwindow=,' +\.'pdfcreator={<++>},' +\.'pdffitwindow,' +\.'pdfhighlight=,' +\.'pdfkeywords={<++>},' +\.'pdfmenubar=,' +\.'pdfnewwindow=,' +\.'pdfpagelabels=,' +\.'pdfpagelayout=,' +\.'pdfpagemode=,' +\.'pdfpagescrop=,' +\.'pdfpagetransition=,' +\.'pdfproducer={<++>},' +\.'pdfstartpage={<++>},' +\.'pdfstartview={<++>},' +\.'pdfsubject={<++>},' +\.'pdftex,' +\.'pdftitle={<++>},' +\.'pdftoolbar=,' +\.'pdfusetitle=,' +\.'pdfview,' +\.'pdfwindowui=,' +\.'plainpages=,' +\.'ps2pdf,' +\.'raiselinks=,' +\.'runbordercolor,' +\.'tex4ht,' +\.'textures,' +\.'unicode=,' +\.'urlbordercolor=,' +\.'urlcolor=,' +\.'verbose=,' +\.'vtex' + +let g:TeX_package_hyperref = +\ 'sbr:Preamble,' +\.'bra:hypersetup,' +\.'wwwbrowser,' +\.'sbr:Links,' +\.'bra:hyperbaseurl,' +\.'brs:href{<+URL+>}{<+text+>},' +\.'bra:hyperimage,' +\.'brs:hyperdef{<+category+>}{<+name+>}{<+text+>},' +\.'brs:hyperref{<+URL+>}{<+category+>}{<+name+>}{<+text+>},' +\.'brs:hyperlink{<+name+>}{<+text+>},' +\.'brs:hypertarget{<+name+>}{<+text+>},' +\.'bra:url,' +\.'bra:htmladdnormallink,' +\.'brs:Acrobatmenu{<+option+>}{<+tekst+>},' +\.'brs:pdfbookmark[<++>]{<++>}{<++>},' +\.'bra:thispdfpagelabel,' +\.'sbr:Forms,' +\.'env:Form,' +\.'sep:Forms1,' +\.'brs:TextField[<+parameters+>]{<+label+>},' +\.'brs:CheckBox[<+parameters+>]{<+label+>},' +\.'brs:ChoiceMenu[<+parameters+>]{<+label+>}{<+choices+>},' +\.'brs:PushButton[<+parameters+>]{<+label+>},' +\.'brs:Submit[<+parameters+>]{<+label+>},' +\.'brs:Reset[<+parameters+>]{<+label+>},' +\.'sep:Forms2,' +\.'brs:LayoutTextField{<+label+>}{<+field+>},' +\.'brs:LayoutChoiceField{<+label+>}{<+field+>},' +\.'brs:LayoutCheckboxField{<+label+>}{<+field+>},' +\.'sep:Forms3,' +\.'brs:MakeRadioField{<+width+>}{<+height+>},' +\.'brs:MakeCheckField{<+width+>}{<+height+>},' +\.'brs:MakeTextField{<+width+>}{<+height+>},' +\.'brs:MakeChoiceField{<+width+>}{<+height+>},' +\.'brs:MakeButtonField{<+text+>},' +\.'sbr:Parameters,' +\.'spe:accesskey,' +\.'spe:align,' +\.'spe:backgroundcolor,' +\.'spe:bordercolor,' +\.'spe:bordersep,' +\.'spe:borderwidth,' +\.'spe:charsize,' +\.'spe:checked,' +\.'spe:color,' +\.'spe:combo,' +\.'spe:default,' +\.'spe:disabled,' +\.'spe:height,' +\.'spe:hidden,' +\.'spe:maxlen,' +\.'spe:menulength,' +\.'spe:multiline,' +\.'spe:name,' +\.'spe:onblur,' +\.'spe:onchange,' +\.'spe:onclick,' +\.'spe:ondblclick,' +\.'spe:onfocus,' +\.'spe:onkeydown,' +\.'spe:onkeypress,' +\.'spe:onkeyup,' +\.'spe:onmousedown,' +\.'spe:onmousemove,' +\.'spe:onmouseout,' +\.'spe:onmouseover,' +\.'spe:onmouseup,' +\.'spe:onselect,' +\.'spe:password,' +\.'spe:popdown,' +\.'spe:radio,' +\.'spe:readonly,' +\.'spe:tabkey,' +\.'spe:value,' +\.'spe:width' + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/ifthen b/.vim/ftplugin/latex-suite/packages/ifthen @@ -0,0 +1,21 @@ +if exists("ifthen_package_file") + finish +endif +let ifthen_package_file = 1 + +let g:TeX_package_option_ifthen = '' + +let g:TeX_package_ifthen = +\ 'brs:ifthenelse{<++>}{<++>}{<++>},' +\.'brd:equal,' +\.'bra:boolean,' +\.'bra:lengthtest,' +\.'bra:isodd,' +\.'brd:whiledo,' +\.'bra:newboolean,' +\.'brd:setboolean,' +\.'nor:and,' +\.'nor:or,' +\.'nor:not' + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/inputenc b/.vim/ftplugin/latex-suite/packages/inputenc @@ -0,0 +1,29 @@ +if exists("inputenc_package_file") + finish +endif +let inputenc_package_file = 1 + +let g:TeX_package_option_inputenc = +\ 'ascii,' +\.'latin1,' +\.'latin2,' +\.'latin3,' +\.'latin4,' +\.'latin5,' +\.'latin9,' +\.'decmulti,' +\.'cp850,' +\.'cp852,' +\.'cp437,' +\.'cp437de,' +\.'cp865,' +\.'applemac,' +\.'next,' +\.'ansinew,' +\.'cp1250,' +\.'cp1252' + +let g:TeX_package_inputenc = +\ 'bra:inputencoding' + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/letterspace b/.vim/ftplugin/latex-suite/packages/letterspace @@ -0,0 +1,10 @@ +if exists("letterspace_package_file") + finish +endif +let letterspace_package_file = 1 + +let g:TeX_package_option_letterspace = '' + +let g:TeX_package_letterspace = 'nor:letterspace' + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/lineno b/.vim/ftplugin/latex-suite/packages/lineno @@ -0,0 +1,60 @@ +if exists("lineno_package_file") + finish +endif +let lineno_package_file = 1 + +let g:TeX_package_option_lineno = +\ 'left,' +\.'right,' +\.'switch,' +\.'switch*,' +\.'pagewise,' +\.'running,' +\.'modulo,' +\.'mathlines,' +\.'displaymath,' +\.'hyperref' + +let g:TeX_package_lineno = +\ 'sbr:Environments,' +\.'env:linenumbers,' +\.'env:linenumbers*,' +\.'env:numquote,' +\.'env:numquote*,' +\.'env:numquotation,' +\.'env:numquotation*,' +\.'env:bframe,' +\.'env:linenomath,' +\.'env:linenomath*,' +\.'bra:linelabel,' +\.'sbr:Commands,' +\.'nor:linenumbers,' +\.'nor:linenumbers*,' +\.'noo:linenumbers,' +\.'nor:nolinenumbers,' +\.'nor:runninglinenumbers,' +\.'nor:runninglinenumbers*,' +\.'noo:runninglinenumbers,' +\.'nor:pagewiselinenumbers,' +\.'nor:resetlinenumber,' +\.'noo:resetlinenumber,' +\.'nor:setrunninglinenumbers,' +\.'nor:setpagewiselinenumbers,' +\.'nor:switchlinenumbers,' +\.'nor:switchlinenumbers*,' +\.'nor:leftlinenumbers,' +\.'nor:leftlinenumbers*,' +\.'nor:rightlinenumbers,' +\.'nor:rightlinenumbers*,' +\.'nor:runningpagewiselinenumbers,' +\.'nor:realpagewiselinenumbers,' +\.'nor:modulolinenumbers,' +\.'noo:modulolinenumbers,' +\.'nor:linenumberdisplaymath,' +\.'nor:nolinenumberdisplaymath,' +\.'nor:thelinenumber,' +\.'nob:linerefp,' +\.'nob:linerefr,' +\.'nob:lineref' + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/longtable b/.vim/ftplugin/latex-suite/packages/longtable @@ -0,0 +1,35 @@ +if exists("longtable_package_file") + finish +endif +let longtable_package_file = 1 + +let g:TeX_package_option_longtable = +\ 'errorshow,' +\.'pausing,' +\.'set,' +\.'final' + +let g:TeX_package_longtable = +\ 'sbr:Commands,' +\.'nor:setlongtables,' +\.'bra:LTleft,' +\.'bra:LTright,' +\.'bra:LTpre,' +\.'bra:LTpost,' +\.'bra:LTchunksize,' +\.'bra:LTcapwidth,' +\.'bra:LTcapwidth,' +\.'sbr:Longtable,' +\.'env:longtable,' +\.'sep:lt,' +\.'nor:endhead,' +\.'nor:endfirsthead,' +\.'nor:endfoot,' +\.'nor:endlastfoot,' +\.'nor:kill,' +\.'bra:caption,' +\.'nob:caption,' +\.'bra:caption*,' +\.'nor:newpage' + +" vim:ft=vim:ts=4:sw=4:noet:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/lscape b/.vim/ftplugin/latex-suite/packages/lscape @@ -0,0 +1,10 @@ +if exists("lscape_package_file") + finish +endif +let lscape_package_file = 1 + +let g:TeX_package_option_lscape = '' + +let g:TeX_package_lscape = 'env:landscape' + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/manyfoot b/.vim/ftplugin/latex-suite/packages/manyfoot @@ -0,0 +1,15 @@ +if exists("manyfoot_package_file") + finish +endif +let manyfoot_package_file = 1 + +let g:TeX_package_option_manyfoot = 'para' + +let g:TeX_package_manyfoot = +\ 'bra:newfootnote,bra:newfootnote[para],' +\.'bra:footnoteA,bra:footnoteB,' +\.'bra:FootnoteA,bra:FootnoteB,' +\.'bra:Footnotemark,bra:Footnotetext,' +\.'SplitNote' + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/moreverb b/.vim/ftplugin/latex-suite/packages/moreverb @@ -0,0 +1,28 @@ +if exists("moreverb_package_file") + finish +endif +let moreverb_package_file = 1 + +let g:TeX_package_option_moreverb = '' + +let g:TeX_package_moreverb = +\ 'ens:verbatimwrite:{<++>},' +\.'ens:verbatimtab:[<++>],' +\.'ens:listing:[<+step+>]{<+number+>},' +\.'ens:listing*:[<+step+>]{<+number+>},' +\.'env:boxedverbatim,' +\.'bra:verbatimtabsize,' +\.'bra:listingoffset,' +\.'brs:listinginput[<++>]{<++>}{<++>},' +\.'brs:verbatimtabinput[<++>]{<++>}' + +let g:Tex_completion_explorer = g:Tex_completion_explorer.'verbatimtabinput,' + +syn region texZone start="\\begin{verbatimwrite}" end="\\end{verbatimwrite}\|%stopzone\>" fold +syn region texZone start="\\begin{verbatimtab}" end="\\end{verbatimtab}\|%stopzone\>" fold +syn region texZone start="\\begin{boxedverbatim}" end="\\end{boxedverbatim}\|%stopzone\>" fold +syn region texZone start="\\begin{listing}" end="\\end{listing}\|%stopzone\>" fold +syn region texZone start="\\begin{listing*}" end="\\end{listing*}\|%stopzone\>" fold + + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/multibox b/.vim/ftplugin/latex-suite/packages/multibox @@ -0,0 +1,10 @@ +if exists("multibox_package_file") + finish +endif +let multibox_package_file = 1 + +let g:TeX_package_option_multibox = '' + +let g:TeX_package_multibox = 'multimake,multiframe' + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/multicol b/.vim/ftplugin/latex-suite/packages/multicol @@ -0,0 +1,21 @@ +if exists("multicol_package_file") + finish +endif +let multicol_package_file = 1 + +let g:TeX_package_option_multicol = '' + +let g:TeX_package_multicol = +\ 'ens:multicols:{<+cols+>}[<+text+>][<+sep+>],' +\.'columnbreak,' +\.'premulticols,' +\.'postmulticols,' +\.'multicolsep,' +\.'columnsep,' +\.'linewidth,' +\.'columnseprule,' +\.'flushcolumnt,' +\.'raggedcolumns,' +\.'unbalanced' + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/newalg b/.vim/ftplugin/latex-suite/packages/newalg @@ -0,0 +1,26 @@ +if exists("newalg_package_file") + finish +endif +let newalg_package_file = 1 + +let g:TeX_package_option_newalg = '' + +let g:TeX_package_newalg = +\ 'ens:algorithm:{<+name+>}{<++>},' +\.'ens:IF:{<+cond+>},' +\.'ens:FOR:{<+loop+>},' +\.'ens:WHILE:{<+cond+>},' +\.'bra:ERROR,' +\.'nor:ELSE,' +\.'nor:RETURN,' +\.'nor:NIL,' +\.'nor:TO,' +\.'bra:CALL,' +\.'bra:text,' +\.'env:REPEAT,' +\.'env:SWITCH,' +\.'nor:=,' +\.'bra:item,' +\.'nor:algkey' + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/ngerman b/.vim/ftplugin/latex-suite/packages/ngerman @@ -0,0 +1,12 @@ +if exists("ngerman_package_file") + finish +endif +let ngerman_package_file = 1 + +let g:TeX_package_ngerman = '' +let g:TeX_package_option_ngerman = '' +" For now just define the smart quotes. +let b:Tex_SmartQuoteOpen = '"`' +let b:Tex_SmartQuoteClose = "\"'" + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/numprint b/.vim/ftplugin/latex-suite/packages/numprint @@ -0,0 +1,18 @@ +if exists("numprint_package_file") + finish +endif +let numprint_package_file = 1 + +let g:TeX_package_option_numprint = '' + +let g:TeX_package_numprint = +\ 'bra:numprint,' +\.'nob:numprint,' +\.'bra:thousandsep,' +\.'bra:decimalsign,' +\.'bra:productsign,' +\.'bra:unitseparator,' +\.'brd:expnumprint,' +\.'global' + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/oldstyle b/.vim/ftplugin/latex-suite/packages/oldstyle @@ -0,0 +1,12 @@ +if exists("oldstyle_package_file") + finish +endif +let oldstyle_package_file = 1 + +let g:TeX_package_option_oldstyle = '' + +let g:TeX_package_oldstyle = +\ 'bra:textos,' +\.'bra:mathos' + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/outliner b/.vim/ftplugin/latex-suite/packages/outliner @@ -0,0 +1,19 @@ +if exists("outliner_package_file") + finish +endif +let outliner_package_file = 1 + +let g:TeX_package_option_outliner = '' + +let g:TeX_package_outliner = +\ 'env:Outline,' +\.'bra:Level,' +\.'bra:SetBaseLevel,' +\.'sep:preamble,' +\.'bra:OutlinePageBreaks,' +\.'bra:OutlinePageBreaks,' +\.'bra:OutlineLevelStart,' +\.'bra:OutlineLevelCont,' +\.'bra:OutlineLevelEnd' + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/overcite b/.vim/ftplugin/latex-suite/packages/overcite @@ -0,0 +1,34 @@ +if exists("overcite_package_file") + finish +endif +let overcite_package_file = 1 + +let g:TeX_package_option_overcite = +\ 'verbose,' +\.'ref,' +\.'nospace,' +\.'space,' +\.'nosort,' +\.'sort,' +\.'nomove,' +\.'noadjust' + +let g:TeX_package_overcite = +\ 'bra:cite,' +\.'bra:citen,' +\.'bra:citenum,' +\.'bra:citeonline,' +\.'bra:nocite,' +\.'sep:redefine,' +\.'bra:citeform,' +\.'bra:citepunct,' +\.'bra:citeleft,' +\.'bra:citeright,' +\.'bra:citemid,' +\.'bra:citedash' + +syn region texRefZone matchgroup=texStatement start="\\citen\([tp]\*\=\)\={" keepend end="}\|%stopzone\>" contains=texComment,texDelimiter +syn region texRefZone matchgroup=texStatement start="\\citenum\([tp]\*\=\)\={" keepend end="}\|%stopzone\>" contains=texComment,texDelimiter +syn region texRefZone matchgroup=texStatement start="\\citeonline\([tp]\*\=\)\={" keepend end="}\|%stopzone\>" contains=texComment,texDelimiter + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/pagenote b/.vim/ftplugin/latex-suite/packages/pagenote @@ -0,0 +1,26 @@ +" Pagenote package support v 0.1 2010-02-17 +" This file has been written by +" Andreas Wagner <Andreas dot Wagner at em dot uni-frankfurt dot de> +" based on the documentation of +" pagenote 27 September 2004 +" It can be used, modified and distributed according to the vim license. + + +if exists("pagenote_package_file") + finish +endif +let pagenote_package_file = 1 + +let g:TeX_package_option_pagenote = +\ 'continuous,' +\.'page' + +let g:TeX_package_pagenote = +\ 'sbr:preamble,' +\.'nor:makepagenote,' +\.'sbr:regular,' +\.'nob:pagenote[<+lemma+>]{<+note+>},' +\.'sbr:end,' +\.'nor:printnotes,' +\.'nor:printnotes*' + diff --git a/.vim/ftplugin/latex-suite/packages/parallel b/.vim/ftplugin/latex-suite/packages/parallel @@ -0,0 +1,15 @@ +if exists("parallel_package_file") + finish +endif +let parallel_package_file = 1 + +let g:TeX_package_option_parallel = '' + +let g:TeX_package_parallel = +\ 'env:Parallel,' +\.'bra:ParallelLText,' +\.'bra:ParallelRText,' +\.'nor:ParallelPar,' +\.'nor:tolerance' + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/plain b/.vim/ftplugin/latex-suite/packages/plain @@ -0,0 +1,10 @@ +if exists("plain_package_file") + finish +endif +let plain_package_file = 1 + +let g:TeX_package_option_plain = '' + +let g:TeX_package_plain = 'env:plain' + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/plates b/.vim/ftplugin/latex-suite/packages/plates @@ -0,0 +1,16 @@ +if exists("plates_package_file") + finish +endif +let plates_package_file = 1 + +let g:TeX_package_option_plates = 'figures,onefloatperpage,memoir' + +let g:TeX_package_plates = +\ 'env:plate,' +\.'listofplates,' +\.'ProcessPlates,' +\.'bra:setplatename,' +\.'bra:setplatename,' +\.'bra:atBeginPlates' + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/polski b/.vim/ftplugin/latex-suite/packages/polski @@ -0,0 +1,165 @@ +" Author: Mikolaj Machowski <mikmach@wp.pl> +" (c) Copyright by Mikolaj Machowski 2002-2003 +" License: Vim Charityware +" Version: 1.6 +" +" Plik jest w kodowaniu iso-8859-2. Je¶li chcesz go uzywac w MS-Windows musisz +" go przekonwertowac na cp-1250. +" +" Plik ten jest czê¶ci± vim-latexSuite, ale: +" Nie u¿ywaj±cy vim-latexSuite (http://vim-latex.sourceforge.net) mog± wyci±æ +" oznaczon± czê¶æ. Reszta mo¿e byæ kopiowana jako osobny plik pod warunkiem +" niezmieniania tej notki i informacji o prawach autorskich. +" +" This file is in iso-8859-2 encoding. If you want to use it in MS-Windows you +" have to convert it to cp-1250. +" +" This file is part of vim-latexSuite but: +" Those who do not use vim-latexSuite (http://vim-latex.sourceforge.net) can +" cut off marked part. Rest of the file can be copied as separate file under +" condition of leaving this notice and information about copyrights unchanged. + +if exists("acromake_package_file") + finish +endif +let acromake_package_file = 1 + +" --------8<------------- +" Czesc odpowiedzialna za menu +let g:TeX_package_option_polski = +\'OT1,OT4,T1,QX,plmath,nomathsymbols,MeX,prefixingverb,noprefixingverb' +let g:TeX_package_polski = +\'sbr:Dywiz&Ska,'. +\'nor:dywiz,'. +\'nor:ppauza,'. +\'nor:pauza,'. +\'nor:prefixing,'. +\'nor:nonprefixing,'. +\'nor:PLdateending,'. +\'sbr:Matematyka,'. +\'nor:arccos,'. +\'nor:arcctan,'. +\'nor:arcsin,'. +\'nor:arctan,'. +\'nor:cot,'. +\'nor:ctanh,'. +\'nor:tan,'. +\'nor:tanh,'. +\'bra:arc,'. +\'nor:ctg,'. +\'nor:ctgh,'. +\'nor:tg,'. +\'nor:tgh,'. +\'nor:nwd' + +" To wymaga calego pakietu vim-latexSuite - zakomentuj lub wytnij je¶li nie +" u¿ywasz (albo go ¶ci±gnij z http://vim-latex.sf.net) +function! TPackagePolskiTylda() + call IMAP (" ---", "~---", "tex") +endfunction +call TPackagePolskiTylda() +" --------8<------------- + +" Polskie znaki cudzyslowow +TexLet g:Tex_SmartQuoteOpen = ",," +TexLet g:Tex_SmartQuoteClose = "''" + +" Zmodyfikowana i rozwinieta funkcja Andrzeja Ostruszki +" Z dodatkiem od Benjiego Fishera (sprawdzanie sk³adni) +" +" Spacja +inoremap <buffer> <silent> <Space> <C-R>=<SID>Tex_polish_space()<CR> +inoremap <buffer> <silent> <CR> <C-R>=<SID>Tex_polish_space()<CR><BS><CR> + +" Wymuszenie tyldy +inoremap <buffer> <silent> <S-Space> ~ + +" Wymuszenie zwyklej spacji +inoremap <buffer> <silent> <C-Space> <Space> + +" Latwe przelaczanie sie miedzy magiczna spacja a zwykla +inoremap <buffer> <silent> <F8> <C-R>=<SID>TogglePolishSpace()<CR> + +function! s:TogglePolishSpace() + if !exists("b:polishspace") + iunmap <buffer> <Space> + iunmap <buffer> <CR> + let b:polishspace = 1 + return '' + else + inoremap <buffer> <silent> <Space> <C-R>=<SID>Tex_polish_space()<CR> + inoremap <buffer> <silent> <CR> <C-R>=<SID>Tex_polish_space()<CR><BS><CR> + unlet b:polishspace + return '' + endif +endfunction + + +function! s:Tex_polish_space() + "Nic magicznego w matematyce + if synIDattr(synID(line('.'),col('.')-1,0),"name") =~ '^texMath\|^texZone\^texRefZone' + return ' ' + else + let s:col = col('.') + let s:linelength = strlen(getline('.')) + 1 + " Wstaw tylde po spojnikach + if strpart(getline('.'), col('.') - 3, 2) =~? '^[[:space:]~(\[{]\?[aiouwz]$' + return '~' + " Wstaw tylde po inicjalach - konkretnie po pojedynczych wielkich + " literach i kropce. Obs³uguje poprawnie wiekszosc sytuacji. + elseif strpart(getline('.'), col('.') - 4, 3) =~? '^[[:space:]~(\[{]\?\u\.$' + return '~' + " Wstaw tylde po tytulach, skrotach bibliograficznych, podpisach + elseif strpart(getline('.'), col('.') - 9, 8) =~? '\(\s\|^\|\~\)\(str\.\|ryc\.\|rys\.\|tab\.\|art\.\|vol\.\|nr\|tabl\.\|rozdz\.\|ss\.\|s\.\|t\.\|z\.\|sir\|prof\.\|hab\.\|red\.\|min\.\|gen\.\|kpt\.\|przew\.\|p³k\|mjr\|mgr\|bp\|ks\.\|o\+\.\|¶w\.\|dr\)$' + return '~' + " Wstaw tylde miedzy rokiem, wiekiem, a odpowiednim skrotem + elseif strpart(getline('.'), col('.') - 8, 7) =~? '[0-9IVXLCM]\s\+\(r\|w\)\.[^a-z±æê³ñ󶿼]\{-}$' + s/[0-9IVXLCM]\zs\s\+\ze\(w\|r\)\.[^a-z±æê³ñ󶿼]\{-}\%#/\~/ei + exe 'normal '.s:col.'|' + if s:col == s:linelength + startinsert! + else + startinsert + endif + return ' ' + " Wstaw tylde miedzy liczba a miara, itd. + elseif strpart(getline('.'), col('.') - 10, 9) =~? '\(\d\|mln\|mld\|tys\.\)\s\+\(z³\|gr\|ha\|t\|mies\|godz\|min\|sek\|cm\|km\|mln\|mld\|tys\.\)[^a-z±æê³ñ󶿼]\{-}$' + s/\(\d\|mln\|mld\|tys\.\)\zs\s\+\ze\(z³\|gr\|ha\|m\|t\|mies\|godz\|min\|sek\|cm\|km\|mln\|mld\|tys\.\)[^a-z±æê³ñ󶿼]\{-}\%#/\~/ei + exe 'normal '.s:col.'|' + if s:col == s:linelength + startinsert! + else + startinsert + endif + return ' ' + " Rozwin myslnik w zbitkach w '\dywiz ': + " bialo-czerwony -> bialo\dywiz czerwony + elseif strpart(getline('.'), col('.') - 20, 19) =~? '[a-z±æê³ñ󶿼]-[a-z±æê³ñ󶿼]\{-}[^a-z±æê³ñ󶿼]\{-}$' + s/[a-z±æê³ñ󶿼]\zs-\ze[a-z±æê³ñ󶿼]\{-}[^a-z±æê³ñ󶿼]\{-}\%#/\\dywiz /ei + let colb = s:col + 6 + exe 'normal '.colb.'|' + if s:col == s:linelength + startinsert! + else + startinsert + endif + return ' ' + " Rozwin '--' miedzy liczbami w '\ppauza ': + " 39--45 -> 39\ppauza 45 + elseif strpart(getline('.'), col('.') - 10, 9) =~? '[0-9IVXLCM]--[0-9IVXLCM]\{-}[^0-9IVXLCM]\{-}$' + s/[0-9IVXLCM]\zs--\ze[0-9IVXLCM]\{-}[^0-9IVXLCM]\{-}\%#/\\ppauza /ei + let colb = s:col + 6 + exe 'normal '.colb.'|' + if s:col == s:linelength + startinsert! + else + startinsert + endif + return ' ' + endif + " Tu koncz komentowanie ostatniej sekcji + endif + return " " +endfunction + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/psgo b/.vim/ftplugin/latex-suite/packages/psgo @@ -0,0 +1,27 @@ +if exists("psgo_package_file") + finish +endif +let psgo_package_file = 1 + +let g:TeX_package_option_psgo = '' + +let g:TeX_package_psgo = +\ 'env:psgogoard,' +\.'env:psgoboard*,' +\.'brs:stone{<+color+>}{<+letter+>}{<+number+>},' +\.'brs:stone[<+marker+>]{<+color+>}{<+letter+>}{<+number+>},' +\.'brs:move{<+letter+>}{<+number+>},' +\.'brs:move*{<+letter+>}{<+number+>},' +\.'brs:goline{<+letter1+>}{<+number1+>}{<+letter2+>}{<+number2+>},' +\.'brs:goarrow{<+letter1+>}{<+number1+>}{<+letter2+>}{<+number2+>},' +\.'sbr:Markers,' +\.'brs:markpos{<+marker+>}{<+letter+>}{<+number+>},' +\.'markma,' +\.'marktr,' +\.'markcr,' +\.'marksq,' +\.'bra:marklb,' +\.'marksl,' +\.'markdd' + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/schedule b/.vim/ftplugin/latex-suite/packages/schedule @@ -0,0 +1,20 @@ +if exists("schedule_package_file") + finish +endif +let schedule_package_file = 1 + +let g:TeX_package_option_schedule = '' + +let g:TeX_package_schedule = +\ 'ens:schedule:[<+title+>],' +\.'bra:CellHeight,' +\.'bra:CellWidth,' +\.'bra:TimeRange,' +\.'bra:SubUnits,' +\.'bra:BeginOn,' +\.'bra:TextSize,' +\.'nor:FiveDay,' +\.'nor:SevenDay,' +\.'brs:NewAppointment{<+name+>}{<+bg+>}{<+fg+>}' + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/textfit b/.vim/ftplugin/latex-suite/packages/textfit @@ -0,0 +1,12 @@ +if exists("textfit_package_file") + finish +endif +let textfit_package_file = 1 + +let g:TeX_package_option_textfit = '' + +let g:TeX_package_textfit = +\ 'brd:scaletowidth,' +\.'brd:scaletoheight' + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/times b/.vim/ftplugin/latex-suite/packages/times @@ -0,0 +1,10 @@ +if exists("times_package_file") + finish +endif +let times_package_file = 1 + +let g:TeX_package_option_times = '' + +let g:TeX_package_times = '' + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/tipa b/.vim/ftplugin/latex-suite/packages/tipa @@ -0,0 +1,364 @@ +if exists("tipa_package_file") + finish +endif +let tipa_package_file = 1 + +let g:TeX_package_option_tipa = +\ 'T1,' +\.'noenc,' +\.'tone,' +\.'extra,' +\.'safe' + +let g:TeX_package_tipa = +\ 'sbr:Common,' +\.'bra:textipa,' +\.'env:IPA,' +\.'tipaencoding,' +\.'bra:super,' +\.'nor:ipabar,' +\.'brd:tipalowaraccent,' +\.'brd:tipaupperaccent,' +\.'brd:tipaLowaraccent,' +\.'brd:tipaUpperaccent,' +\.'brd:ipaclap,' +\.'sbr:VowelsandConsonants,' +\.'nor:textturna,' +\.'nor:textrhooka,' +\.'nor:textlhookfour,' +\.'nor:textscripta,' +\.'nor:textturnscripta,' +\.'nor:textinvscripta,' +\.'ae,' +\.'nor:textaolig,' +\.'nor:textsca,' +\.'nor:textinvsca,' +\.'nor:textscaolig,' +\.'nor:textturnv,' +\.'nor:textsoftsign,' +\.'nor:texthardsign,' +\.'nor:texthtb,' +\.'nor:textscb,' +\.'nor:textcrb,' +\.'nor:textbarb,' +\.'nor:textbeta,' +\.'nor:textbarc,' +\.'nor:texthtc,' +\.'bra:v,' +\.'bra:c,' +\.'nor:textctc,' +\.'nor:textstretchc,' +\.'nor:textstretchcvar,' +\.'nor:textctstretchc,' +\.'nor:textctstretchcvar,' +\.'nor:textcrd,' +\.'nor:textbard,' +\.'nor:texthtd,' +\.'nor:textrtaild,' +\.'nor:texthtrtaild,' +\.'nor:textctd,' +\.'nor:textfrhookd,' +\.'nor:textfrhookdvar,' +\.'nor:textdblig,' +\.'nor:textdzlig,' +\.'nor:textdctzlig,' +\.'nor:textdyoghlig,' +\.'nor:textctdctzlig,' +\.'nor:textscdelta,' +\.'nor:dh,' +\.'nor:textrhooke,' +\.'nor:textschwa,' +\.'nor:textrhookschwa,' +\.'nor:textreve,' +\.'nor:textsce,' +\.'nor:textepsilon,' +\.'nor:textrhookepsilon,' +\.'nor:textcloseepsilon,' +\.'nor:textrevepsilon,' +\.'nor:textrhookrevepsilon,' +\.'nor:textcloserevepsilon,' +\.'nor:textscf,' +\.'nor:textscriptg,' +\.'nor:textbarg,' +\.'nor:textcrg,' +\.'nor:texthtg,' +\.'nor:textg,' +\.'nor:textscg,' +\.'nor:texthtscg,' +\.'nor:textgamma,' +\.'nor:textgrgamma,' +\.'nor:textfrtailgamma,' +\.'nor:textbktailgamma,' +\.'nor:textbabygamma,' +\.'nor:textramshorns,' +\.'nor:texthvlig,' +\.'nor:textcrh,' +\.'nor:texthth,' +\.'nor:textrtailhth,' +\.'nor:textheng,' +\.'nor:texththeng,' +\.'nor:textturnh,' +\.'nor:textsch,' +\.'nor:i,' +\.'nor:textbari,' +\.'nor:textiota,' +\.'nor:textlhti,' +\.'nor:textlhtlongi,' +\.'nor:textvibyi,' +\.'nor:textraisevibyi,' +\.'nor:textsci,' +\.'nor:j,' +\.'nor:textctj,' +\.'nor:textctjvar,' +\.'nor:textscj,' +\.'bra:v,' +\.'nor:textbardotlessj,' +\.'nor:textObardotlessj,' +\.'nor:texthtbardotlessj,' +\.'nor:texthtbardotlessjvar,' +\.'nor:texthtk,' +\.'nor:textturnk,' +\.'nor:textsck,' +\.'nor:textturnsck,' +\.'nor:textltilde,' +\.'nor:textbarl,' +\.'nor:textbeltl,' +\.'nor:textrtaill,' +\.'nor:textlyoghlig,' +\.'nor:textOlyoghlig,' +\.'nor:textscl,' +\.'nor:textrevscl,' +\.'nor:textlambda,' +\.'nor:textcrlambda,' +\.'nor:textltailm,' +\.'nor:textturnm,' +\.'nor:textturnmrleg,' +\.'nor:texthmlig,' +\.'nor:textscm,' +\.'nor:textnrleg,' +\.'~,' +\.'nor:textltailn,' +\.'nor:textfrbarn,' +\.'nor:ng,' +\.'nor:textrtailn,' +\.'nor:textctn,' +\.'nor:textnrleg,' +\.'nor:textscn,' +\.'nor:textbullseye,' +\.'nor:textObullseye,' +\.'nor:textbaro,' +\.'nor:o,' +\.'nor:textfemale,' +\.'nor:textuncrfemale,' +\.'nor:oe,' +\.'nor:textscoelig,' +\.'nor:textopeno,' +\.'nor:textrhookopeno,' +\.'nor:textturncelig,' +\.'nor:textomega,' +\.'nor:textinvomega,' +\.'nor:textscomega,' +\.'nor:textcloseomega,' +\.'nor:textlhookp,' +\.'nor:textscp,' +\.'nor:textwynn,' +\.'nor:textthorn,' +\.'nor:textthornvari,' +\.'nor:textthornvarii,' +\.'nor:textthornvariii,' +\.'nor:textthornvariv,' +\.'nor:texthtp,' +\.'nor:textphi,' +\.'nor:texthtq,' +\.'nor:textqplig,' +\.'nor:textscq,' +\.'nor:textfishhookr,' +\.'nor:textlonglegr,' +\.'nor:textrtailr,' +\.'nor:textturnr,' +\.'nor:textturnrrtail,' +\.'nor:textturnlonglegr,' +\.'nor:textscr,' +\.'nor:textinvscr,' +\.'nor:textrevscr,' +\.'bra:v,' +\.'nor:textrtails,' +\.'nor:textesh,' +\.'nor:textdoublebaresh,' +\.'nor:textctesh,' +\.'nor:textlooptoprevesh,' +\.'nor:texthtt,' +\.'nor:textlhookt,' +\.'nor:textrtailt,' +\.'nor:textfrhookt,' +\.'nor:textctturnt,' +\.'nor:texttctclig,' +\.'nor:texttslig,' +\.'nor:textteshlig,' +\.'nor:textturnt,' +\.'nor:textctt,' +\.'nor:textcttctclig,' +\.'nor:texttheta,' +\.'nor:textbaru,' +\.'nor:textupsilon,' +\.'nor:textscu,' +\.'nor:textturnscu,' +\.'nor:textscriptv,' +\.'nor:textturnw,' +\.'nor:textchi,' +\.'nor:textturny,' +\.'nor:textscy,' +\.'nor:textlhtlongy,' +\.'nor:textvibyy,' +\.'nor:textcommatailz,' +\.'bra:v,' +\.'nor:textctz,' +\.'nor:textrtailz,' +\.'nor:textcrtwo,' +\.'nor:textturntwo,' +\.'nor:textyogh,' +\.'nor:textbenttailyogh,' +\.'nor:textrevyogh,' +\.'nor:textctyogh,' +\.'nor:textturnthree,' +\.'nor:textglotstop,' +\.'nor:textraiseglotstop,' +\.'nor:textbarglotstop,' +\.'nor:textinvglotstop,' +\.'nor:textcrinvglotstop,' +\.'nor:textctinvglotstop,' +\.'nor:textrevglotstop,' +\.'nor:textturnglotstop,' +\.'nor:textbarrevglotstop,' +\.'nor:textpipe,' +\.'nor:textpipevar,' +\.'nor:textdoublebarpipe,' +\.'nor:textdoublebarpipevar,' +\.'nor:textdoublepipevar,' +\.'nor:textdoublepipe,' +\.'nor:textdoublebarslash,' +\.'sbr:Suprasegmentals,' +\.'nor:textprimstress,' +\.'nor:textsecstress,' +\.'nor:textlengthmark,' +\.'nor:texthalflength,' +\.'nor:textvertline,' +\.'nor:textdoublevertline,' +\.'bra:textbottomtiebar,' +\.'nor:textdownstep,' +\.'nor:textupstep,' +\.'nor:textglobfall,' +\.'nor:textglobrise,' +\.'nor:textspleftarrow,' +\.'nor:textdownfullarrow,' +\.'nor:textupfullarrow,' +\.'nor:textsubrightarrow,' +\.'nor:textsubdoublearrow,' +\.'sbr:AccentsandDiacritics,' +\.'`,' +\."'," +\.'^,' +\.'~,' +\.'",' +\.'bra:H,' +\.'bra:r,' +\.'bra:v,' +\.'bra:u,' +\.'=,' +\.'.,' +\.'bra:c,' +\.'bra:textpolhook,' +\.'nor:textrevpolhook{o,' +\.'bra:textdoublegrave,' +\.'bra:textsubgrave,' +\.'bra:textsubacute,' +\.'bra:textsubcircum,' +\.'bra:textroundcap,' +\.'bra:textacutemacron,' +\.'bra:textgravemacron,' +\.'bra:textvbaraccent,' +\.'bra:textdoublevbaraccent,' +\.'bra:textgravedot,' +\.'bra:textdotacute,' +\.'bra:textcircumdot,' +\.'bra:texttildedot,' +\.'bra:textbrevemacron,' +\.'bra:textringmacron,' +\.'bra:textacutewedge,' +\.'bra:textdotbreve,' +\.'bra:textsubbridge,' +\.'bra:textinvsubbridge,' +\.'sbr:SubscriptSquare,' +\.'bra:textsubrhalfring,' +\.'bra:textsublhalfring,' +\.'bra:textsubw,' +\.'bra:textoverw,' +\.'bra:textseagull,' +\.'bra:textovercross,' +\.'bra:textsubplus,' +\.'bra:textraising,' +\.'bra:textlowering,' +\.'bra:textadvancing,' +\.'bra:textretracting,' +\.'bra:textsubtilde,' +\.'bra:textsubumlaut,' +\.'bra:textsubring,' +\.'bra:textsubwedge,' +\.'bra:textsubbar,' +\.'bra:textsubdot,' +\.'bra:textsubarch,' +\.'bra:textsyllabic,' +\.'bra:textsuperimposetilde,' +\.'nor:textcorner,' +\.'nor:textopencorner,' +\.'nor:textrhoticity,' +\.'nor:textceltpal,' +\.'nor:textlptr,' +\.'nor:textrptr,' +\.'nor:textrectangle,' +\.'nor:textretractingvar,' +\.'bra:texttoptiebar,' +\.'nor:textrevapostrophe,' +\.'nor:texthooktop,' +\.'nor:textrthook,' +\.'nor:textrthooklong,' +\.'nor:textpalhook,' +\.'nor:textpalhooklong,' +\.'nor:textpalhookvar,' +\.'bra:textsuperscript,' +\.'sbr:ToneLetters,' +\.'bra:tone,' +\.'bra:stone,' +\.'bra:rtone,' +\.'nor:tone{55},' +\.'nor:tone{44},' +\.'nor:tone{33},' +\.'nor:tone{22},' +\.'nor:tone{11},' +\.'nor:tone{51},' +\.'nor:tone{15},' +\.'nor:tone{45},' +\.'nor:tone{12},' +\.'nor:tone{454},' +\.'sbr:DiacriticsExtIPA,' +\.'bra:spreadlips,' +\.'bra:overbridge,' +\.'bra:bibridge,' +\.'bra:subdoublebar,' +\.'bra:subdoublevert,' +\.'bra:subcorner,' +\.'bra:whistle,' +\.'bra:sliding,' +\.'bra:crtilde,' +\.'bra:dottedtilde,' +\.'bra:doubletilde,' +\.'bra:partvoiceless,' +\.'bra:inipartvoiceless,' +\.'bra:finpartvoiceless,' +\.'bra:partvoice,' +\.'bra:inipartvoice,' +\.'bra:finpartvoice,' +\.'bra:sublptr,' +\.'bra:subrptr' + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/ulem b/.vim/ftplugin/latex-suite/packages/ulem @@ -0,0 +1,21 @@ +if exists("ulem_package_file") + finish +endif +let ulem_package_file = 1 + +let g:TeX_package_option_ulem = +\ 'normalem,' +\.'ULforem,' +\.'normalbf,' +\.'UWforbf' + +let g:TeX_package_ulem = +\ 'bra:uwave,' +\.'bra:uline,' +\.'bra:uuline,' +\.'bra:sout,' +\.'bra:xout,' +\.'ULthickness,' +\.'ULdepth' + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/url b/.vim/ftplugin/latex-suite/packages/url @@ -0,0 +1,24 @@ +if exists("url_package_file") + finish +endif +let url_package_file = 1 + +let g:TeX_package_option_url = +\ 'hyphens,' +\.'obeyspaces,' +\.'spaces,' +\.'T1' + +let g:TeX_package_url = +\ 'bra:urlstyle,' +\.'bra:url,' +\.'bra:path,' +\.'bra:urldef' + +" TODO uncomment if you figure out +" 1. how to get this syn command to work every time instead of only the +" first time this file is sourced. +" syn region texZone start="\\url{" end="}\|%stopzone\>" +" syn region texZone start="\\path{" end="}\|%stopzone\>" + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/verbatim b/.vim/ftplugin/latex-suite/packages/verbatim @@ -0,0 +1,18 @@ +if exists("verbatim_package_file") + finish +endif +let verbatim_package_file = 1 + +let g:TeX_package_option_verbatim = '' + +let g:TeX_package_verbatim = +\ 'env:comment,' +\.'env:verbatim,' +\.'env:verbatim*,' +\.'bra:verbatiminput,' +\.'bra:verbatiminput' + +syn region texZone start="\\begin{comment}" end="\\end{comment}\|%stopzone\>" fold +syn region texZone start="\\begin{verbatim}" end="\\end{verbatim}\|%stopzone\>" fold + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/packages/version b/.vim/ftplugin/latex-suite/packages/version @@ -0,0 +1,12 @@ +if exists("version_package_file") + finish +endif +let version_package_file = 1 + +let g:TeX_package_option_version = '' + +let g:TeX_package_version = +\ 'bra:includeversion,' +\.'bra:excludeversion' + +" vim:ft=vim:ff=unix: diff --git a/.vim/ftplugin/latex-suite/projecttemplate.vim b/.vim/ftplugin/latex-suite/projecttemplate.vim @@ -0,0 +1,11 @@ +" Project name +" let g:projName = '' +" +" Project files +" let g:projFiles = '' + + +" Vim settings/maps/abbrs specific for this project + +" Modeline for this file +" vim:fdm=marker:ff=unix:noet:ts=4:sw=4:ft=vim diff --git a/.vim/ftplugin/latex-suite/pytools.py b/.vim/ftplugin/latex-suite/pytools.py @@ -0,0 +1,52 @@ +import string, vim, re, os, glob +# catFile: assigns a local variable retval to the contents of a file {{{ +def catFile(filename): + try: + file = open(filename) + lines = ''.join(file.readlines()) + file.close() + except: + lines = '' + + # escape double quotes and backslashes before quoting the string so + # everything passes throught. + vim.command("""let retval = "%s" """ % re.sub(r'"|\\', r'\\\g<0>', lines)) + return lines + +# }}} +# isPresentInFile: check if regexp is present in the file {{{ +def isPresentInFile(regexp, filename): + try: + fp = open(filename) + fcontents = string.join(fp.readlines(), '') + fp.close() + if re.search(regexp, fcontents): + vim.command('let retval = 1') + return 1 + else: + vim.command('let retval = 0') + return None + except: + vim.command('let retval = 0') + return None + +# }}} +# deleteFile: deletes a file if present {{{ +# If the file does not exist, check if its a filepattern rather than a +# filename. If its a pattern, then deletes all files matching the +# pattern. +def deleteFile(filepattern): + if os.path.exists(filepattern): + try: + os.remove(filepattern) + except: + vim.command('let retval = -1') + else: + if glob.glob(filepattern): + for filename in glob.glob(filepattern): + os.remove(filename) + else: + vim.command('let retval = -1') + +# }}} +# vim:fdm=marker:ff=unix:noet:ts=4:sw=4:nowrap diff --git a/.vim/ftplugin/latex-suite/smartspace.vim b/.vim/ftplugin/latex-suite/smartspace.vim @@ -0,0 +1,102 @@ +"============================================================================= +" File: smartspace.vim +" Author: Carl Muller +" Created: Fri Dec 06 12:00 AM 2002 PST +" +" Description: +" Maps the <space> key in insert mode so that mathematical formulaes are +" always kept on the same line. i.e, $$'s dont get broken across multiple +" lines. +"============================================================================= + +" Avoid reinclusion or if the user doesn't want us. +if exists('b:done_smartspace') + \ || (exists('g:Tex_SmartKeySpace') && !g:Tex_SmartKeySpace) + finish +endif +let b:done_smartspace = 1 + +" Smart space relies on taking over vim's insertion of carriage returns in +" order to keep $$'s on the same line. The only way to get vim not to break +" lines is to set tw=0. +" +" NOTE: setting tw != 0 will break smartspace +" the user's 'tw' setting is still respected in the insert mode. +" However, normal mode actions which rely on 'tw' such as gqap will be +" broken because of the faulty 'tw' setting. +let b:tw = &l:tw +setlocal tw=0 + +inoremap <buffer> <silent> <Space> <Space><Esc>:call <SID>TexFill(b:tw)<CR>a + +" Do not redefine the function. +if exists('*s:TexFill') + finish +endif + +" TexFormatLine: format line retaining $$'s on the same line. {{{ +function! s:TexFill(width) + if a:width != 0 && col(".") > a:width + " For future use, record the current line and the number of the current column + let current_line = getline(".") + let current_column = col(".") + exe "normal! a##\<Esc>" + call <SID>TexFormatLine(a:width,current_line,current_column) + exe "normal! ?##\<CR>2s\<Esc>" + " Remove ## from the search history. + call histdel("/", -1)|let @/=histget("/", -1) + endif +endfunction + +" }}} +function! s:TexFormatLine(width, current_line, current_column) " {{{ + " get the first non-blank character. + let first = matchstr(getline('.'), '\S') + normal! $ + let length = col('.') + let go = 1 + while length > a:width+2 && go + let between = 0 + let string = strpart(getline('.'), 0, a:width) + " Count the dollar signs + let number_of_dollars = 0 + let evendollars = 1 + let counter = 0 + while counter <= a:width-1 + " Pay attention to '$$'. + if string[counter] == '$' && string[counter-1] != '$' + let evendollars = 1 - evendollars + let number_of_dollars = number_of_dollars + 1 + endif + let counter = counter + 1 + endwhile + " Get ready to split the line. + exe 'normal! ' . (a:width + 1) . '|' + if evendollars + " Then you are not between dollars. + exe "normal! ?\\$\\+\\| \<CR>W" + else + " Then you are between dollars. + normal! F$ + if col(".") == 1 || getline('.')[col(".")-1] != "$" + let go = 0 + endif + endif + if first == '$' && number_of_dollars == 1 + let go = 0 + else + exe "normal! i\<CR>\<Esc>$" + " get the first non-blank character. + let first = matchstr(getline('.'), '\S') + endif + let length = col(".") + endwhile + if go == 0 && strpart(a:current_line, 0, a:current_column) =~ '.*\$.*\$.*' + exe "normal! ^f$a\<CR>\<Esc>" + call <SID>TexFormatLine(a:width, a:current_line, a:current_column) + endif +endfunction + +" }}} + +" vim:fdm=marker:ts=4:sw=4:noet diff --git a/.vim/ftplugin/latex-suite/templates.vim b/.vim/ftplugin/latex-suite/templates.vim @@ -0,0 +1,149 @@ +"============================================================================= +" File: templates.vim +" Author: Gergely Kontra +" (minor modifications by Srinath Avadhanula) +" (plus other modifications by Mikolaj Machowski) +" Version: 1.0 +" Created: Tue Apr 23 05:00 PM 2002 PST +" CVS: $Id: templates.vim 1065 2009-08-16 19:39:23Z tmaas $ +" +" Description: functions for handling templates in latex-suite/templates +" directory. +"============================================================================= + +let s:path = fnameescape(expand("<sfile>:p:h")) + +" SetTemplateMenu: sets up the menu for templates {{{ +function! <SID>SetTemplateMenu() + let flist = Tex_FindInRtp('', 'templates') + let i = 1 + while 1 + let fname = Tex_Strntok(flist, ',', i) + if fname == '' + break + endif + exe "amenu ".g:Tex_TemplatesMenuLocation."&".i.":<Tab>".fname." ". + \":call <SID>ReadTemplate('".fname."')<CR>" + let i = i + 1 + endwhile +endfunction + +if g:Tex_Menus + call <SID>SetTemplateMenu() +endif + +" }}} +" ReadTemplate: reads in the template file from the template directory. {{{ +function! <SID>ReadTemplate(...) + if a:0 > 0 + let filename = a:1 + else + let filelist = Tex_FindInRtp('', 'templates') + let filename = + \ Tex_ChooseFromPrompt("Choose a template file:\n" . + \ Tex_CreatePrompt(filelist, 2, ',') . + \ "\nEnter number or name of file :", + \ filelist, ',') + endif + + let fname = Tex_FindInRtp(filename.'.tex', 'templates', ':p') + call Tex_Debug("0read ".fname, 'templates') + + silent! exe "0read ".fname + + " The first line of the file contains the specifications of what the + " placeholder characters and the other special characters are. + let pattern = '\v(\S+)\t(\S+)\t(\S+)\t(\S+)' + + let s:phsTemp = substitute(getline(1), pattern, '\1', '') + let s:pheTemp = substitute(getline(1), pattern, '\2', '') + let s:exeTemp = substitute(getline(1), pattern, '\3', '') + let s:comTemp = substitute(getline(1), pattern, '\4', '') + + 0 d_ + + call s:ProcessTemplate() + call Tex_pack_updateall(1) + + " Do not handle the placeholders here. Let IMAP_PutTextWithMovement do it + " because it handles UTF-8 character substitutions etc. Therefore delete + " the text into @a and paste it using IMAP_PutTextWithMovement(). + let _a = @a + normal! ggVG"ax + + let _fo = &fo + " Since IMAP_PutTextWithMovement simulates the key-presses, leading + " indendatation can get duplicated in strange ways if ``fo`` is non-empty. + " NOTE: the indentexpr thingie is still respected with an empty fo so that + " environments etc are properly indented. + set fo= + + call Tex_Debug("normal! i\<C-r>=IMAP_PutTextWithMovement(@a, '".s:phsTemp."', '".s:pheTemp."')\<CR>", 'templates') + exec "normal! i\<C-r>=IMAP_PutTextWithMovement(@a, '".s:phsTemp."', '".s:pheTemp."')\<CR>" + + let &fo = _fo + let @a = _a + + call Tex_Debug('phs = '.s:phsTemp.', phe = '.s:pheTemp.', exe = '.s:exeTemp.', com = '.s:comTemp, 'templates') + +endfunction + +" }}} +" ProcessTemplate: processes the special characters in template file. {{{ +" This implementation follows from Gergely Kontra's +" mu-template.vim +" http://vim.sourceforge.net/scripts/script.php?script_id=222 +function! <SID>ProcessTemplate() + if exists('s:phsTemp') && s:phsTemp != '' + + exec 'silent! %s/^'.s:comTemp.'\(\_.\{-}\)'.s:comTemp.'$/\=<SID>Compute(submatch(1))/ge' + exec 'silent! %s/'.s:exeTemp.'\(.\{-}\)'.s:exeTemp.'/\=<SID>Exec(submatch(1))/ge' + exec 'silent! g/'.s:comTemp.s:comTemp.'/d' + + " A function only puts one item into the search history... + call Tex_CleanSearchHistory() + endif +endfunction + +function! <SID>Exec(what) + exec 'return '.a:what +endfunction + +" Back-Door to trojans !!! +function! <SID>Compute(what) + exe a:what + if exists('s:comTemp') + return s:comTemp.s:comTemp + else + return '' + endif +endfunction + +" }}} +" Command definitions {{{ +if v:version >= 602 + com! -complete=custom,Tex_CompleteTemplateName -nargs=? TTemplate :call <SID>ReadTemplate(<f-args>) + \| :startinsert + + " Tex_CompleteTemplateName: for completing names in TTemplate command {{{ + " Description: get list of template names with Tex_FindInRtp(), remove full path + " and return list of names separated with newlines. + " + function! Tex_CompleteTemplateName(A,P,L) + " Get name of macros from all runtimepath directories + let tmplnames = Tex_FindInRtp('', 'templates') + " Separate names with \n not , + let tmplnames = substitute(tmplnames,',','\n','g') + return tmplnames + endfunction + " }}} + +else + com! -nargs=? TTemplate :call <SID>ReadTemplate(<f-args>) + \| :startinsert + +endif + +" }}} + +" vim:fdm=marker:ff=unix:noet:ts=4:sw=4 diff --git a/.vim/ftplugin/latex-suite/templates/IEEEtran.tex b/.vim/ftplugin/latex-suite/templates/IEEEtran.tex @@ -0,0 +1,142 @@ +<+ +> !comp! !exe! +%% Based on <bare_jrnl.tex> in the ieee package available from CTAN, +%% I have changed the options so that most useful ones are clubbed together, +%% Have a look at <bare_jrnl.tex> to understand the function of each package. + +%% This code is offered as-is - no warranty - user assumes all risk. +%% Free to use, distribute and modify. + +% *** Authors should verify (and, if needed, correct) their LaTeX system *** +% *** with the testflow diagnostic prior to trusting their LaTeX platform *** +% *** with production work. IEEE's font choices can trigger bugs that do *** +% *** not appear when using other class files. *** +% Testflow can be obtained at: +% http://www.ctan.org/tex-archive/macros/latex/contrib/supported/IEEEtran/testflow + +% File: !comp!expand("%:p:t")!comp! +% Created: !comp!strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')!comp! +% Last Change: !comp!strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')!comp! +% +\documentclass[journal]{IEEEtran} + +\usepackage{cite, graphicx, subfigure, amsmath} +\interdisplaylinepenalty=2500 + +% *** Do not adjust lengths that control margins, column widths, etc. *** +% *** Do not use packages that alter fonts (such as pslatex). *** +% There should be no need to do such things with IEEEtran.cls V1.6 and later. + +<++> +% correct bad hyphenation here +\hyphenation{<+op-tical net-works semi-conduc-tor+>} + + +\begin{document} +% +% paper title +\title{<+Skeleton of IEEEtran.cls for Journals in VIM-Latex+>} +% +% +% author names and IEEE memberships +% note positions of commas and nonbreaking spaces ( ~ ) LaTeX will not break +% a structure at a ~ so this keeps an author's name from being broken across +% two lines. +% use \thanks{} to gain access to the first footnote area +% a separate \thanks must be used for each paragraph as LaTeX2e's \thanks +% was not built to handle multiple paragraphs +\author{<+Sumit Bhardwaj+>~\IEEEmembership{<+Student~Member,~IEEE,+>} +<+John~Doe+>,~\IEEEmembership{<+Fellow,~OSA,+>} +<+and~Jane~Doe,+>~\IEEEmembership{<+Life~Fellow,~IEEE+>}}% <-this % stops a space +\thanks{<+Manuscript received January 20, 2002; revised August 13, 2002. +This work was supported by the IEEE.+>}% <-this % stops a space +\thanks{<+S. Bhardwaj is with the Indian Institute of Technology, Delhi.+>} +% +% The paper headers +\markboth{<+Journal of VIM-\LaTeX\ Class Files,~Vol.~1, No.~8,~August~2002+>}{ +<+Bhardwaj \MakeLowercase{\textit{et al.}+>}: <+Skeleton of IEEEtran.cls for Journals in VIM-Latex+>} +% The only time the second header will appear is for the odd numbered pages +% after the title page when using the twoside option. + + +% If you want to put a publisher's ID mark on the page +% (can leave text blank if you just want to see how the +% text height on the first page will be reduced by IEEE) +%\pubid{0000--0000/00\$00.00~\copyright~2002 IEEE} + +% use only for invited papers +%\specialpapernotice{(Invited Paper)} + +% make the title area +\maketitle + + +\begin{abstract} +<+The abstract goes here.+> +\end{abstract} + +\begin{keywords} +<+IEEEtran, journal, \LaTeX, paper, template, VIM, VIM-\LaTeX+>. +\end{keywords} + +\section{Introduction} +\PARstart{<+T+>}{<+his+>} <+demo file is intended to serve as a ``starter file" +for IEEE journal papers produced under \LaTeX\ using IEEEtran.cls version +1.6 and later.+> +% You must have at least 2 lines in the paragraph with the drop letter +% (should never be an issue) +<+May all your publication endeavors be successful.+> + +% needed in second column of first page if using \pubid +%\pubidadjcol + +% trigger a \newpage just before the given reference +% number - used to balance the columns on the last page +% adjust value as needed - may need to be readjusted if +% the document is modified later +%\IEEEtriggeratref{8} +% The "triggered" command can be changed if desired: +%\IEEEtriggercmd{\enlargethispage{-5in}} + +% references section + +%\bibliographystyle{IEEEtran.bst} +%\bibliography{IEEEabrv,../bib/paper} +\begin{thebibliography}{1} + +\bibitem{IEEEhowto:kopka} +H.~Kopka and P.~W. Daly, \emph{A Guide to {\LaTeX}}, 3rd~ed.\hskip 1em plus +0.5em minus 0.4em\relax Harlow, England: Addison-Wesley, 1999. + +\end{thebibliography} + +% biography section +% +\begin{biography}{Sumit Bhardwaj} +Biography text here. +\end{biography} + +% if you will not have a photo +\begin{biographynophoto}{John Doe} +Biography text here. +\end{biographynophoto} + +% insert where needed to balance the two columns on the last page +%\newpage + +\begin{biographynophoto}{Jane Doe} +Biography text here. +\end{biographynophoto} + +% You can push biographies down or up by placing +% a \vfill before or after them. The appropriate +% use of \vfill depends on what kind of text is +% on the last page and whether or not the columns +% are being equalized. + +%\vfill + +% Can be used to pull up biographies so that the bottom of the last one +% is flush with the other column. +%\enlargethispage{-5in} + +\end{document} diff --git a/.vim/ftplugin/latex-suite/templates/article.tex b/.vim/ftplugin/latex-suite/templates/article.tex @@ -0,0 +1,99 @@ +<+ +> !comp! !exe! +% File: !comp!expand("%:p:t")!comp! +% Created: !comp!strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')!comp! +% Last Change: !comp!strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')!comp! +% + +%% Document class selection. Uncomment only one. +\documentclass[10pt,a4paper,twoside]{article} +%\documentclass[10pt,a4paper]{article} +%\documentclass[10pt,a4paper,twocolumn]{article} +%\documentclass[10pt,a4paper,twoside,twocolumn]{article} + +%% Language, fonts and encoding +\usepackage[english]{babel} +\usepackage[latin1]{inputenc} +\usepackage[T1]{fontenc} +%\usepackage[light,math]{iwona} % Font w/o serifs +\usepackage[final]{microtype} + +%% Layout +%\usepackage{multicols} % n columns with \begin{multicols}{<n>} ... \end{multicols} +%\setlength{\columnsep}{5pc} +%\usepackage{fullpage} % 1 inch margins + +%% Graphics +\ifx\pdftexversion\undefined +\usepackage[dvips]{graphicx} +\else +\usepackage[pdftex]{graphicx} +\fi +\graphicspath{./\jobname-graphics/} +\setkeys{Gin}{width=0.8\textwidth} % Default includegraphics width +%\usepackage{subfig} +\usepackage[small,bf]{caption} % Caption text style +%\usepackage{tikz} % Drawing library +%\usetikzlibrary{shapes,snakes} % Common drawing shapes +%\usepackage{pgffor} % Enable \foreach in TikZ + +%% Links, colors, citations +\usepackage{color} +\definecolor{AUblue}{rgb}{0.0, 0.3, 0.5} +\usepackage[colorlinks=true,linkcolor=red,citecolor=AUblue]{hyperref} +\usepackage[round]{natbib} % Quote with \citet{<key>} and \citep{<key>} +%\usepackage{igsnatbib} +%\usepackage{showkeys} % Show labels in pdf + +%% Mathematics, scientific and chemical notation +\usepackage{amssymb,amsmath,amsfonts} +%\usepackage{mathtools} +\newcommand\pdiff[3][\partial]{\frac{#1 #2}{#1 #3}} % Partial derivatives by e.g. \pdiff{f}{x} or \pdiff[d]{f}{x} +\usepackage{booktabs} % \toprule, \midrule and \bottomrule in tabular +\usepackage[detect-all]{siunitx} +%\usepackage[version=3]{mhchem} + +%% Code typesetting +%\usepackage{listings} + +%% Glossary +% Uncomment all three. Reference item with \gls{<key>} +%\usepackage[xindy,acronym,toc]{glossaries} +%\makeglossaries +%\input{/Users/anders/Documents/University/Glossary.tex} + +%% Index +% Uncomment both. Add item to index with \index{...} +%\usepackage{makeidx} +%\makeindex + +\title{<++>} +\author{Anders Damsgaard Christensen\\[2mm] +\url{anders.damsgaard@au.dk}, \url{http://cs.au.dk/~adc}} +\date{Last revision: \today} +%\abstract{...} + +% Change abstract title +%\addto\captionsenglish{\renewcommand*\abstractname{About this compendium}} + +\begin{document} +\pagestyle{empty} +\maketitle +\tableofcontents +\newpage + + +<++> + + +%% Bibliography +\newpage +\addcontentsline{toc}{section}{References} +\label{sec:References} +\bibliography{/Users/anders/Documents/University/BIB} +%\bibliographystyle{plainnat} +\bibliographystyle{igs} + +%\appendix +%\include{./\jobname-appendix.tex} + +\end{document} diff --git a/.vim/ftplugin/latex-suite/templates/beamer_pres.tex b/.vim/ftplugin/latex-suite/templates/beamer_pres.tex @@ -0,0 +1,202 @@ +<+ +> !comp! !exe! +% File: !comp!expand("%:p:t")!comp! +% Created: !comp!strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')!comp! +% Last Change: !comp!strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')!comp! +% + +%% Beamer document class +\documentclass[10pt]{beamer} +% Available font size options: +% 8pt, 9pt, 10pt, 11pt (default), 12pt, 14pt, 17pt, 20pt + +% Make printable version: +%\usepackage{beamerarticle} + +%% Language, fonts and encoding +\usepackage[english]{babel} +\usepackage[latin1]{inputenc} +\usepackage[T1]{fontenc} +%\usepackage[light,math]{iwona} % Font w/o serifs +\usepackage[final]{microtype} +\usepackage{lmodern} + +%% Links, colors, citations +\usepackage{hyperref} +%\usepackage{showkeys} % Show labels in pdf + +%% Graphics +\graphicspath{{./\jobname-graphics/}} +%\usepackage{subfig} +\usepackage[scriptsize]{caption} % Caption text style + +%% Layout +%\usepackage{multicols} % n columns with \begin{multicols}{<n>} ... \end{multicols} +%\setlength{\columnsep}{5pc} + +%% Beamer specific layout +%\usepackage{beamerthemesplit} %Activate for custom appearance +\usetheme{Berkeley} +\usecolortheme{beetle} % Complete Color Theme +%\usecolortheme{orchid} % Inner color theme +%\usecolortheme{whale} % Outer Color Theme +\xdefinecolor{AUblue}{rgb}{0.0,0.3,0.5} +\setbeamercolor{sidebar}{bg=AUblue} +\setbeamercolor{frametitle}{bg=AUblue} +\setbeamercolor{logo}{bg=AUblue!80!black} +\setbeamercolor{normal text}{bg=white!20} +\setbeamercolor{section in toc}{fg=AUblue} +\setbeamercolor{title}{fg=red!50!black} +\setbeamerfont{caption name}{size=\scriptsize} +\setbeamercolor{caption name}{fg=AUblue} +\setbeamercolor{bibliography item}{fg=black} +\setbeamercolor{bibliography entry author}{fg=blue} +%\setbeamercolor{bibliography entry title}{fg=red} +%\setbeamercolor{bibliography entry journal}{fg=black} +%\setbeamercolor{bibliography entry note}{fg=blue} +\setbeamercolor{itemize item}{fg=AUblue} +\setbeamercolor{enumerate item}{fg=AUblue} +\setbeamercolor{description item}{fg=AUblue,bg=black} +\setbeamercolor{framesubtitle}{fg=white!80!black} +\setbeamerfont{footnote}{size=\tiny,family=\rmfamily} +\usecolortheme{sidebartab} % Topic highlight in sidebar +\newcommand{\lastSlide}{\pageref{f:lastSlide}} +\setbeamertemplate{navigation symbols}{} %Disable navigation symbols +%\setbeamertemplate{footline}{\hfill\insertframenumber/\inserttotalframenumber\strut\quad} +\setbeamertemplate{footline}{\hyperlinkappendixstart{$\rightarrow$Appendix} \hfill\insertframenumber/\lastSlide ~ \strut\quad} +\renewcommand{\thefootnote}{\arabic{footnote}} + +%\usefonttheme{serif} % Serif fonts + + +%% Graphics - Beamer aut. loads graphicx +\graphicspath{./\jobname-graphics/} +%\usepackage{subfig} +%\usepackage[small,bf]{caption} % Caption text style + + +%% Mathematics, scientific and chemical notation +\usepackage{amssymb,amsmath,amsfonts} +%\usepackage{mathtools} +\newcommand\pdiff[3][\partial]{\frac{#1 #2}{#1 #3}} % Partial derivatives by e.g. \pdiff{f}{x} or \pdiff[d]{f}{x} +\usepackage{booktabs} % \toprule, \midrule and \bottomrule in tabular +\usepackage[detect-all]{siunitx} +%\usepackage[version=3]{mhchem} + +%% Code typesetting +%\usepackage{listings} + +%% Glossary +% Uncomment all three. Reference item with \gls{<key>} +%\usepackage[xindy,acronym,toc]{glossaries} +%\makeglossaries +%\input{/Users/anders/Documents/University/Glossary.tex} + +%% Index +% Uncomment both. Add item to index with \index{...} +%\usepackage{makeidx} +%\makeindex + +\title{<++>} +\subtitle{<++>} +\author[A.D. Christensen]{Anders Damsgaard Christensen\\[2mm] +{\small \url{anders.damsgaard@au.dk}, \url{http://cs.au.dk/~adc}}} +\institute[GI, AU]{Dept. of Earth Sciences, Aarhus University} +\date{\small Last revision: \today} +%\logo{\includegraphics[width=30px]{au-logo}} + + +\begin{document} +{ +%\usebackgroundtemplate{\includegraphics[height=\paperheight]{background-image.jpg}} +\begin{frame} +\begin{center} +\titlepage +\end{center} +\end{frame} +} + +{ +%\usebackgroundtemplate{\includegraphics[height=\paperheight]{content-image.jpg}} +\section[Outline]{} +\setcounter{tocdepth}{2} +\begin{frame}{Outline} +\tableofcontents +\end{frame} +} + +\section[<++>]{<++>} +\begin[% +%plain +%containsverbatim +%allowframebreaks +%shrink +%squeeze +]{frame}{<++>}{<++>} + + <++> + +\end{frame} + + +\section{Conclusions} +\begin{frame}{Conclusions} +\label{f:lastSlide} +-- +\end{frame} + + +% Put everything into this part that you do not actually intend to talk about, +% but that might come in handy when questions are asked. +%\appendix + +%\section<presentation>*{\appendixname} +%\subsection<presentation>*{References} + +%\begin{frame}[allowframebreaks] + +% \frametitle<presentation>{References} + +% \begin{thebibliography}{10} +% { \small + +% % Start with overview books. +% \beamertemplatebookbibitems +% \bibitem{<Handle>} +% <Author(s)> +% \newblock {\em <Title>}.\\ +% <Publisher> + + +% % Followed by interesting articles. Keep the list short. +% \beamertemplatearticlebibitems +% \bibitem{<Handle>} +% A.C.~Mix, E.~Bard, R.~Schneider +% \newblock \emph{<Title>}\\ +% <Journal>, <Vol>. <Pages>, <Year>. + +% %\newpage + +% % Webpages +% \beamertemplatearrowbibitems +% \bibitem{<Handle>} +% <Description> +% \newblock \url{<URL>} +% +% } % End small +% \end{thebibliography} +%\end{frame} + +% Additional helping figures, etc. +%\subsection<presentation>*{Extra figures} +%\begin{frame}{Extra figures} +% \setcounter{tocdepth}{3} +% \tableofcontents +%\end{frame} + +%\subsubsection{<Figure Title>} +%\begin{frame}{<Figure Title>} +% <Insert Figure> +%\end{frame} + +\end{document} +End of file diff --git a/.vim/ftplugin/latex-suite/templates/report.tex b/.vim/ftplugin/latex-suite/templates/report.tex @@ -0,0 +1,9 @@ +<+ +> !comp! !exe! +% File: !comp!expand("%")!comp! +% Created: !comp!strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')!comp! +% Last Change: !comp!strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')!comp! +% +\documentclass[a4paper]{report} +\begin{document} +<++> +\end{document} diff --git a/.vim/ftplugin/latex-suite/templates/report_two_column.tex b/.vim/ftplugin/latex-suite/templates/report_two_column.tex @@ -0,0 +1,9 @@ +<+ +> !comp! !exe! +% File: !comp!expand("%:p:t")!comp! +% Created: !comp!strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')!comp! +% Last Change: !comp!strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')!comp! +% +\documentclass[a4paper,twocolumn]{report} +\begin{document} +<++> +\end{document} diff --git a/.vim/ftplugin/latex-suite/texmenuconf.vim b/.vim/ftplugin/latex-suite/texmenuconf.vim @@ -0,0 +1,131 @@ +"============================================================================= +" File: texmenuconf.vim +" Author: Srinath Avadhanula +" Copyright: Vim charityware license. :help license +" Description: +" CVS: $Id: texmenuconf.vim 1064 2009-08-16 19:37:57Z tmaas $ +" +"============================================================================= + +" Paths, crucial for functions +let s:path = fnameescape(expand("<sfile>:p:h")) +let s:up_path = fnameescape(expand("<sfile>:p:h:h")) +let s:mainmenuname = g:Tex_MenuPrefix.'S&uite.' +let s:mapleader = exists('mapleader') ? mapleader : "\\" + +" This glboal variable is incremented each time a top-level latex-suite menu +" is created. We should always use this variable for setting the locations of +" newly created top-level menus. +let g:Tex_NextMenuLocation = g:Tex_MainMenuLocation + +" The templates and macros menus are always nested within the main latex-suit +" menu. +let g:Tex_TemplatesMenuLocation = g:Tex_MainMenuLocation.'.20 '.s:mainmenuname.'&Templates.' +let g:Tex_MacrosMenuLocation = g:Tex_MainMenuLocation.'.20 '.s:mainmenuname.'&Macros.' + +" The packages menu can either be a child of the main menu or be a top-level +" menu by itself. +if g:Tex_NestPackagesMenu + let g:Tex_PackagesMenuLocation = (g:Tex_MainMenuLocation).'.10 '.s:mainmenuname.'&Packages.' +else + let g:Tex_PackagesMenuLocation = (g:Tex_NextMenuLocation).'.10 '.g:Tex_MenuPrefix.'Packages.' + let g:Tex_NextMenuLocation = g:Tex_NextMenuLocation + 1 +endif + +" Environments are always a top-level menu. +let g:Tex_EnvMenuLocation = (g:Tex_NextMenuLocation).'.20 '.g:Tex_MenuPrefix.'E&nvironments.' +let g:Tex_NextMenuLocation = g:Tex_NextMenuLocation + 1 + +" Elements are always a top-level menu. +" If we choose to nest elements, then the top-level &TeX-Elements menu +" contains <Fonts / Counters / Dimensions> +" otherwise, the Fonts, Counters and Dimensions menus become top-level menus. +if g:Tex_NestElementMenus + let g:Tex_ElementsMenuLocation = (g:Tex_NextMenuLocation).'.20 '.g:Tex_MenuPrefix.'E&lements.' +else + let g:Tex_ElementsMenuLocation = (g:Tex_NextMenuLocation).'.20 '.g:Tex_MenuPrefix +endif +let g:Tex_NextMenuLocation = g:Tex_NextMenuLocation + 1 + + +" Set up the compiler/viewer menus. {{{ +" +if has('gui_running') && g:Tex_Menus + exec 'anoremenu '.g:Tex_MainMenuLocation.'.25 '. s:mainmenuname.'-sepsuite0- :' + + " menus for compiling / viewing etc. + exec 'anoremenu '.g:Tex_MainMenuLocation.'.30 '.s:mainmenuname.'&Compile<tab>'.s:mapleader.'ll'. + \' :silent! call Tex_RunLaTeX()<CR>' + exec 'anoremenu '.g:Tex_MainMenuLocation.'.40 '.s:mainmenuname.'&View<tab>'.s:mapleader.'lv'. + \' :silent! call Tex_ViewLaTeX()<CR>' + exec 'anoremenu '.g:Tex_MainMenuLocation.'.50 '.s:mainmenuname.'&Search<tab>'.s:mapleader.'ls'. + \' :silent! call ForwardSearchLaTeX()<CR>' + exec 'anoremenu '.g:Tex_MainMenuLocation.'.60 '.s:mainmenuname.'&Target\ Format<tab>:TTarget'. + \' :call SetTeXTarget()<CR>' + exec 'anoremenu '.g:Tex_MainMenuLocation.'.70 '.s:mainmenuname.'&Compiler\ Target<tab>:TCTarget'. + \' :call Tex_SetTeXCompilerTarget("Compile", "")<CR>' + exec 'anoremenu '.g:Tex_MainMenuLocation.'.80 '.s:mainmenuname.'&Viewer\ Target<tab>:TVTarget'. + \' :call Tex_SetTeXCompilerTarget("View", "")<CR>' + exec 'anoremenu '.g:Tex_MainMenuLocation.'.90 '.s:mainmenuname.'Set\ &Ignore\ Level<tab>:TCLevel'. + \' :TCLevel<CR>' + exec 'imenu '.g:Tex_MainMenuLocation.'.100 '.s:mainmenuname.'C&omplete\ Ref/Cite'. + \' <Plug>Tex_Completion' + exec 'anoremenu '.g:Tex_MainMenuLocation.'.110 '.s:mainmenuname.'-sepsuite1- :' + " refreshing folds + if g:Tex_Folding + exec 'anoremenu '.g:Tex_MainMenuLocation.'.120 '.s:mainmenuname.'&Refresh\ Folds<tab>'.s:mapleader.'rf'. + \' :call MakeTexFolds(1)<CR>' + exec 'anoremenu '.g:Tex_MainMenuLocation.'.130 '.s:mainmenuname.'-sepsuite2- :' + endif +endif + +" }}} + +" ============================================================================== +" MenuConf: configure the menus as compact/extended, with/without math +" ============================================================================== +function! Tex_MenuConfigure(type, action) " {{{ + let menuloc = s:mainmenuname.'Configure\ Menu.' + if a:type == 'math' + if a:action == 1 + let g:Tex_MathMenus = 1 + exe 'source '.s:path.'/mathmacros.vim' + exe 'amenu disable '.menuloc.'Add\ Math\ Menu' + exe 'amenu enable '.menuloc.'Remove\ Math\ Menu' + elseif a:action == 0 + call Tex_MathMenuRemove() + exe 'amenu enable '.menuloc.'Add\ Math\ Menu' + exe 'amenu disable '.menuloc.'Remove\ Math\ Menu' + endif + elseif a:type == 'elements' + if a:action == 'expand' + let g:Tex_ElementsMenuLocation = '80.20 '.g:Tex_MenuPrefix + exe 'amenu disable '.menuloc.'Expand\ Elements' + exe 'amenu enable '.menuloc.'Compress\ Elements' + elseif a:action == 'nest' + let g:Tex_ElementsMenuLocation = '80.20 '.g:Tex_MenuPrefix.'Elements.' + exe 'amenu enable '.menuloc.'Expand\ Elements' + exe 'amenu disable '.menuloc.'Compress\ Elements' + endif + exe 'source '.fnameescape(s:path.'/elementmacros.vim') + elseif a:type == 'packages' + if a:action == 1 + let g:Tex_PackagesMenu = 1 + exe 'source '.s:path.'/packages.vim' + exe 'amenu disable '.menuloc.'Load\ Packages\ Menu' + endif + endif +endfunction + +" }}} + +" configuration menu. +if g:Tex_Menus + exe 'amenu '.g:Tex_MainMenuLocation.'.900 '.s:mainmenuname.'Configure\ Menu.Add\ Math\ Menu :call Tex_MenuConfigure("math", 1)<cr>' + exe 'amenu '.g:Tex_MainMenuLocation.'.900 '.s:mainmenuname.'Configure\ Menu.Remove\ Math\ Menu :call Tex_MenuConfigure("math", 0)<cr>' + exe 'amenu '.g:Tex_MainMenuLocation.'.900 '.s:mainmenuname.'Configure\ Menu.Expand\ Elements :call Tex_MenuConfigure("elements", "expand")<cr>' + exe 'amenu '.g:Tex_MainMenuLocation.'.900 '.s:mainmenuname.'Configure\ Menu.Compress\ Elements :call Tex_MenuConfigure("elements", "nest")<cr>' + exe 'amenu '.g:Tex_MainMenuLocation.'.900 '.s:mainmenuname.'Configure\ Menu.Load\ Packages\ Menu :call Tex_MenuConfigure("packages", 1)<cr>' +endif + +" vim:fdm=marker:ff=unix:noet:ts=4:sw=4 diff --git a/.vim/ftplugin/latex-suite/texproject.vim b/.vim/ftplugin/latex-suite/texproject.vim @@ -0,0 +1,54 @@ +"============================================================================= +" File: texproject.vim +" Author: Mikolaj Machowski +" Version: 1.0 +" Created: Wen Apr 16 05:00 PM 2003 +" +" Description: Handling tex projects. +"============================================================================= + +let s:path = fnameescape(expand("<sfile>:p:h")) + +command! -nargs=0 TProjectEdit :call <SID>Tex_ProjectEdit() + +" Tex_ProjectEdit: Edit project file " {{{ +" Description: If project file exists (*.latexmain) open it in window created +" with ':split', if no create ':new' window and read there +" project template +" +function! s:Tex_ProjectEdit() + + let file = expand("%:p") + let mainfname = Tex_GetMainFileName() + if glob(mainfname.'.latexmain') != '' + exec 'split '.fnameescape(mainfname.'.latexmain') + else + echohl WarningMsg + echomsg "Master file not found." + echomsg " :help latex-master-file" + echomsg "for more information" + echohl None + endif + +endfunction " }}} +" Tex_ProjectLoad: loads the .latexmain file {{{ +" Description: If a *.latexmain file exists, then sources it +function! Tex_ProjectLoad() + let s:origdir = fnameescape(getcwd()) + exe 'cd '.fnameescape(expand('%:p:h')) + + if glob(Tex_GetMainFileName(':p').'.latexmain') != '' + call Tex_Debug("Tex_ProjectLoad: sourcing [".Tex_GetMainFileName().".latexmain]", "proj") + exec 'source '.fnameescape(Tex_GetMainFileName().'.latexmain') + endif + + exe 'cd '.s:origdir +endfunction " }}} + +augroup LatexSuite + au LatexSuite User LatexSuiteFileType + \ call Tex_Debug("texproject.vim: catching LatexSuiteFileType event", "proj") | + \ call Tex_ProjectLoad() +augroup END + +" vim:fdm=marker:ff=unix:noet:ts=4:sw=4 diff --git a/.vim/ftplugin/latex-suite/texrc b/.vim/ftplugin/latex-suite/texrc @@ -0,0 +1,751 @@ +"============================================================================= +" vim:ft=vim:ts=4:sw=4:noet:fdm=marker:commentstring=\"\ %s:ff=unix +" File: texrc.vim +" Author: Srinath Avadhanula +" Created: Mon Apr 01 11:00 AM 2002 PST +" CVS: $Id: texrc 1073 2009-10-02 21:12:54Z tmaas $ +" +" Description: This file contains resource configuration information for the +" latex-suite package. +" +" NOTE: Do NOT be edit this file directly: +" this file will be over-written each time you install a new copy +" of latex-suite. +" +" You can do one of the following: +" 1. Copy this file into $VIMFILES/ftplugin/tex/texrc +" and edit the values in that file. +" $VIMFILES is ~/.vim for UNIX systems and ~/vimfiles for +" WINDOWS systems. +" +" 2. Just set values of each setting individually in your +" $VIMFILES/ftplugin/tex.vim file. (See above for what +" $VIMFILES is). You will need to use :let instead of :TexLet +" in this case. +" +" NOTE: This file is best viewed with Vim-6.0+ with folding turned on. +" CVS: $Id: texrc 1073 2009-10-02 21:12:54Z tmaas $ +"============================================================================= + +" ============================================================================== +" SafeLet: checks for value before giving default value {{{ +" Description: The function takes in a single argument and splits it into 2 +" parts, the first being the first <CWORD> found. this is taken +" as a variable name and the next part is assigned to it +" depending on whether the variable already exists or not. +" handles the case where the next part is quoted or not. +" All these calls work: +" TexLet g:varname = 1 +" TexLet g:varname = '1' +" TexLet g:varname = 'foo bar' +" TexLet g:varname = "foo\nbar" +" TexLet g:varname = foo bar +function! <SID>SafeLet(arg) + let name = matchstr(a:arg, '^\s*\zs\(\S\+\)\ze\s*=') + let value = matchstr(a:arg, '=\s*\zs.*\ze') + let value = substitute(value, '\s*$', '', '') + if !exists(name) + if value =~ "^'\\|^\"" + exec "let ".name." = ".value + else + exe "let ".name." = value" + endif + endif +endfunction +com! -nargs=+ TexLet :call <SID>SafeLet(<q-args>) +" }}} +" ============================================================================== + +" ============================================================================== +" General settings {{{ + +TexLet g:Tex_UsePython = 1 + +" the system command which pulls in a file. +if &shell =~ 'sh' + TexLet g:Tex_CatCmd = 'cat' + TexLet g:Tex_RmCmd = 'rm' +else + TexLet g:Tex_CatCmd = 'type' + TexLet g:Tex_RmCmd = 'del' +endif + +" whether to turn on debugging +TexLet g:Tex_Debug = 0 +" If non empty, all the debugging information will be written to a file of +" this name. +TexLet g:Tex_DebugLog = '' + +" }}} +" ============================================================================== +" Rules: specifications of programs for compiling and viewing {{{ +" + +" By default, when you compile a tex file using \ll, then you will be +" generating a .dvi file. Change this line if you want to set another default. +" NOTE: Make sure that a target for this format exists in the 'Compiler rules' +" section below and is set up properly for your system. +if has('macunix') + TexLet g:Tex_DefaultTargetFormat = 'pdf' +else + TexLet g:Tex_DefaultTargetFormat = 'dvi' +endif + +" A comma seperated list of formats which need multiple compilations to be +" correctly compiled. +TexLet g:Tex_MultipleCompileFormats = 'dvi,pdf' + +" Uncomment this line if you compile ps files via dvi files. +" TexLet g:Tex_FormatDependency_ps = 'dvi,ps' + +" ------------------------------------------------------------------------------ +" Compiler rules {{{ +" This is the first thing you should customize. It is set up for most common +" values, but if use some other compiler, then you will want to change this. +" As CompileFlags value you'd perhaps like to use, e.g., '-src-specials', +" but it is known that it can sometimes give different results in the output, +" so use it with care. The '-file-line-error' flag helps sanitize LaTeX error +" messages for processing by Vim. +TexLet g:Tex_CompileRule_dvi = 'latex -interaction=nonstopmode $*' +TexLet g:Tex_EscapeChars = '{}\' + +TexLet g:Tex_CompileRule_ps = 'dvips -Ppdf -o $*.ps $*.dvi' + +" ways to generate pdf files. there are soo many... +" NOTE: pdflatex generates the same output as latex. therefore quickfix is +" possible. +TexLet g:Tex_CompileRule_pdf = 'pdflatex -interaction=nonstopmode $*' + +" TexLet g:Tex_CompileRule_pdf = 'ps2pdf $*.ps' +" TexLet g:Tex_CompileRule_pdf = 'dvipdfm $*.dvi' +" TexLet g:Tex_CompileRule_pdf = 'dvipdf $*.dvi' + +TexLet g:Tex_CompileRule_html = 'latex2html $*.tex' + +TexLet g:Tex_CompileRule_bib = g:Tex_BibtexFlavor . ' $*' + +" Set Tex_UseMakefile to 0 if you want to ignore the presence of a Makefile +" when deciding how to compile +TexLet g:Tex_UseMakefile = 1 + +" }}} +" ------------------------------------------------------------------------------ +" Viewer rules {{{ +" these programs are for viewing other formats. +" NOTE: latex-suite will automatically append file.<format> to these functions +" when calling them. The viewer therefore cannot accept arguments after +" the filename. +" NOTE: Windows users: +" Set your $PATH variable to include the full path to these programs. +if has('win32') + TexLet g:Tex_ViewRule_ps = 'gsview32' + TexLet g:Tex_ViewRule_pdf = 'AcroRd32' + TexLet g:Tex_ViewRule_dvi = 'yap -1' +elseif has('macunix') + " Let the system pick. If you want, you can override the choice here. + TexLet g:Tex_ViewRule_ps = '' + TexLet g:Tex_ViewRule_pdf = '' + " TexLet g:Tex_ViewRule_pdf = 'Acrobat\ Reader\ 5.1' + TexLet g:Tex_ViewRule_dvi = '' + " Set this to 1 to disable opening a viewer with 'open -a' + " Note: If you do this, you need to specify viewers above + " TexLet g:Tex_TreatMacViewerAsUNIX = 1 +else + if executable('xdg-open') + TexLet g:Tex_ViewRule_ps = 'xdg-open' + TexLet g:Tex_ViewRule_pdf = 'xdg-open' + TexLet g:Tex_ViewRule_dvi = 'xdg-open' + else + TexLet g:Tex_ViewRule_ps = 'gv' + TexLet g:Tex_ViewRule_pdf = 'xpdf' + TexLet g:Tex_ViewRule_dvi = 'xdvi' + endif + " the option below specifies an editor for the dvi viewer while starting + " up the dvi viewer according to Dimitri Antoniou's tip on vim.sf.net (tip + " #225) + TexLet g:Tex_UseEditorSettingInDVIViewer = 0 +endif +" For unix systems or macunix systens with enabled Tex_TreatMacViewerAsUNIX: +" Set this to 1 if you do not want to execute the viewer in the background +" TexLet g:Tex_ExecuteUNIXViewerInForeground = 1 + +" Tex_ViewRuleComplete_{format} +" +" If a variable like this is specified, then it takes precedence over the +" variable with the same suffix defined above. i.e, Tex_ViewRuleComplete_dvi +" takes precedence over Tex_ViewRule_dvi. +" +" If only Tex_ViewRule_{format} is specified, then latex-suite constructs the +" actual system command which calls that program automatically. For example, +" if you specify Tex_ViewRule_dvi = 'kdvi', then latex-suite will issue the +" command +" !kdvi --unique file.dvi & +" +" However, if your viewer program accepts the file to be viewed in a way which +" doesn't fit with the way latex-suite constructs the system command, then +" specify it using this variable. You can use the same format here which +" 'makeprg' accepts. So $* can be used in place of the main file name. +" +" IMPORTANT: Make sure you make the process go into the background otherwise +" vim will wait for the viewer to terminate before letting you edit +" the file again. +" +" Example: +" Suppose you have a latex->html converter which converts a file say foo.tex +" to a file foo/index.html. Then you would use: +" +" let g:Tex_ViewRuleComplete_html = 'MozillaFirebird $*/index.html &' +" +" Doing something like this would not be possible using Tex_ViewRule_html +TexLet g:Tex_ViewRuleComplete_dvi = '' + +" }}} +" ------------------------------------------------------------------------------ +" }}} +" ============================================================================== +" Compiler: latex-suite comes with a customizable compiler plugin. {{{ +" :help latex-compiling for a detailed description of these options. +" +" this is the list of patterns which will be ignored from the compiler output. +" This is a handy way of specifying which warnings/errors to ignore. This is a +" list of patterns seperated by '¡' +TexLet g:Tex_IgnoredWarnings = + \'Underfull'."\n". + \'Overfull'."\n". + \'specifier changed to'."\n". + \'You have requested'."\n". + \'Missing number, treated as zero.'."\n". + \'There were undefined references'."\n". + \'Citation %.%# undefined' + +" the 'ignore level' of the 'efm'. A value of 4 says that the first 4 kinds of +" warnings in the list above will be ignored. Use the command TCLevel to set a +" level dynamically. +TexLet g:Tex_IgnoreLevel = 7 + +" NOTE: The values of g:Tex_Flavor and g:Tex_CompilerFlags are provided as a +" way to make compiler/tex.vim standalone. i.e independent of the rest +" of latex-suite. These variables are NOT used if you have already +" defined g:Tex_CompileRule_dvi above. +" +" specifies the current latex flavor. +TexLet g:Tex_Flavor = 'latex' + +" specifies the BibTeX flavor and if necessary options. If you use $* in this +" setting, it will be replaced by the *root* of the main file name, i.e, if +" the main file is "thesis.tex", $* will be "thesis". +TexLet g:Tex_BibtexFlavor = 'bibtex' + +" specifies the MakeIndedx flavor and if necessary options. $* will be +" replaced by the *root* of the main file name. See above. +TexLet g:Tex_MakeIndexFlavor = 'makeindex $*.idx' + +" By default the program described by g:Tex_Flavor above is called with the +" flags '--src-specials --interaction=nonstopmode'. If your particular version +" of latex does not accept these arguments, you will need to set this variable +" to the appropriate value. +" NOTE: leave commented for using the default flags. +" TODO: Is it necessary (or even desirable) to use 2 variables to specify a +" flavor and flags seperately? --SA +" TexLet g:Tex_CompilerFlags = '' + +" If disabled (set to 0) LaTeX-Suite doesn't go immediately to warnings or +" errors after compilation +TexLet g:Tex_GotoError = 1 + +" If set to 1, then latex-suite shows the context of the error in a preview +" window beneath the window showing the actual errors. +TexLet g:Tex_ShowErrorContext = 1 + +" Remove temp files created during part compilations when vim exits. +TexLet g:Tex_RemoveTempFiles = 1 + +" }}} +" ============================================================================== +" Project: how to deal with multi file projects via latex-suite {{{ + +" Use a valid vim expression here if you want to customize the way latex-suite +" searches for a master file from within another file. +TexLet g:Tex_MainFileExpression = '' + +" }}} +" ============================================================================== +" Macros: latex-suite comes with a large number of macros to speed up typing {{{ +" latex. +" +" Place Holder Options: {{{ +" (See |placeholders| for a description of what place-holders are). +" +" these options are actually used by imaps.vim, therefore the prefix is Imap_ +" and not Tex_. See |placeholders| for a description of how to use +" place-holders. You can either completely disable placeholders (not +" recommended) and/or you can change the place holder characters. + +TexLet g:Imap_UsePlaceHolders = 1 +TexLet g:Imap_PlaceHolderStart = '<+' +TexLet g:Imap_PlaceHolderEnd = '+>' + +" This option when set to 1 makes <C-J> in insert mode delete +" non-descriptive (empty) placeholders and enters insert mode. +" NOTE: This option _has_ to be set in the .vimrc. Setting this in a filetype +" plugin file such as ftplugin/tex.vim will not have any affect. +TexLet g:Imap_DeleteEmptyPlaceHolders = 0 + +" When set to 1, in visual mode, <C-J> takes you to the next placeholder +" without deleting the current placeholder. +" NOTE: This option _has_ to be set in the .vimrc. Setting this in a filetype +" plugin file such as ftplugin/tex.vim will not have any affect. +TexLet g:Imap_StickyPlaceHolders = 1 + + +" }}} +" Menu Wizard Option: {{{ +" If the following variable is set to 1, then when an enviroment is chosen +" from the menu then for selected environments, latex-suite asks a series of +" questions on the command line and inserts a template with the corresponding +" fields already filled in. +" Setting this to zero will insert a template with |placeholders| marking off +" the places where fields need to be filled. +TexLet g:Tex_UseMenuWizard = 0 + +" }}} +" Visual Mode Mapping Correction: {{{ +" With so many visual maps, its helpful to have a way of catching typing +" errors made in visual mode. What this does is to prompt you to correct your +" visual mode mapping if you start out with g:Tex_Leader and then type some +" illegal keys. +" It basically maps just the g:Tex_Leader character to a function +TexLet g:Tex_CatchVisMapErrors = 1 + +" }}} +" Diacritics: {{{ +" whether or not you want to use diacritics +" (diacritics speed up typing some languages. the way they are set up in +" latex-suite is +" =char> = \'{<char>} +" +char> = \v{<char>} +" +} = \"a +" :o = \^o +" Default: 0 +TexLet g:Tex_Diacritics = 0 + +" }}} +" Leader Options: {{{ +" The mappings in latex-suite are by default prefixed with the back-tick +" character. For example, `/ inserts \frac{<++>}{<++>}<++> etc. You can change the +" prefix with the following setting. +" ',', '/', '`' are preferred values. '' or '\' will lead to a _lot_ of +" trouble. +" g:Tex_Leader is also used for visual mode mappings for fonts. +TexLet g:Tex_Leader = '`' + +" In order to avoid ambiguity between the large number of visual mode macros +" provided, the visual mode macros for environments and sections start with a +" character different from '`'. +TexLet g:Tex_Leader2 = ',' + +" }}} +" Environment Macros: {{{ +" These mappings insert LaTeX "environments" such as +" \begin{center} +" <++> +" \end{center}<++> +" with the cursor left at the first place-holder. +" (See |placeholders| for what these are.) +" Mnemonic: +" 1. All environment mappings begin with 'E' +" 2. The next two capital letters are (for the common environments) the +" first 2 letters of the environment name converted into upper case. For +" example, for the center environment above, use ECE. There are a few +" necessary exceptions such as: +" equation --> EEQ +" eqnarray --> EEA +" Please see texmaps.vim for the complete list. +" +" Along with the insert mode mappings, a set of visual mode mappings is +" provided which encloses the visually selected region in an environment. +" These maps are related to the corresponding insert mode mappings by the +" following rule: +" EFI --> ,fi +" and so on. i.e, the leading E becomes '`' and the next 2 letters are small +" case. Some of the visual mode mappings are sensetive to whether you choose +" line-wise or character wise. For example, if you choose a word and press +" `ve, then you get \verb|word|, whereas if you press `ve on a line-wise +" selection, you get: +" \begin{verbatim} +" line +" \end{verbatim} +" +" these 2 options give finer control on which aspect of the macros you want +" to enable. +TexLet g:Tex_EnvironmentMaps = 1 +TexLet g:Tex_EnvironmentMenus = 1 + + +" }}} +" Font Macros: {{{ +" These mappings insert font descriptions such as: +" \textsf{<++>}<++> +" again with the cursor at the first place-holder. +" Mnemonic: +" 1. first letter is always F (F for font) +" 2. next 2 letters are the 2 letters describing the font. +" +" Example: the above mapping is triggered by FSF. +" +" Just like environment mappings, you can visually select an area and press +" `sf to have it enclosed in: +" \textsf{word} +" or +" {\sffamily +" line +" } +" depending on character-wise or line-wise selection. +TexLet g:Tex_FontMaps = 1 +TexLet g:Tex_FontMenus = 1 + +" }}} +" Section Macros: {{{ +" Inserts LaTeX sections: +" \section +" etc. Just as in the case of environments and fonts, can be enclosed with a +" visual selection. The enclosing is not sensetive to character or line-wise +" selection. +" NOTE: In visual mode, you are supposed to select the name of the section +" etc, not the whole section. +" In the following case, select just the first line, not lines 1-3. +" 1 section name +" 2 some lines in this section +" 3 and some more lines +" Mnemonic: (make your own!) +" SPA for part +" SCH for chapter +" SSE for section +" SSS for subsection +" SS2 for subsubsection +" SPG for paragraph +" SSP for subparagraph +TexLet g:Tex_SectionMaps = 1 +TexLet g:Tex_SectionMenus = 1 + +" }}} +" Auctex Style Mappings: {{{ +" Auctex.vim has heavily inspired various portions of latex-suite providing +" various new ways of conviniently inserting environments. +" +" If you press <F5> in the insert mode while on an empty line, latex-suite +" prompts you with a list of environments you might want to insert. You can +" either choose one from the list or type in a new environment name. +" The variable below (which is a comma seperated list of environment names) +" decides the prompt which latex-suite generates. +" You can place as many items as you want here. If the environment name is a +" standard latex environment such as table or figure, then latex-suite will +" insert a template with additional fields, if not, just a bare bones +" \begin{env} +" <++> +" \end{env} +" is inserted. +" \[ and $$ are also recognized. +" NOTE: Setting this variable to the empty string is a way of leaving the +" <F5> key unmapped + +TexLet g:Tex_PromptedEnvironments = + \ 'eqnarray*,eqnarray,equation,equation*,\[,$$,align,align*' + +" Another quick way of inserting environments is to press one of the shifted +" function keys from <F1> through <F4>. +" Each environment in the following list is mapped to a corresponding shifted +" function key. +" NOTE: Setting this variable to the empty string is a way of leaving all the +" shifted function keys untouched by latex-suite. +" NOTE: Only the first 4 items of the list are used. The rest will be silently +" ignored. +" The number of items in this list decides how many shifted function keys are +" mapped. +TexLet g:Tex_HotKeyMappings = + \ 'eqnarray*,eqnarray,bmatrix' + +" Similar to above mechanisms works <F7> key. It prompts for command with list +" of commands from g:Tex_PromptedCommands. There are not HotKeys for commands. +" It works for commands of style \com{}. Changing of current command is done +" with <S-F7> + +TexLet g:Tex_PromptedCommands = + \ 'footnote,cite,pageref,label' + +" }}} +" Smart Key Mappings: {{{ +" Latex-suite shites with a number of 'smart' maps, where the behavior of +" standard keys is modified in a way which makes editing tex files easy. + +" Pressing <BS> in insert mode checks to see whether we are just after +" something like \'{a} and if so, deletes all of it. i.e, diacritics are +" treated as single characters for backspacing. +" Setting this to zero will leave the <BS> key unmapped. +" Default: 1 +TexLet g:Tex_SmartKeyBS = 1 +" The pattern used to detect whether the previous characters comprise a +" diacritic character. This default pattern detects the standard LaTeX +" diacritics +TexLet g:Tex_SmartBSPattern = + \ '\(' . + \ "\\\\[\"^'=v]{\\S}" . '\|' . + \ "\\\\[\"^'=]\\S" . '\|' . + \ '\\v \S' . '\|' . + \ "\\\\[\"^'=v]{\\\\[iI]}" . '\|' . + \ '\\v \\[iI]' . '\|' . + \ '\\q \S' . '\|' . + \ '\\-' . + \ '\)' . "$" + +" Pressing " (english double quote) will insert `` or '' by making an +" intelligent guess about whether we intended to open or close a quote. +" Default: 1 +TexLet g:Tex_SmartKeyQuote = 1 + +" Users of other languages might want to change the quote characters to suit +" their locale. These global values will be ignored if there are buffer-local +" versions, which may be set in the language-specific package files, such as +" ftplugin/latex-suite/packages/german +TexLet g:Tex_SmartQuoteOpen = "``" +TexLet g:Tex_SmartQuoteClose = "''" + +" Latex-suite maps the <space> key in such a way that $ characters are not +" broken across lines. +" NOTE: Setting this to 1 has the side-effect of making the 'tw' setting be 0. +" Default: +TexLet g:Tex_SmartKeySpace = 0 + +" Pressing ... (3 dots) results in \ldots outside math mode and \cdots in math +" mode. +" +" TODO: Make it more intelligent within math mode. For example +" $1+...+3$ should expand to $1+\cdots+n$, whereas $1,...,n$ should expand +" to $1,\ldots,n$. The amsmath package actually provides a command \dots +" which does this. Maybe use that if amsmath is detected? +" Default: 1 +TexLet g:Tex_SmartKeyDot = 1 + +" }}} +" Advanced Math: {{{ +" These mappings allow for fast inserting of math constructions +" brackets, better handling of space in math mode, unfortunately +" they use <M-> mappings which conflicts with some encodings. This is easy way +" of turning them off. +" +" <M-b> encloses the previous character in \mathbf{} +" <M-c> is polymorphic as follows: +" Insert mode: +" 1. If the previous character is a letter or number, then capitalize it and +" enclose it in \mathcal{} +" 2. otherwise insert \cite{} +" Visual Mode: +" 1. Enclose selection in \mathcal{} +" <M-l> is also polymorphic as follows: +" If the character before typing <M-l> is one of '([{|<q', then do the +" following: +" 1. (<M-l> \left(\right +" similarly for [, | +" {<M-l> \left\{\right\} +" 2. <<M-l> \langle\rangle +" 3. q<M-l> \lefteqn{} +" otherwise insert \label{} +" <M-i> inserts \item commands at the current cursor location depending on +" the surrounding environment. For example, inside itemize, it will +" insert a simple \item, but within a description, it will insert +" \item[<+label+>] etc. +" +" Default: 1 +TexLet g:Tex_AdvancedMath = 1 + +" }}} + +" }}} +" ============================================================================== +" TeX Completion: {{{ + +" Options for controlling the window sizes of the completion windows {{{ + +" The height of the window which contains the \label's (when completing a +" \ref) or bibtex entries (when completing a \cite). This option is used in +" the newer methods of completing \ref's and \cite's. +TexLet g:Tex_OutlineWindowHeight = 15 + +" Options for preview window for ref/cite completion. The next two options +" are used only when g:Tex_UseOutlineCompletion = 0 or +" g:Tex_UseCiteCompletionVer2 = 0, i.e, when we use a classic method of +" completing \refs and \cites. +" Height of cwindow +TexLet g:Tex_ViewerCwindowHeight = 5 +" Height of preview window +TexLet g:Tex_ViewerPreviewHeight = 10 + +" Options for explorer completion. +" Height of explorer window +TexLet g:Tex_ExplorerHeight = 10 + +" Directory for images. Read |latex-completion-explorer| before changing +TexLet g:Tex_ImageDir = '' + +" }}} +" Options for completing a \ref {{{ + +" Whether to use the "outline mode" for displaying the \label's while doing +" \ref completion. In this mode, each label is displayed within the +" document element it resides in. The entire thing is folded to ease +" navigation. Should be easier/faster than the classical mode. +TexLet g:Tex_UseOutlineCompletion = 1 + +" This option should be set via the .latexmain file. It should be a newline +" seperated list of files which make up all the "source" files in the +" current project. This enables latex-suite to skip the more complicated +" algorithm of finding the source files by recursively searching for +" \input'ed files from the |latex-master-file|. +" +" Only used when g:Tex_UseOutlineCompletion = 0. +TexLet g:Tex_ProjectSourceFiles = '' + +" Whether latex-suite simply searches for \\label's in all the .tex file +" found in the current directory or whether it will use a more complex +" algorithm. This is used only g:Tex_UseOutlineCompletion = 0 and +" g:Tex_ProjectSourceFiles = ''. +" See +" :help Tex_UseSimpleLabelSearch +" for more information +TexLet g:Tex_UseSimpleLabelSearch = 0 + +" }}} +" Options for completing a \cite'ation {{{ + +" If set to 1, then the newer way of presenting the bibtex entries is used. +" Instead of a |cwindow| showing just the keys and a synced |preview| +" window beneath, show a single window containing a nicely formatted list +" of bibtex entries. This should be faster and easier to use than the +" classic mode +TexLet g:Tex_UseCiteCompletionVer2 = 1 + +" This is a string which is displayed to the user when he wants to sort or +" filter the bibtex entries. This string also serves to define acronyms for +" the various fields of a bibtex entry. +TexLet g:Tex_BibFieldPrompt = + \ "Field acronyms: (`:let g:Tex_EchoBibFields = 0` to avoid this message)\n" . + \ " [t] title [a] author [b] booktitle \n" . + \ " [j] journal [y] year [p] bibtype \n" . + \ " (you can also enter the complete field name) \n" + +" Whether or not to display the string above to aid the user in choosing +" the field to filter/sort with. +TexLet g:Tex_EchoBibFields = 1 + +" A setting of this form defines the letter 'a' as standing for the field +" 'author'. Thus when the user types +" a ellington +" when asked to enter a filter, it is equivalent to the user specifying the +" filter +" author ellington +" TexLet g:Tex_BibAcronym_a = 'author' + +" Whether or not to use Jabref to complete citations +" See +" :help latex-suite-jabref +" for more infomration +TexLet g:Tex_UseJabref = 0 + +" whether or not searches for \cite's are cached. +TexLet g:Tex_RememberCiteSearch = 0 +" Paths to the bibliography files and custom packages. +TexLet g:Tex_BIBINPUTS = '' +TexLet g:Tex_TEXINPUTS = '' + +" }}} + +" }}} +" ============================================================================== +" Menus: set the kinds of menus which you would like to see. {{{ +" +" Setting this variable to zero will immediately disable _all_ menus. +" for finer control set this to 1 and then play with the other options. +" Default: 1 +TexLet g:Tex_Menus = 1 + +" The location of the main menu +TexLet g:Tex_MainMenuLocation = 80 + +" Math contains a large number of tex math elemets such as arrows, +" mathematical fonts (\mathrm), mathematical diacritics (\dot), binary +" relational operators etc. This menu compromises about 75% of the menus. +" Default: 1 +TexLet g:Tex_MathMenus = 1 + +" The following options control the "compactness" of the menus. +" +" Setting this option to 1 makes the Font, Counter and Dimensioning menus to +" be collected together into a single 'Tex-Elements' menu. Setting this to 0 +" creates seperate menus for each of them. +" Default: 1 +TexLet g:Tex_NestElementMenus = 1 + +" Sometimes when you are using a lot of packages with lots of options etc, +" then a lot of time might be spent at startup loading the menus. +" Setting the following variable to 0 will stop autoloading the packages menu. +" You can still goto TeX-Suite.Configure Menu and load this after startup. +" Default: 1 +TexLet g:Tex_PackagesMenu = 1 +" The following option will create the packages option within the TeX-Suite +" menu. +" Default: 1 +TexLet g:Tex_NestPackagesMenu = 1 + +" This is the prefix added to the menu names created by latex suite. Add a +" dot to the following option to nest the menus under the menu name before the +" dot. +" NOTE: With a '.' as the last character of the following setting, every +" single menu created by latex suite will be nested under the same menu. +" Default: 'TeX-' +TexLet g:Tex_MenuPrefix = 'TeX-' + +" Use utf-8 menus. There is plenty of math symbols in LaTeX. It is hard to +" remember them. You can display them with utf-8. Your system/GUI interface +" have to support utf-8. This addition is necessary for resetting 'encoding'. +TexLet g:Tex_UseUtfMenus = 0 + +if g:Tex_UseUtfMenus != 0 && has("gui_running") + set encoding=utf-8 +endif + +" }}} +" ============================================================================== +" Folding: latex-suite comes with 'fake' syntax folding. {{{ +" +" specifies whether the MakeTeXFolds() function will be defined. If this is +" set to zero, then esentially you have disabled all of latex-suite's folding +" functions. no maps for refreshing folds will be set up etc. +" NOTE: However, the function TexFoldTextFunction() is still avaiable +" and 'foldexpr' is set to point to it. This is so you can continue +" using another folding scheme but still use the fold text function. +TexLet g:Tex_Folding = 1 + +" specifies whether a latex file is automatically folded up when opened. +" Setting this to zero means that a file is not folded up as soon as its +" opened. +" NOTE: the MakeTeXFolds() function will still be available (unless disabled +" by g:Tex_Folding), so you can do <F6> or \rf to refresh/create folds. +TexLet g:Tex_AutoFolding = 1 + +" }}} +" ============================================================================== +" Taglist: Support for taglist.vim {{{ +" +" LaTeX-Suite offers now support for taglist.vim, the most popular Vim +" interface for ctags. You should use ctags version >= 5.0 and taglist >= 3.0. +TexLet g:Tex_TaglistSupport = 1 + +" This option turns on definition of tags for LaTeX. +" NOTE: In taglist window you may see duplicate entries for the same tag. It +" means some definitions are repeated somewhere else. You can turn off +" internal definitions or remove external (read ctags description +" where). +TexLet g:Tex_InternalTagsDefinitions = 1 + +" }}} +" ============================================================================== diff --git a/.vim/ftplugin/latex-suite/texviewer.vim b/.vim/ftplugin/latex-suite/texviewer.vim @@ -0,0 +1,1069 @@ +" ============================================================================ +" File: texviewer.vim +" Author: Mikolaj Machowski +" Created: Sun Jan 26 06:00 PM 2003 +" Description: make a viewer for various purposes: \cite{, \ref{ +" License: Vim Charityware License +" Part of vim-latexSuite: http://vim-latex.sourceforge.net +" CVS: $Id: texviewer.vim 1112 2010-10-27 21:27:11Z tmaas $ +" ============================================================================ +" Tex_SetTexViewerMaps: sets maps for this ftplugin {{{ +function! Tex_SetTexViewerMaps() + inoremap <silent> <Plug>Tex_Completion <Esc>:call Tex_Complete("default","text")<CR> + if !hasmapto('<Plug>Tex_Completion', 'i') + if has('gui_running') + imap <buffer> <silent> <F9> <Plug>Tex_Completion + else + imap <buffer> <F9> <Plug>Tex_Completion + endif + endif +endfunction + +augroup LatexSuite + au LatexSuite User LatexSuiteFileType + \ call Tex_Debug('texviewer.vim: Catching LatexSuiteFileType event', 'view') | + \ call Tex_SetTexViewerMaps() +augroup END + +command -nargs=1 TLook call Tex_Complete(<q-args>, 'tex') +command -nargs=1 TLookAll call Tex_Complete(<q-args>, 'all') +command -nargs=1 TLookBib call Tex_Complete(<q-args>, 'bib') + +" }}} + +" ============================================================================== +" Main completion function +" ============================================================================== +" Tex_Complete: main function {{{ +" Description: +function! Tex_Complete(what, where) + + " Get info about current window and position of cursor in file + let s:winnum = winnr() + + " Change to the directory of the file being edited before running all the + " :grep commands. We will change back to the original directory after we + " finish with the grep. + let s:origdir = fnameescape(getcwd()) + exe 'cd '.fnameescape(expand('%:p:h')) + + let s:pos = Tex_GetPos() + + unlet! s:type + unlet! s:typeoption + + if Tex_GetVarValue('Tex_WriteBeforeCompletion') == 1 + wall + endif + + if a:where == "text" + " What to do after <F9> depending on context + let s:curline = strpart(getline('.'), 0, col('.')) + let s:prefix = matchstr(s:curline, '.*{\zs.\{-}\(}\|$\)') + " a command is of the type + " \psfig[option=value]{figure=} + " Thus + " s:curline = '\psfig[option=value]{figure=' + " (with possibly some junk before \psfig) + " from which we need to extract + " s:type = 'psfig' + " s:typeoption = '[option=value]' + let pattern = '.*\\\(\w\{-}\)\(\[.\{-}\]\)*{\([^ [\]\t]\+\)\?$' + if s:curline =~ pattern + let s:type = substitute(s:curline, pattern, '\1', 'e') + let s:typeoption = substitute(s:curline, pattern, '\2', 'e') + call Tex_Debug('Tex_Complete: s:type = '.s:type.', typeoption = '.s:typeoption, 'view') + endif + + if exists("s:type") && s:type =~ 'ref' + if Tex_GetVarValue('Tex_UseOutlineCompletion') == 1 + call Tex_Debug("Tex_Complete: using outline search method", "view") + call Tex_StartOutlineCompletion() + + elseif Tex_GetVarValue('Tex_UseSimpleLabelSearch') == 1 + call Tex_Debug("Tex_Complete: searching for \\labels in all .tex files in the present directory", "view") + call Tex_Debug("Tex_Complete: silent! grep! ".Tex_EscapeForGrep('\\label{'.s:prefix)." *.tex", 'view') + call Tex_Grep('\\label{'.s:prefix, '*.tex') + call <SID>Tex_SetupCWindow() + + elseif Tex_GetVarValue('Tex_ProjectSourceFiles') != '' + call Tex_Debug('Tex_Complete: searching for \\labels in all Tex_ProjectSourceFiles', 'view') + exec 'cd '.fnameescape(Tex_GetMainFileName(':p:h')) + call Tex_Grep('\\label{'.s:prefix, Tex_GetVarValue('Tex_ProjectSourceFiles')) + call <SID>Tex_SetupCWindow() + + else + call Tex_Debug("Tex_Complete: calling Tex_GrepHelper", "view") + silent! grep! ____HIGHLY_IMPROBABLE___ % + call Tex_GrepHelper(s:prefix, 'label') + call <SID>Tex_SetupCWindow() + endif + + redraw! + + elseif exists("s:type") && s:type =~ 'cite' + + let s:prefix = matchstr(s:prefix, '\([^,]\+,\)*\zs\([^,]\+\)\ze$') + call Tex_Debug(":Tex_Complete: using s:prefix = ".s:prefix, "view") + + if has('python') && Tex_GetVarValue('Tex_UsePython') + \ && Tex_GetVarValue('Tex_UseCiteCompletionVer2') == 1 + + exe 'cd '.s:origdir + silent! call Tex_StartCiteCompletion() + + elseif Tex_GetVarValue('Tex_UseJabref') == 1 + + exe 'cd '.s:origdir + let g:Remote_WaitingForCite = 1 + let citation = input('Enter citation from jabref (<enter> to leave blank): ') + let g:Remote_WaitingForCite = 0 + call Tex_CompleteWord(citation, strlen(s:prefix)) + + else + " grep! nothing % + " does _not_ clear the search history contrary to what the + " help-docs say. This was expected. So use something improbable. + " TODO: Is there a way to clear the search-history w/o making a + " useless, inefficient search? + silent! grep! ____HIGHLY_IMPROBABLE___ % + if g:Tex_RememberCiteSearch && exists('s:citeSearchHistory') + call <SID>Tex_SetupCWindow(s:citeSearchHistory) + else + call Tex_GrepHelper(s:prefix, 'bib') + redraw! + call <SID>Tex_SetupCWindow() + endif + if g:Tex_RememberCiteSearch && &ft == 'qf' + let _a = @a + silent! normal! ggVG"ay + let s:citeSearchHistory = @a + let @a = _a + endif + endif + + elseif exists("s:type") && (s:type =~ 'includegraphics' || s:type == 'psfig') + call Tex_SetupFileCompletion( + \ '', + \ '^\.\\|\.tex$\\|\.bib$\\|\.bbl$\\|\.zip$\\|\.gz$', + \ 'noext', + \ Tex_GetVarValue('Tex_ImageDir', '.'), + \ Tex_GetVarValue('Tex_ImageDir', '')) + + elseif exists("s:type") && s:type == 'bibliography' + call Tex_SetupFileCompletion( + \ '\.b..$', + \ '', + \ 'noext', + \ '.', + \ '') + + elseif exists("s:type") && s:type =~ 'include\(only\)\=' + call Tex_SetupFileCompletion( + \ '\.t..$', + \ '', + \ 'noext', + \ '.', + \ '') + + elseif exists("s:type") && s:type == 'input' + call Tex_SetupFileCompletion( + \ '', + \ '', + \ 'ext', + \ '.', + \ '') + + elseif exists('s:type') && exists("g:Tex_completion_".s:type) + call <SID>Tex_CompleteRefCiteCustom('plugin_'.s:type) + + else + let s:word = expand('<cword>') + if s:word == '' + call Tex_SwitchToInsertMode() + return + endif + call Tex_Debug("silent! grep! ".Tex_EscapeForGrep('\<'.s:word.'\>')." *.tex", 'view') + call Tex_Grep('\<'.s:word.'\>', '*.tex') + + call <SID>Tex_SetupCWindow() + endif + + elseif a:where == 'tex' + " Process :TLook command + call Tex_Grep(a:what, "*.tex") + call <SID>Tex_SetupCWindow() + + elseif a:where == 'bib' + " Process :TLookBib command + call Tex_Grep(a:what, "*.bib") + call Tex_Grepadd(a:what, "*.bbl") + call <SID>Tex_SetupCWindow() + + elseif a:where == 'all' + " Process :TLookAll command + call Tex_Grep(a:what, "*") + call <SID>Tex_SetupCWindow() + endif + +endfunction +" }}} +" Tex_CompleteWord: inserts a word at the chosen location {{{ +" Description: This function is meant to be called when the user press +" ``<enter>`` in one of the [Error List] windows which shows the list of +" matches. completeword is the rest of the word which needs to be inserted. +" prefixlength characters are deleted before completeword is inserted +function! Tex_CompleteWord(completeword, prefixlength) + call Tex_SetPos(s:pos) + + " Complete word, check if add closing } + if a:prefixlength > 0 + if a:prefixlength > 1 + exe 'normal! '.(a:prefixlength-1).'h' + endif + exe 'normal! '.a:prefixlength.'s'.a:completeword."\<Esc>" + else + exe 'normal! a'.a:completeword."\<Esc>" + endif + + if getline('.')[col('.')-1] !~ '{' && getline('.')[col('.')] !~ '}' + exe "normal! a}\<Esc>" + endif + + " Return to Insert mode + call Tex_SwitchToInsertMode() +endfunction " }}} + +" ============================================================================== +" File name completion helper functons +" ============================================================================== +" Tex_SetupFileCompletion: {{{ +" Description: +function! Tex_SetupFileCompletion(accept, reject, ext, dir, root) + call FB_SetVar('FB_AllowRegexp', a:accept) + call FB_SetVar('FB_RejectRegexp', a:reject) + call FB_SetVar('FB_CallBackFunction', 'Tex_CompleteFileName') + call FB_SetVar('FB_CallBackFunctionArgs', '"'.a:ext.'", "'.a:root.'"') + + call FB_OpenFileBrowser(a:dir) +endfunction " }}} +" Tex_CompleteFileName: {{{ +" Description: +function! Tex_CompleteFileName(filename, ext, root) + let root = (a:root == '' ? Tex_GetMainFileName(':p:h') : a:root) + + call Tex_Debug('+Tex_CompleteFileName: getting filename '.a:filename, 'view') + + if a:ext == 'noext' + let completeword = fnamemodify(a:filename, ':r') + else + let completeword = a:filename + endif + let completeword = Tex_RelPath(completeword, root) + + call Tex_Debug(":Tex_CompleteFileName: completing with ".completeword, "view") + call Tex_CompleteWord(completeword, strlen(s:prefix)) +endfunction " }}} +" Tex_Common: common part of strings {{{ +function! s:Tex_Common(path1, path2) + " Assume the caller handles 'ignorecase' + if a:path1 == a:path2 + return a:path1 + endif + let n = 0 + while a:path1[n] == a:path2[n] + let n = n+1 + endwhile + return strpart(a:path1, 0, n) +endfunction " }}} +" Tex_NormalizePath: {{{ +" Description: +function! Tex_NormalizePath(path) + let retpath = a:path + if has("win32") || has("win16") || has("dos32") || has("dos16") + let retpath = substitute(retpath, '\\', '/', 'ge') + endif + if isdirectory(retpath) && retpath !~ '/$' + let retpath = retpath.'/' + endif + return retpath +endfunction " }}} +" Tex_RelPath: ultimate file name {{{ +function! Tex_RelPath(explfilename,texfilename) + let path1 = Tex_NormalizePath(a:explfilename) + let path2 = Tex_NormalizePath(a:texfilename) + + let n = matchend(<SID>Tex_Common(path1, path2), '.*/') + let path1 = strpart(path1, n) + let path2 = strpart(path2, n) + if path2 !~ '/' + let subrelpath = '' + else + let subrelpath = substitute(path2, '[^/]\{-}/', '../', 'ge') + let subrelpath = substitute(subrelpath, '[^/]*$', '', 'ge') + endif + let relpath = subrelpath.path1 + return escape(Tex_NormalizePath(relpath), ' ') +endfunction " }}} + +" ============================================================================== +" Helper functions for dealing with the 'quickfix' and 'preview' windows. +" ============================================================================== +" Tex_SetupCWindow: set maps and local settings for cwindow {{{ +" Description: Set local maps jkJKq<cr> for cwindow. Also size and basic +" settings +" +function! s:Tex_SetupCWindow(...) + call Tex_Debug('+Tex_SetupCWindow', 'view') + cclose + exe 'copen '. g:Tex_ViewerCwindowHeight + " If called with an argument, it means we want to re-use some search + " history from last time. Therefore, just paste it here and proceed. + if a:0 == 1 + set modifiable + % d _ + silent! 0put!=a:1 + $ d _ + endif + setlocal nonumber + setlocal nowrap + + let s:scrollOffVal = &scrolloff + call <SID>Tex_SyncPreviewWindow() + + " If everything went well, then we should be situated in the quickfix + " window. If there were problems, (no matches etc), then we will not be. + " Therefore return. + if &ft != 'qf' + call Tex_Debug('not in quickfix window, quitting', 'view') + return + endif + + nnoremap <buffer> <silent> j j:call <SID>Tex_SyncPreviewWindow()<CR> + nnoremap <buffer> <silent> k k:call <SID>Tex_SyncPreviewWindow()<CR> + nnoremap <buffer> <silent> <up> <up>:call <SID>Tex_SyncPreviewWindow()<CR> + nnoremap <buffer> <silent> <down> <down>:call <SID>Tex_SyncPreviewWindow()<CR> + + " Change behaviour of <cr> only for 'ref' and 'cite' context. + if exists("s:type") && s:type =~ 'ref\|cite' + exec 'nnoremap <buffer> <silent> <cr> ' + \ .':set scrolloff='.s:scrollOffVal.'<CR>' + \ .':cd '.s:origdir.'<CR>' + \ .':silent! call <SID>Tex_CompleteRefCiteCustom("'.s:type.'")<CR>' + + else + " In other contexts jump to place described in cwindow and close small + " windows + exec 'nnoremap <buffer> <silent> <cr> ' + \ .':set scrolloff='.s:scrollOffVal.'<CR>' + \ .':cd '.s:origdir.'<CR>' + \ .':call <SID>Tex_GoToLocation()<cr>' + + endif + + " Scroll the preview window while in the quickfix window + nnoremap <buffer> <silent> J :wincmd j<cr><c-e>:wincmd k<cr> + nnoremap <buffer> <silent> K :wincmd j<cr><c-y>:wincmd k<cr> + + " Exit the quickfix window without doing anything. + exe 'nnoremap <buffer> <silent> q ' + \ .':set scrolloff='.s:scrollOffVal.'<CR>' + \ .':cd '.s:origdir.'<CR>' + \ .':call Tex_CloseSmallWindows()<CR>' + +endfunction " }}} +" Tex_CompleteRefCiteCustom: complete/insert name for current item {{{ +" Description: handle completion of items depending on current context +" +function! s:Tex_CompleteRefCiteCustom(type) + + let prefixlength=strlen(s:prefix) + if a:type =~ 'cite' + if getline('.') =~ '\\bibitem\s*{' + let bibkey = matchstr(getline('.'), '\\bibitem\s*{\zs.\{-}\ze}') + else + let bibkey = matchstr(getline('.'), '\\bibitem\s*\[.\{-}\]\s*{\zs.\{-}\ze}') + endif + let completeword = bibkey + + elseif a:type =~ 'ref' + let label = matchstr(getline('.'), '\\label{\zs.\{-}\ze}') + let completeword = label + + elseif a:type =~ '^plugin_' + let type = substitute(a:type, '^plugin_', '', '') + let completeword = <SID>Tex_DoCompletion(type) + " use old behaviour for plugins because of backward compatibility + let prefixlength=0 + + endif + + call Tex_CloseSmallWindows() + call Tex_Debug(":Tex_CompleteRefCiteCustom: completing with ".completeword, "view") + call Tex_CompleteWord(completeword, prefixlength) +endfunction " }}} +" Tex_SyncPreviewWindow: synchronize quickfix and preview window {{{ +" Description: Usually quickfix engine takes care about most of these things +" but we discard it for better control of events. +" +function! s:Tex_SyncPreviewWindow() + call Tex_Debug('+Tex_SyncPreviewWindow', 'view') + + let viewfile = matchstr(getline('.'), '^\f*\ze|\d') + let viewline = matchstr(getline('.'), '|\zs\d\+\ze') + + " Hilight current line in cwindow + " Normally hightlighting is done with quickfix engine but we use something + " different and have to do it separately + syntax clear + runtime syntax/qf.vim + exe 'syn match vTodo /\%'. line('.') .'l.*/' + hi link vTodo Todo + + " Close preview window and open it again in new place + pclose + exe 'silent! bot pedit +'.viewline.' '.viewfile + + " Vanilla 6.1 has bug. This additional setting of cwindow height prevents + " resizing of this window + exe g:Tex_ViewerCwindowHeight.' wincmd _' + + " Handle situation if there is no item beginning with s:prefix. + " Unfortunately, because we know it late we have to close everything and + " return as in complete process + if v:errmsg =~ 'E32\>' + exe s:winnum.' wincmd w' + pclose! + cclose + if exists("s:prefix") + echomsg 'No bibkey, label or word beginning with "'.s:prefix.'"' + endif + call Tex_SwitchToInsertMode() + let v:errmsg = '' + call Tex_Debug('Tex_SyncPreviewWindow: got error E32, no matches found, quitting', 'view') + return 0 + endif + + " Move to preview window. Really is it under cwindow? + wincmd j + + " Settings of preview window + exe g:Tex_ViewerPreviewHeight.' wincmd _' + setlocal nofoldenable + + if exists('s:type') && s:type =~ 'cite' + " In cite context place bibkey at the top of preview window. + setlocal scrolloff=0 + normal! zt + else + " In other contexts in the middle. Highlight this line? + setlocal scrolloff=100 + normal! z. + endif + + " Return to cwindow + wincmd p + +endfunction " }}} +" Tex_CloseSmallWindows: {{{ +" Description: +" +function! Tex_CloseSmallWindows() + exe s:winnum.' wincmd w' + pclose! + cclose + call Tex_SetPos(s:pos) +endfunction " }}} +" Tex_GoToLocation: Go to chosen location {{{ +" Description: Get number of current line and go to this number +" +function! s:Tex_GoToLocation() + pclose! + let errmsg = v:errmsg + let v:errmsg = '' + exe 'silent! cc ' . line('.') + " If the current buffer is modified, then split + if v:errmsg =~ '^E37:' + split + exe 'silent! cc ' . line('.') + endif + cclose + let v:errmsg = errmsg +endfunction " }}} + +" ============================================================================== +" Functions for finding \\label's or \\bibitem's in the main file. +" ============================================================================== +" Tex_GrepHelper: grep main filename for \\bibitem's or \\label's {{{ +" Description: +function! Tex_GrepHelper(prefix, what) + let _path = &path + let _suffixesadd = &suffixesadd + let _hidden = &hidden + + let mainfname = Tex_GetMainFileName(':p') + " If we are already editing the file, then use :split without any + " arguments so it works even if the file is modified. + " FIXME: If mainfname is being presently edited in another window and + " is 'modified', then the second split statement will not work. + " We will need to travel to that window and back. + if mainfname == expand('%:p') + split + else + exec 'split '.fnameescape(mainfname) + endif + + let pos = Tex_GetPos() + if a:what =~ 'bib' + call Tex_ScanFileForCite(a:prefix) + else + call Tex_ScanFileForLabels(a:prefix) + endif + call Tex_SetPos(pos) + + q + let &path = _path + let &suffixesadd = _suffixesadd + +endfunction " }}} +" Tex_ScanFileForCite: search for \bibitem's in .bib or .bbl or tex files {{{ +" Description: +" Search for bibliographic entries in the presently edited file in the +" following manner: +" 1. First see if the file has a \bibliography command. +" If YES: +" 1. If a .bib file corresponding to the \bibliography command can be +" found, then search for '@.*'.a:prefix inside it. +" 2. Otherwise, if a .bbl file corresponding to the \bibliography command +" can be found, then search for '\bibitem'.a:prefix inside it. +" 2. Next see if the file has a \thebibliography environment +" If YES: +" 1. Search for '\bibitem'.a:prefix in this file. +" +" If neither a \bibliography or \begin{thebibliography} are found, then repeat +" steps 1 and 2 for every file \input'ed into this file. Abort any searching +" as soon as the first \bibliography or \begin{thebibliography} is found. +function! Tex_ScanFileForCite(prefix) + call Tex_Debug('+Tex_ScanFileForCite: searching for bibkeys in '.bufname('%').' (buffer #'.bufnr('%').')', 'view') + let presBufNum = bufnr('%') + + let foundCiteFile = 0 + " First find out if this file has a \bibliography command in it. If so, + " assume that this is the only file in the project which defines a + " bibliography. + if search('\\\(no\)\?bibliography{', 'w') + call Tex_Debug('Tex_ScanFileForCite: found bibliography command in '.bufname('%'), 'view') + " convey that we have found a bibliography command. we do not need to + " proceed any further. + let foundCiteFile = 1 + + " extract the bibliography filenames from the command. + let bibnames = matchstr(getline('.'), '\\\(no\)\?bibliography{\zs.\{-}\ze}') + let bibnames = substitute(bibnames, '\s', '', 'g') + + call Tex_Debug('trying to search through ['.bibnames.']', 'view') + + let &path = '.,'.g:Tex_BIBINPUTS + + let i = 1 + while 1 + let bibname = Tex_Strntok(bibnames, ',', i) + if bibname == '' + break + endif + + " first try to find if a .bib file exists. If so do not search in + " the corresponding .bbl file. (because the .bbl file will most + " probly be generated automatically from the .bib file with + " bibtex). + + let fname = Tex_FindFile(bibname, '.,'.g:Tex_BIBINPUTS, '.bib') + if fname != '' + call Tex_Debug('finding .bib file ['.bufname('%').']', 'view') + exec 'split '.Tex_EscapeSpaces(fname) + call Tex_Grepadd('@.*{'.a:prefix, "%") + q + else + let fname = Tex_FindFile(bibname, '.,'.g:Tex_BIBINPUTS, '.bbl') + if fname != '' + exec 'split '.Tex_EscapeSpaces(fname) + call Tex_Debug('finding .bbl file ['.bufname('.').']', 'view') + call Tex_Grepadd('\\bibitem{'.a:prefix, "%") + q + endif + endif + + let i = i + 1 + endwhile + + if foundCiteFile + return 1 + endif + endif + + " If we have a thebibliography environment, then again assume that this is + " the only file which defines the bib-keys. Aand convey this information + " upwards by returning 1. + if search('^\s*\\begin{thebibliography}', 'w') + call Tex_Debug('got a thebibliography environment in '.bufname('%'), 'view') + + let foundCiteFile = 1 + + split + exec 'lcd'.fnameescape(expand('%:p:h')) + call Tex_Debug("silent! grepadd! ".Tex_EscapeForGrep('\\bibitem{'.a:prefix)." %", 'view') + call Tex_Grepadd('\\bibitem\s*[\[|{]'.a:prefix, "%") + q + + return 1 + endif + + " If we have not found any \bibliography or \thebibliography environment + " in this file, search for these environments in all the files which this + " file includes. + + exec 0 + let wrap = 'w' + while search('^\s*\\\(input\|include\)', wrap) + let wrap = 'W' + + let filename = matchstr(getline('.'), '\\\(input\|include\){\zs.\{-}\ze}') + + let foundfile = Tex_FindFile(filename, '.,'.g:Tex_TEXINPUTS, '.tex') + if foundfile != '' + exec 'split '.Tex_EscapeSpaces(foundfile) + call Tex_Debug('scanning recursively in ['.foundfile.']', 'view') + let foundCiteFile = Tex_ScanFileForCite(a:prefix) + q + endif + + if foundCiteFile + return 1 + endif + endwhile + + + return 0 +endfunction " }}} +" Tex_ScanFileForLabels: greps present file and included files for \\label's {{{ +" Description: +" Grep the presently edited file for \\label's. If the present file \include's +" or \input's other files, then recursively scan those as well, i.e we support +" arbitrary levels of \input'ed-ness. +function! Tex_ScanFileForLabels(prefix) + call Tex_Debug("+Tex_ScanFileForLabels: grepping in file [".bufname('%')."]", "view") + + exec 'lcd'.fnameescape(expand('%:p:h')) + call Tex_Grepadd('\\label{'.a:prefix, "%") + + " Then recursively grep for all \include'd or \input'ed files. + exec 0 + let wrap = 'w' + while search('^\s*\\\(input\|include\)', wrap) + let wrap = 'W' + + let filename = matchstr(getline('.'), '\\\(input\|include\){\zs.\{-}\ze}') + let foundfile = Tex_FindFile(filename, '.,'.Tex_TEXINPUTS, '.tex') + if foundfile != '' + exec 'split '.Tex_EscapeSpaces(foundfile) + call Tex_Debug('Tex_ScanFileForLabels: scanning recursively in ['.foundfile.']', 'view') + call Tex_ScanFileForLabels(a:prefix) + q + endif + endwhile + +endfunction " }}} + +" ============================================================================== +" Functions for custom command completion +" ============================================================================== +" Tex_completion_{var}: similar variables can be set in package files {{{ +let g:Tex_completion_bibliographystyle = 'abbr,alpha,plain,unsrt' +let g:Tex_completion_addtocontents = 'lof}{,lot}{,toc}{' +let g:Tex_completion_addcontentsline = 'lof}{figure}{,lot}{table}{,toc}{chapter}{,toc}{part}{,'. + \ 'toc}{section}{,toc}{subsection}{,toc}{paragraph}{,'. + \ 'toc}{subparagraph}{' +" }}} +" Tex_PromptForCompletion: prompts for a completion {{{ +" Description: +function! s:Tex_PromptForCompletion(texcommand,ask) + + let common_completion_prompt = + \ Tex_CreatePrompt(g:Tex_completion_{a:texcommand}, 2, ',') . "\n" . + \ 'Enter number or completion: ' + + let inp = input(a:ask."\n".common_completion_prompt) + if inp =~ '^[0-9]\+$' + let completion = Tex_Strntok(g:Tex_completion_{a:texcommand}, ',', inp) + else + let completion = inp + endif + + return completion +endfunction " }}} +" Tex_DoCompletion: fast insertion of completion {{{ +" Description: +" +function! s:Tex_DoCompletion(texcommand) + let completion = <SID>Tex_PromptForCompletion(a:texcommand, 'Choose a completion to insert: ') + if completion != '' + return completion + else + return '' + endif +endfunction " }}} + +" ============================================================================== +" Functions for presenting an outlined version for completion +" ============================================================================== +" Tex_StartOutlineCompletion: sets up an outline window {{{ + +" get the place where this plugin resides for setting cpt and dict options. +" these lines need to be outside the function. +let s:path = expand('<sfile>:p:h') +if has('python') && Tex_GetVarValue('Tex_UsePython') + python import sys, re + exec "python sys.path += [r'". s:path . "']" + python import outline +endif + +function! Tex_StartOutlineCompletion() + let mainfname = Tex_GetMainFileName(':p') + + " open the buffer + let _report = &report + let _cmdheight=&cmdheight + let _lazyredraw = &lazyredraw + set report=1000 + set cmdheight=1 + set lazyredraw + + if has('python') && Tex_GetVarValue('Tex_UsePython') + python retval = outline.main(vim.eval("Tex_GetMainFileName(':p')"), vim.eval("s:prefix")) + + " transfer variable from python to a local variable. + python vim.command("""let retval = "%s" """ % re.sub(r'"|\\', r'\\\g<0>', retval)) + else + let retval = system(shellescape(s:path.'/outline.py').' '.shellescape(mainfname).' '.shellescape(s:prefix)) + endif + + bot split __OUTLINE__ + exec Tex_GetVarValue('Tex_OutlineWindowHeight', 15).' wincmd _' + + setlocal modifiable + setlocal noswapfile + setlocal buftype=nowrite + setlocal bufhidden=delete + setlocal nowrap + setlocal foldmethod=marker + setlocal foldmarker=<<<,>>> + + " delete everything in it to the blackhole + % d _ + 0put!=retval + + 0 + + call Tex_SetupOutlineSyntax() + + exec 'nnoremap <buffer> <cr> ' + \ .':cd '.s:origdir.'<CR>' + \ .':call Tex_FinishOutlineCompletion()<CR>' + exec 'nnoremap <buffer> q ' + \ .':cd '.s:origdir.'<CR>' + \ .':close<CR>' + \ .':call Tex_SwitchToInsertMode()<CR>' + + " once the buffer is initialized, go back to the original settings. + setlocal nomodifiable + setlocal nomodified + let &report = _report + let &cmdheight = _cmdheight + let &lazyredraw = _lazyredraw + +endfunction " }}} +" Tex_SetupOutlineSyntax: sets up the syntax items for the outline {{{ +" Description: +function! Tex_SetupOutlineSyntax() + syn match outlineFileName "<\f\+>$" contained + syn match foldMarkers "<<<\d$" contained + syn match firstSemiColon '^:' contained + syn match firstAngle '^>' contained + + syn match sectionNames '\(\d\.\)\+ .*' contains=foldMarkers + syn match previousLine '^:.*' contains=firstSemiColon + syn match labelLine '^>.*' contains=firstAngle,outlineFileName + + hi def link outlineFileName Ignore + hi def link foldMarkers Ignore + hi def link firstSemiColon Ignore + hi def link firstAngle Ignore + + hi def link sectionNames Type + hi def link previousLine Special + hi def link labelLine Comment +endfunction " }}} +" Tex_FinishOutlineCompletion: inserts the reference back in the text {{{ +function! Tex_FinishOutlineCompletion() + if getline('.') !~ '^[>:]' + return + endif + + if getline('.') =~ '^>' + let ref_complete = matchstr(getline('.'), '^>\s\+\zs\S\+\ze') + elseif getline('.') =~ '^:' + let ref_complete = matchstr(getline(line('.')-1), '^>\s\+\zs\S\+\ze') + endif + + close + call Tex_CompleteWord(ref_complete, strlen(s:prefix)) +endfunction " }}} + +" ============================================================================== +" Functions for presenting a nicer list of bibtex entries +" ============================================================================== +" Tex_FindBibFiles: finds all .bib files used by the main file {{{ +" Description: +function! Tex_FindBibFiles() + call Tex_Debug(":Tex_FindBibFiles: ", "view") + + let mainfname = Tex_GetMainFileName(':p') + wincmd n + exec 'silent! e '.fnameescape(mainfname) + + if search('\\\(no\)\?bibliography{', 'w') + + call Tex_Debug('Tex_FindBibFiles: found bibliography command in '.bufname('%'), 'view') + + " extract the bibliography filenames from the command. + let bibnames = matchstr(getline('.'), '\\\(no\)\?bibliography{\zs.\{-}\ze}') + let bibnames = substitute(bibnames, '\s', '', 'g') + + call Tex_Debug(':Tex_FindBibFiles: trying to search through ['.bibnames.']', 'view') + + let bibfiles = '' + let i = 1 + while 1 + let bibname = Tex_Strntok(bibnames, ',', i) + if bibname == '' + break + endif + let fname = Tex_FindFile(bibname, '.,'.g:Tex_BIBINPUTS, '.bib') + if fname != '' + let bibfiles = bibfiles.fname."\n" + endif + let i = i + 1 + endwhile + + call Tex_Debug(":Tex_FindBibFiles: returning [".bibfiles."]", "view") + q + return bibfiles + + else + q + return '' + endif + +endfunction " }}} +" Tex_StartBibtexOutline: sets up an outline window {{{ + +" get the place where this plugin resides for setting cpt and dict options. +" these lines need to be outside the function. +if has('python') && Tex_GetVarValue('Tex_UsePython') + python import sys, re + exec "python sys.path += [r'". s:path . "']" + python import bibtools +endif + +function! Tex_StartCiteCompletion() + let bibfiles = Tex_FindBibFiles() + if bibfiles !~ '\S' + call Tex_SwitchToInsertMode() + echohl WarningMsg + echomsg 'No bibfiles found! Sorry' + echohl None + return + endif + + bot split __OUTLINE__ + exec Tex_GetVarValue('Tex_OutlineWindowHeight', 15).' wincmd _' + + exec 'python Tex_BibFile = bibtools.BibFile("""'.bibfiles.'""")' + exec 'python Tex_BibFile.addfilter("key ^'.s:prefix.'")' + call Tex_DisplayBibList() + + nnoremap <Plug>Tex_JumpToNextBibEntry :call search('^\S.*\]$', 'W')<CR>:call Tex_EchoBibShortcuts()<CR>z. + nnoremap <Plug>Tex_JumpToPrevBibEntry :call search('^\S.*\]$', 'bW')<CR>:call Tex_EchoBibShortcuts()<CR>z. + nnoremap <Plug>Tex_FilterBibEntries :call Tex_HandleBibShortcuts('filter')<CR> + nnoremap <Plug>Tex_RemoveBibFilters :call Tex_HandleBibShortcuts('remove_filters')<CR> + nnoremap <Plug>Tex_SortBibEntries :call Tex_HandleBibShortcuts('sort')<CR> + nnoremap <Plug>Tex_CompleteCiteEntry :call Tex_CompleteCiteEntry()<CR> + + nmap <buffer> <silent> n <Plug>Tex_JumpToNextBibEntry + nmap <buffer> <silent> p <Plug>Tex_JumpToPrevBibEntry + nmap <buffer> <silent> f <Plug>Tex_FilterBibEntries + nmap <buffer> <silent> s <Plug>Tex_SortBibEntries + nmap <buffer> <silent> a <Plug>Tex_RemoveBibFilters + nmap <buffer> <silent> q :close<CR>:call Tex_SwitchToInsertMode()<CR> + nmap <buffer> <silent> <CR> <Plug>Tex_CompleteCiteEntry + +endfunction " }}} +" Tex_DisplayBibList: displays the list of bibtex entries {{{ +" Description: +function! Tex_DisplayBibList() + " open the buffer + let _report = &report + let _cmdheight=&cmdheight + let _lazyredraw = &lazyredraw + set report=1000 + set cmdheight=1 + set lazyredraw + + setlocal modifiable + setlocal noswapfile + setlocal buftype=nowrite + setlocal bufhidden=delete + setlocal nowrap + setlocal foldmethod=marker + setlocal foldmarker=<<<,>>> + + + " delete everything in it to the blackhole + % d _ + + exec 'python Tex_CurBuf = vim.current.buffer' + exec 'python Tex_CurBuf[:] = str(Tex_BibFile).splitlines()' + + call Tex_SetupBibSyntax() + + 0 + call Tex_EchoBibShortcuts() + + " once the buffer is initialized, go back to the original settings. + setlocal nomodifiable + setlocal nomodified + let &report = _report + let &cmdheight = _cmdheight + let &lazyredraw = _lazyredraw + +endfunction " }}} +" Tex_EchoBibShortcuts: echos all the shortcuts in the status line {{{ +" Description: +function! Tex_EchoBibShortcuts() + echomsg '(a) all (f) filter (s) sort (n) next (p) previous (q) quit (<CR>) choose' +endfunction " }}} +" Tex_SetupBibSyntax: sets up the syntax items for the outline {{{ +" Description: +function! Tex_SetupBibSyntax() + syn match BibTitleHeader "^TI" contained + syn match BibAuthorHeader "^AU" contained + syn match BibLocationHeader "^IN" contained + syn match BibMiscHeader "^MI" contained + + syn match BibKeyLine '^\S.*\]$' contains=BibKey + syn match BibTitle "^TI .*" contains=BibTitleHeader + syn match BibAuthor "^AU .*" contains=BibAuthorHeader + syn match BibLocation "^IN .*" contains=BibLocationHeader + syn match BibMisc "^MI .*" contains=BibMiscHeader + + hi def link BibTitleHeader Ignore + hi def link BibAuthorHeader Ignore + hi def link BibLocationHeader Ignore + hi def link BibMiscHeader Ignore + + hi def link BibKeyLine Visual + hi def link BibTitle Type + hi def link BibAuthor Special + hi def link BibLocation Comment + hi def link BibMisc Comment +endfunction " }}} +" Tex_HandleBibShortcuts: handles user keypresses {{{ +" Description: +function! Tex_HandleBibShortcuts(command) + + if a:command == 'filter' || a:command == 'sort' + + let fieldprompt = + \ "Field acronyms: (`:let g:Tex_EchoBibFields = 0` to avoid this message)\n" . + \ " [t] title [a] author [b] booktitle \n" . + \ " [j] journal [y] year [p] bibtype \n" . + \ " (you can also enter the complete field name) \n" + + let fieldprompt = Tex_GetVarValue('Tex_BibFieldPrompt', fieldprompt) + + if Tex_GetVarValue('Tex_EchoBibFields', 1) == 1 + echo fieldprompt + endif + + let inp = input('Enter '.a:command.' criterion [field<space>value]: ') + if inp !~ '\v^\S+\s+\S.*' + echohl WarningMsg + echomsg 'Invalid filter specification. Use "field<space>value"' + echohl None + return + endif + + if inp != '' + " If the field is specified as a single character, then replace + " it with the corresponding 'full form'. + if inp =~ '^[a-z]\>' + if Tex_GetVarValue('Tex_BibAcronym_'.inp[0]) != '' + let inp = substitute(inp, '.', Tex_GetVarValue('Tex_BibAcronym_'.inp[0]), '') + elseif fieldprompt =~ '\['.inp[0].'\]' + let full = matchstr(fieldprompt, '\['.inp[0].'\] \zs\w\+\ze') + let inp = substitute(inp, '.', full, '') + endif + endif + call Tex_Debug(":Tex_HandleBibShortcuts: using inp = [".inp."]", "view") + if a:command == 'filter' + exec 'python Tex_BibFile.addfilter("'.inp.'")' + elseif a:command == 'sort' + exec "python Tex_BibFile.addsortfield(\"".inp."\")" + exec 'python Tex_BibFile.sort()' + endif + silent! call Tex_DisplayBibList() + endif + + elseif a:command == 'remove_filters' + + exec 'python Tex_BibFile.rmfilters()' + exec 'python Tex_BibFile.addfilter("key ^'.s:prefix.'")' + call Tex_DisplayBibList() + + endif + +endfunction " }}} +" Tex_CompleteCiteEntry: completes cite entry {{{ +" Description: +function! Tex_CompleteCiteEntry() + normal! 0 + call search('\[\S\+\]$', 'W') + if getline('.') !~ '\[\S\+\]$' + call search('\[\S\+\]$', 'bW') + endif + + if getline('.') !~ '\[\S\+\]$' + return + endif + + let ref = matchstr(getline('.'), '\[\zs\S\+\ze\]$') + close + call Tex_Debug(":Tex_CompleteCiteEntry: completing with ".ref, "view") + call Tex_CompleteWord(ref, strlen(s:prefix)) +endfunction " }}} + +" Tex_SwitchToInsertMode: Switch to insert mode {{{ +" Description: This is usually called when completion is finished +function! Tex_SwitchToInsertMode() + call Tex_Debug(":Tex_SwitchToInsertMode: ", "view") + if col('.') == strlen(getline('.')) + startinsert! + else + normal! l + startinsert + endif +endfunction " }}} + +com! -nargs=0 TClearCiteHist unlet! s:citeSearchHistory + +" vim:fdm=marker:nowrap:noet:ff=unix:ts=4:sw=4 diff --git a/.vim/ftplugin/latex-suite/version.vim b/.vim/ftplugin/latex-suite/version.vim @@ -0,0 +1,30 @@ +" Tex_Version: returns a string which gives the current version number of latex-suite +" Description: +" Each time a bug fix/addition is done in any source file in latex-suite, +" not just this file, the number below has to be incremented by the author. +" This will ensure that there is a single 'global' version number for all of +" latex-suite. +" +" If a change is done in the doc/ directory, i.e an addition/change in the +" documentation, then this number should NOT be incremented. +" +" Latex-suite will follow a 3-tier system of versioning just as Vim. A +" version number will be of the form: +" +" X.Y.ZZ +" +" 'X' will only be incremented for a major over-haul or feature addition. +" 'Y' will be incremented for significant changes which do not qualify +" as major. +" 'ZZ' will be incremented for bug-fixes and very trivial additions such +" as adding an option etc. Once ZZ reaches 50, then Y will be +" incremented and ZZ will be reset to 01. Each time we have a +" version number of the form X.Y.01, then we'll make a release on +" vim.sf.net and also create a cvs tag at that point. We'll try to +" "stabilize" that version by releasing a few pre-releases and then +" keep that as a stable point. +function! Tex_Version() + return "Latex-Suite: version 1.8.23" +endfunction + +com! -nargs=0 TVersion echo Tex_Version() diff --git a/.vim/ftplugin/latex-suite/wizardfuncs.vim b/.vim/ftplugin/latex-suite/wizardfuncs.vim @@ -0,0 +1,376 @@ +" File: wizardfuncs.vim +" Author: Mikolaj Machowski <mikmach@wp.pl> +" Description: +" +" Installation: +" History: pluginized by Srinath Avadhanula +"============================================================================= + +if exists('s:doneOnce') + finish +endif +let s:doneOnce = 1 + +let s:mapleader = exists('mapleader') ? mapleader : "\\" +" ============================================================================== +" Specialized functions for handling sections from command line +" ============================================================================== + +com! -nargs=? TSection call Tex_section(<f-args>) +com! -nargs=? TSectionAdvanced call Tex_section_adv(<f-args>) + +" Tex_VisSecAdv: handles visual selection for sections {{{ +function! Tex_VisSecAdv(section) + let shorttitle = input("Short title? ") + let toc = input("Include in table of contents [y]/n ? ") + let sstructure = "\\".a:section + if ( toc == "" || toc == "y" ) + let toc = "" + else + let toc = "*" + endif + if shorttitle != "" + let shorttitle = '['.shorttitle.']' + endif + exe "normal `>a}\<cr>\<esc>`<i".sstructure.toc.shorttitle."{" +endfunction + +" }}} +" Tex_InsSecAdv: section wizard in insert mode {{{ +function! Tex_InsSecAdv(structure) + let ttitle = input("Title? ") + let shorttitle = input("Short title? ") + let toc = input("Include in table of contents [y]/n ? ") + "Structure + let sstructure = "\\".a:structure + "TOC + if ( toc == "" || toc == "y" ) + let toc = "" + else + let toc = "*" + endif + "Shorttitle + if shorttitle != "" + let shorttitle = '['.shorttitle.']' + endif + "Title + let ttitle = '{'.ttitle.'}' + "Happy end? + return sstructure.toc.shorttitle.ttitle +endfunction + +" }}} +function! Tex_section(...) "{{{ + silent let pos = Tex_GetPos() + silent let last_section_value = s:Tex_section_detection() + if a:0 == 0 + silent let last_section_name = s:Tex_section_name(last_section_value) + silent call s:Tex_section_call(last_section_name) + elseif a:1 =~ "[+=\-]" + silent let sec_arg = a:1 + silent let curr_section_value = s:Tex_section_curr_rel_value(sec_arg, last_section_value) + silent let curr_section_name = s:Tex_section_name(curr_section_value) + silent call s:Tex_section_call(curr_section_name) + elseif a:1 == "?" + echo s:last_section_line + else + silent let curr_section_value = s:Tex_section_curr_value(a:1) + silent let curr_section_name = s:Tex_section_name(curr_section_value) + silent call s:Tex_section_call(curr_section_name) + endif + silent call Tex_SetPos(pos) +endfunction "}}} +function! Tex_section_adv(...) "{{{ + let pos = Tex_GetPos() + silent let last_section_value = s:Tex_section_detection() + if a:0 == 0 + silent let last_section_name = s:Tex_section_name(last_section_value) + let section = Tex_InsSecAdv(last_section_name) + elseif a:1 =~ "[+=\-]" + silent let sec_arg = a:1 + silent let curr_section_value = s:Tex_section_curr_rel_value(sec_arg, last_section_value) + silent let curr_section_name = s:Tex_section_name(curr_section_value) + let section = Tex_InsSecAdv(curr_section_name) + else + silent let curr_section_value = s:Tex_section_curr_value(a:1) + silent let curr_section_name = s:Tex_section_name(curr_section_value) + silent call s:Tex_section_call(curr_section_name) + let section = Tex_InsSecAdv(curr_section_name) + endif + exe "normal i".section + call Tex_SetPos(pos) +endfunction "}}} +function! s:Tex_section_detection() "{{{ + let pos = Tex_GetPos() + let last_section1 = search("\\\\\subparagraph\\|\\\\paragraph\\|\\\\subsubsection\\|\\\\subsection\\|\\\\section\\|\\\\chapter\\|\\\part\)", "b") + call Tex_SetPos(pos) + let last_section2 = search("\\\\\part\\|\\\\chapter\\|\\\\section\\|\\\\subsection\\|\\\\subsubsection\\|\\\\paragraph\\|\\\subparagraph\)", "b") + if last_section1 > last_section2 + let last_section = last_section1 + else + let last_section = last_section2 + endif + if last_section != 0 + exe last_section + if getline(".") =~ "\\\\part" + let last_section_value = 0 + elseif getline(".") =~ "\\\\chapter" + let last_section_value = 1 + elseif getline(".") =~ "\\\\section" + let last_section_value = 2 + elseif getline(".") =~ "\\\\subsection" + let last_section_value = 3 + elseif getline(".") =~ "\\\\subsubsection" + let last_section_value = 4 + elseif getline(".") =~ "\\\\paragraph" + let last_section_value = 5 + elseif getline(".") =~ "\\\\subparagraph" + let last_section_value = 6 + endif + let s:last_section_line = getline(".") + else + let last_section_value = 0 + endif + call Tex_SetPos(pos) + return last_section_value +endfunction "}}} +function! s:Tex_section_curr_value(sec_arg) "{{{ + if a:sec_arg == "pa" || a:sec_arg == "0" || a:sec_arg == "part" + let curr_section_value = 0 + elseif a:sec_arg == "ch" || a:sec_arg == "1" || a:sec_arg == "chapter" + let curr_section_value = 1 + elseif a:sec_arg == "se" || a:sec_arg == "2" || a:sec_arg == "section" + let curr_section_value = 2 + elseif a:sec_arg == "ss" || a:sec_arg == "3" || a:sec_arg == "subsection" + let curr_section_value = 3 + elseif a:sec_arg == "s2" || a:sec_arg == "4" || a:sec_arg == "subsubsection" + let curr_section_value = 4 + elseif a:sec_arg == "pr" || a:sec_arg == "5" || a:sec_arg == "paragraph" + let curr_section_value = 5 + elseif a:sec_arg == "sp" || a:sec_arg == "6" || a:sec_arg == "subparagraph" + let curr_section_value = 6 + endif + return curr_section_value +endfunction "}}} +function! s:Tex_section_curr_rel_value(sec_arg, last_section_value) "{{{ + let last_section_value = a:last_section_value + if a:sec_arg == "+" || a:sec_arg == "+1" + let curr_section_value = last_section_value + 1 + elseif a:sec_arg == "++" || a:sec_arg == "+2" + let curr_section_value = last_section_value + 2 + elseif a:sec_arg == "-" || a:sec_arg == "-1" + let curr_section_value = last_section_value - 1 + elseif a:sec_arg == "--" || a:sec_arg == "-2" + let curr_section_value = last_section_value - 2 + elseif a:sec_arg == "=" + let curr_section_value = last_section_value + else + exe "let curr_section_value = last_section_value".a:sec_arg + endif + if curr_section_value < 0 + let curr_section_value = 0 + elseif curr_section_value > 6 + let curr_section_value = 6 + endif + return curr_section_value +endfunction "}}} +function! s:Tex_section_name(section_value) "{{{ + if a:section_value == 0 + let section_name = "part" + elseif a:section_value == 1 + let section_name = "chapter" + elseif a:section_value == 2 + let section_name = "section" + elseif a:section_value == 3 + let section_name = "subsection" + elseif a:section_value == 4 + let section_name = "subsubsection" + elseif a:section_value == 5 + let section_name = "paragraph" + elseif a:section_value == 6 + let section_name = "subparagraph" + endif + return section_name +endfunction "}}} +function! s:Tex_section_call(section_name) "{{{ + exe "normal! i\\".a:section_name."{<++>}<++>\<Esc>0\<C-j>" +" let ret_section = "\\".a:section_name."{<++>}<++>" +" exe "normal! i\<C-r>=IMAP_PutTextWithMovement(ret_section)\<CR>" +" normal f}i +endfunction "}}} + +" ============================================================================== +" Add looking help into latexhelp.txt +" ============================================================================== + +inoremap <silent> <Plug>Tex_Help <C-o>:call <SID>TexHelp()<CR> +nnoremap <silent> <Plug>Tex_Help :call <SID>TexHelp()<CR> +command! -nargs=0 THelp call <SID>TexHelp() +call Tex_MakeMap('<F1>', '<Plug>Tex_Help', 'i', '') +call Tex_MakeMap('<F1>', '<Plug>Tex_Help', 'n', '') + +" TexHelp: Cursor being on LaTeX item check if exists help tag about it " {{{ +function! s:TexHelp() + let syntax_item = synIDattr(synID(line('.'),col('.')-1,0),"name") + if syntax_item =~ '^tex' + setlocal isk+=\ + let curword = expand('<cword>') + setlocal isk-=\ + let v:errmsg = '' + if curword =~ "^\\" || syntax_item == 'texSectionName' + exe 'silent! help '.curword + if v:errmsg =~ '^E149:' + echohl ErrorMsg + exe "echomsg 'Sorry, no help for LaTeX: ".curword."'" + echohl None + let v:errmsg = '' + endif + else + help + endif + else + help + endif +endfunction " }}} + +" ============================================================================== +" Tables of shortcuts +" ============================================================================== +" +command! -nargs=? Tshortcuts call Tex_shortcuts(<f-args>)<CR> + +" Tex_shortcuts: Show shortcuts in terminal after : command {{{ +function! Tex_shortcuts(...) + if a:0 == 0 + let shorts = input(" Allowed arguments are:" + \."\n g General" + \."\n e Environments" + \."\n f Fonts" + \."\n s Sections" + \."\n m Math" + \."\n a All" + \."\n Enter your choice (<Enter> quits) : ") + call Tex_shortcuts(shorts) + elseif a:1 == 'g' + echo g:generalshortcuts + elseif a:1 == 'e' + echo g:environmentshortcuts + elseif a:1 == 'f' + echo g:fontshortcuts + elseif a:1 == 's' + echo g:sectionshortcuts + elseif a:1 == 'm' + echo g:mathshortcuts + elseif a:1 == 'a' + echo g:generalshortcuts + echo g:environmentshortcuts + echo g:fontshortcuts + echo g:sectionshortcuts + echo g:mathshortcuts + endif + +endfunction +" }}} + +" General shortcuts {{{ +let g:generalshortcuts = '' +\."\n General shortcuts" +\."\n <mapleader> is a value of <Leader>" +\."\n ".s:mapleader.'ll compile whole document' +\."\n ".s:mapleader.'lv view compiled document' +\."\n ".s:mapleader.'ls forward searching (if possible)' +\."\n ".s:mapleader.'rf refresh folds' +" }}} +" Environment shortcuts {{{ +let g:environmentshortcuts = '' +\."\n Environment shortcuts" +\."\n <mapleader> is a value of g:Tex_Leader2" +\."\n I v&V I v&V" +\."\n ELI ".g:Tex_Leader2."li list EQN ".g:Tex_Leader2."qn quotation" +\."\n EDE ".g:Tex_Leader2."de description ESP ".g:Tex_Leader2."sb sloppypar" +\."\n EEN ".g:Tex_Leader2."en enumerate ETI ".g:Tex_Leader2."ti theindex" +\."\n EIT ".g:Tex_Leader2."it itemize ETP ".g:Tex_Leader2."tp titlepage" +\."\n ETI ".g:Tex_Leader2."ti theindex EVM ".g:Tex_Leader2."vm verbatim" +\."\n ETL ".g:Tex_Leader2."tl trivlist EVE ".g:Tex_Leader2."ve verse" +\."\n ETE ".g:Tex_Leader2."te table ETB ".g:Tex_Leader2."tb thebibliography" +\."\n ETG ".g:Tex_Leader2."tg tabbing ENO ".g:Tex_Leader2."no note" +\."\n ETR ".g:Tex_Leader2."tr tabular EOV ".g:Tex_Leader2."ov overlay" +\."\n EAR ".g:Tex_Leader2."ar array ESL ".g:Tex_Leader2."sl slide" +\."\n EDM ".g:Tex_Leader2."dm displaymath EAB ".g:Tex_Leader2."ab abstract" +\."\n EEA ".g:Tex_Leader2."ea eqnarray EAP ".g:Tex_Leader2."ap appendix" +\."\n EEQ ".g:Tex_Leader2."eq equation ECE ".g:Tex_Leader2."ce center" +\."\n EDO ".g:Tex_Leader2."do document EFI ".g:Tex_Leader2."fi figure" +\."\n EFC ".g:Tex_Leader2."fc filecontents ELR ".g:Tex_Leader2."lr lrbox" +\."\n EFL ".g:Tex_Leader2."fl flushleft EMP ".g:Tex_Leader2."mp minipage" +\."\n EFR ".g:Tex_Leader2."fr flushright EPI ".g:Tex_Leader2."pi picture" +\."\n EMA ".g:Tex_Leader2."ma math EQE ".g:Tex_Leader2."qe quote" +" }}} +" Font shortcuts {{{ +let g:fontshortcuts = '' +\."\n Font shortcuts" +\."\n <mapleader> is a value of g:Tex_Leader" +\."\n Shortcuts Effects" +\."\n I v&V I&v V" +\."\n FBF ".g:Tex_Leader."bf \\textbf{} {\\bfseries }" +\."\n FMD ".g:Tex_Leader."md \\textmd{} {\\mdseries }" +\."\n" +\."\n FTT ".g:Tex_Leader."tt \\texttt{} {\\ttfamily }" +\."\n FSF ".g:Tex_Leader."sf \\textsf{} {\\sffamily }" +\."\n FRM ".g:Tex_Leader."rm \\textrm{} {\\rmfamily }" +\."\n" +\."\n FUP ".g:Tex_Leader."up \\textup{} {\\upshape }" +\."\n FSL ".g:Tex_Leader."sl \\textsl{} {\\slshape }" +\."\n FSC ".g:Tex_Leader."sc \\textsc{} {\\scshape }" +\."\n FIT ".g:Tex_Leader."it \\textit{} {\\itshape }" +" }}} +" Section shortcuts {{{ +let g:sectionshortcuts = '' +\."\n Section shortcuts" +\."\n <mapleader> is a value of g:Tex_Leader2" +\."\n I v&V" +\."\n SPA ".g:Tex_Leader2."pa part" +\."\n SCH ".g:Tex_Leader2."ch chapter" +\."\n SSE ".g:Tex_Leader2."se section" +\."\n SSS ".g:Tex_Leader2."ss subsection" +\."\n SS2 ".g:Tex_Leader2."s2 subsubsection" +\."\n SPG ".g:Tex_Leader2."pg paragraph" +\."\n SSP ".g:Tex_Leader2."sp subparagraph" +" }}} +" Math shortcuts {{{ +let g:mathshortcuts = '' +\."\n Math shortcuts - Insert mode" +\."\n `a \\alpha `b \\beta" +\."\n `g \\gamma `d \\delta" +\."\n `e \\varepsilon `z \\zeta" +\."\n `h \\eta `q \\theta" +\."\n `i \\iota `k \\kappa" +\."\n `l \\lambda `m \\mu" +\."\n `n \\nu `x \\xi" +\."\n `p \\pi `r \\rho" +\."\n `s \\sigma `v \\varsigma" +\."\n `t \\tau `u \\upsilon" +\."\n `f \\varphi `c \\chi" +\."\n `y \\psi `w \\omega" +\."\n `A \\Alpha `B \\Beta" +\."\n `G \\Gamma `D \\Delta" +\."\n `E \\Epsilon `Z \\mathrm{Z}" +\."\n `H \\Eta `K \\Kappa" +\."\n `L \\Lambda `M \\Mu" +\."\n `N \\Nu `X \\Xi" +\."\n `P \\Pi `R \\Rho" +\."\n `S \\Sigma `T \\Tau" +\."\n `U \\Upsilon `C \\Chi" +\."\n `Y \\Psi `W \\Omega" +\."\n `( \\subset `) \\Subset" +\."\n `= \\equiv =~ \\approx" +\."\n `- \\bigcap `+ \\bigcup" +\."\n `. \\cdot `* \\times" +\."\n `\\ \\setminus `@ \\circ" +\."\n `& \\wedge `, \\nonumber" +\."\n `8 \\infty `_ \\bar{}" +\."\n `: \\ddot{} `; \\dot{}" +\."\n `^ \\hat{} `~ \\tilde{}" +\."\n `6 \\partial" +" }}} + +" vim:fdm=marker:ff=unix:noet:ts=4:sw=4 diff --git a/.vim/ftplugin/matlab.vim b/.vim/ftplugin/matlab.vim @@ -0,0 +1,70 @@ +" Vim filetype plugin file + +" Language: matlab + +" Maintainer: Fabrice Guy <fabrice.guy at gmail dot com> + +" Last Changed: 2010 May 19 + + + +if exists("b:did_ftplugin") + + finish + +endif + +let b:did_ftplugin = 1 + + + +let s:save_cpo = &cpo + +set cpo-=C + + + +setlocal fo+=croql + +setlocal comments=:%>,:% + + + +if exists("loaded_matchit") + + let s:conditionalEnd = '\([-+{\*\:(\/]\s*\)\@<!\<end\>\(\s*[-+}\:\*\/)]\)\@!' + + let b:match_words = '\<classdef\>\|\<methods\>\|\<events\>\|\<properties\>\|\<if\>\|\<while\>\|\<for\>\|\<switch\>\|\<try\>\|\<function\>:' . s:conditionalEnd + +endif + + + +setlocal suffixesadd=.m + +setlocal suffixes+=.asv + +" Change the :browse e filter to primarily show M-files + +if has("gui_win32") && !exists("b:browsefilter") + + let b:browsefilter="M-files (*.m)\t*.m\n" . + + \ "All files (*.*)\t*.*\n" + +endif + + + +let b:undo_ftplugin = "setlocal suffixesadd< suffixes< " + + \ . "| unlet! b:browsefilter" + + \ . "| unlet! b:match_words" + + + +let &cpo = s:save_cpo + +" Execute file being edited with F5: +map <buffer> <F5> :w<CR>:!/Applications/MATLAB_R2010b.app/bin/matlab -nodesktop -nosplash -r "try, run %, pause, catch, end, quit" <CR> <CR> diff --git a/.vim/ftplugin/tex.vim b/.vim/ftplugin/tex.vim @@ -0,0 +1,25 @@ +let g:Tex_DefaultTargetFormat = 'pdf' + +let g:Tex_CompileRule_dvi = 'latex --interaction=nonstopmode $*' +let g:Tex_CompileRule_ps = 'dvips -Pwww -o $*.ps $*.dvi' +let g:Tex_CompileRule_pspdf = 'ps2pdf $*.ps' +let g:Tex_CompileRule_dvipdf = 'dvipdfm $*.dvi' +let g:Tex_CompileRule_pdf = 'pdflatex -synctex=1 --interaction=nonstopmode $*' + +let g:Tex_ViewRule_dvi = 'texniscope' +let g:Tex_ViewRule_ps = 'Preview' +let g:Tex_ViewRule_pdf = 'open -a Skim' + +let g:Tex_FormatDependency_ps = 'dvi,ps' +let g:Tex_FormatDependency_pspdf = 'dvi,ps,pspdf' +let g:Tex_FormatDependency_dvipdf = 'dvi,dvipdf' + +" let g:Tex_IgnoredWarnings =' +" \"Underfull\n". +" \"Overfull\n". +" \"specifier changed to\n". +" \"You have requested\n". +" \"Missing number, treated as zero.\n". +" \"There were undefined references\n". +" \"Citation %.%# undefined\n". +" \"\oval, \circle, or \line size unavailable\n"' diff --git a/.vim/ftplugin/tex_latexSuite.vim b/.vim/ftplugin/tex_latexSuite.vim @@ -0,0 +1,34 @@ +" LaTeX filetype +" Language: LaTeX (ft=tex) +" Maintainer: Srinath Avadhanula +" Email: srinath@fastmail.fm + +if !exists('s:initLatexSuite') + let s:initLatexSuite = 1 + exec 'so '.fnameescape(expand('<sfile>:p:h').'/latex-suite/main.vim') + + silent! do LatexSuite User LatexSuiteInitPost +endif + +silent! do LatexSuite User LatexSuiteFileType + +"" Run LaTeX through TexShop +"function! SRJ_runLatex() +" if &ft != 'tex' +" echo "calling srj_runLatex from a non-tex file" +" return '' +" end +" +" "write the file +" :w +" +" let thePath = getcwd() . '/'. expand("%") +" +" exec 'silent! !'.execString +" return '' +"endfunction +"no <expr> <D-r> SRJ_runLatex() +"vn <expr> <D-r> SRJ_runLatex() +"ino <expr> <D-r> SRJ_runLatex() +" + diff --git a/.vim/hg.zip b/.vim/hg.zip Binary files differ. diff --git a/.vim/indent/._matlab.vim b/.vim/indent/._matlab.vim Binary files differ. diff --git a/.vim/indent/matlab.vim b/.vim/indent/matlab.vim @@ -0,0 +1,146 @@ +" Matlab indent file +" Language: Matlab +" Maintainer: Fabrice Guy <fabrice.guy at gmail dot com> +" Last Change: 2009 Nov 23 - Added support for if/end block on the same line + +" Only load this indent file when no other was loaded. +if exists("b:did_indent") + finish +endif +let b:did_indent = 1 +let s:functionWithoutEndStatement = 0 + +setlocal indentexpr=GetMatlabIndent() +setlocal indentkeys=!,o,O=end,=case,=else,=elseif,=otherwise,=catch + +" Only define the function once. +if exists("*GetMatlabIndent") + finish +endif + +function! s:IsMatlabContinuationLine(lnum) + let continuationLine = 0 + if a:lnum > 0 + let pnbline = getline(prevnonblank(a:lnum)) + " if we have the line continuation operator (... at the end of a line or + " ... followed by a comment) it may be a line continuation + if pnbline =~ '\.\.\.\s*$' || pnbline =~ '\.\.\.\s*%.*$' + let continuationLine = 1 + " but if the ... are part of a string or a comment, it is not a + " continuation line + let col = match(pnbline, '\.\.\.\s*$') + if col == -1 + let col = match(pnbline, '\.\.\.\s*%.*$') + endif + if has('syntax_items') + if synIDattr(synID(prevnonblank(a:lnum), col + 1, 1), "name") =~ "matlabString" || + \ synIDattr(synID(prevnonblank(a:lnum), col + 1, 1), "name") =~ "matlabComment" + let continuationLine = 0 + endif + endif + endif + endif + return continuationLine +endfunction + +function GetMatlabIndent() + " Find a non-blank line above the current line. + let plnum = prevnonblank(v:lnum - 1) + + " If the previous line is a continuation line, get the beginning of the block to + " use the indent of that line + if s:IsMatlabContinuationLine(plnum - 1) + while s:IsMatlabContinuationLine(plnum - 1) + let plnum = plnum - 1 + endwhile + endif + + " At the start of the file use zero indent. + if plnum == 0 + return 0 + endif + + let curind = indent(plnum) + if s:IsMatlabContinuationLine(v:lnum - 1) + let curind = curind + &sw + endif + " Add a 'shiftwidth' after classdef, properties, switch, methods, events, + " function, if, while, for, otherwise, case, try, catch, else, elseif + if getline(plnum) =~ '^\s*\(classdef\|properties\|switch\|methods\|events\|function\|if\|while\|for\|otherwise\|case\|try\|catch\|else\|elseif\)\>' + let curind = curind + &sw + " In Matlab we have different kind of functions + " - the main function (the function with the same name than the filename) + " - the nested functions + " - the functions defined in methods (for classes) + " - subfunctions + " Principles for the indentation : + " - all the function keywords are indented (corresponding to the + " 'indent all functions' in the Matlab Editor) + " - if we have only subfonctions (ie if the main function doesn't have + " any mayching end), then each function is dedented + if getline(plnum) =~ '^\s*\function\>' + let pplnum = plnum - 1 + while pplnum > 1 && (getline(pplnum) =~ '^\s*%') + let pplnum = pplnum - 1 + endwhile + " If it is the main function, determine if function has a matching end + " or not + if pplnum <= 1 + " look for a matching end : + " - if we find a matching end everything is fine : end of functions + " will be dedented when 'end' is reached + " - if not, then all other functions are subfunctions : 'function' + " keyword has to be dedended + let old_lnum = v:lnum + let motion = plnum . "gg" + execute "normal" . motion + normal % + if getline(line('.')) =~ '^\s*end' + let s:functionWithoutEndStatement = 0 + else + let s:functionWithoutEndStatement = 1 + endif + normal % + let motion = old_lnum . "gg" + execute "normal" . motion + endif + endif + " if the for-end block (or while-end) is on the same line : dedent + if getline(plnum) =~ '\<end[,;]*\s*\(%.*\)\?$' + let curind = curind - &sw + endif + endif + + " Subtract a 'shiftwidth' on a else, elseif, end, catch, otherwise, case + if getline(v:lnum) =~ '^\s*\(else\|elseif\|end\|catch\|otherwise\|case\)\>' + let curind = curind - &sw + endif + " No indentation in a subfunction + if getline(v:lnum) =~ '^\s*\function\>' && s:functionWithoutEndStatement + let curind = curind - &sw + endif + " First case after a switch : indent + if getline(v:lnum) =~ '^\s*case' + while plnum > 0 && (getline(plnum) =~ '^\s*%' || getline(plnum) =~ '^\s*$') + let plnum = plnum - 1 + endwhile + if getline(plnum) =~ '^\s*switch' + let curind = indent(plnum) + &sw + endif + endif + + " end in a switch / end block : dedent twice + " we use the matchit script to know if this end is the end of a switch block + if exists("b:match_words") + if getline(v:lnum) =~ '^\s*end' + normal % + if getline(line('.')) =~ '^\s*switch' + let curind = curind - &sw + endif + normal % + end + end + return curind +endfunction + +" vim:sw=2 diff --git a/.vim/indent/tex.vim b/.vim/indent/tex.vim @@ -0,0 +1,141 @@ +" Vim indent file +" Language: LaTeX +" Maintainer: Johannes Tanzler <jtanzler@yline.com> +" Created: Sat, 16 Feb 2002 16:50:19 +0100 +" Last Change: Sun, 17 Feb 2002 00:09:11 +0100 +" Last Update: 18th feb 2002, by LH : +" (*) better support for the option +" (*) use some regex instead of several '||'. +" Version: 0.02 +" URL: comming soon: http://www.unet.univie.ac.at/~a9925098/vim/indent/tex.vim + +" --> If you're a Vim guru & and you find something that could be done in a +" better (perhaps in a more Vim-ish or Vi-ish) way, please let me know! + +" Options: {{{ +" +" To set the following options (ok, currently it's just one), add a line like +" let g:tex_indent_items = 1 +" to your ~/.vimrc. +" +" * g:tex_indent_items +" +" If this variable is set, item-environments are indented like Emacs does +" it, i.e., continuation lines are indented with a shiftwidth. +" +" NOTE: I've already set the variable below; delete the corresponding line +" if you don't like this behaviour. +" +" Per default, it is unset. +" +" set unset +" ---------------------------------------------------------------- +" \begin{itemize} \begin{itemize} +" \item blablabla \item blablabla +" bla bla bla bla bla bla +" \item blablabla \item blablabla +" bla bla bla bla bla bla +" \end{itemize} \end{itemize} +" +" +" This option applies to itemize, description, enumerate, and +" thebibliography. +" +" }}} + +" Delete the next line to avoid the special indention of items +if !exists("g:tex_indent_items") + let g:tex_indent_items = 1 +endif + +if exists("b:did_indent") | finish +endif +let b:did_indent = 1 + + +setlocal indentexpr=GetTeXIndent() +setlocal nolisp +setlocal nosmartindent +setlocal autoindent +setlocal indentkeys+=},=\\item,=\\bibitem + + +" Only define the function once +if exists("*GetTeXIndent") | finish +endif + + + +function GetTeXIndent() + + " Find a non-blank line above the current line. + let lnum = prevnonblank(v:lnum - 1) + + " At the start of the file use zero indent. + if lnum == 0 | return 0 + endif + + let ind = indent(lnum) + let line = getline(lnum) " last line + let cline = getline(v:lnum) " current line + + " Do not change indentation of commented lines. + if line =~ '^\s*%' + return ind + endif + + " Add a 'shiftwidth' after beginning of environments. + " Don't add it for \begin{document}, \begin{verbatim} and \begin{comment} + ""if line =~ '^\s*\\begin{\(.*\)}' && line !~ 'verbatim' + " LH modification : \begin does not always start a line + if line =~ '\\begin{\(.*\)}' && line !~ 'verbatim' + \ && line !~ 'document' + \ && line !~ 'comment' + + let ind = ind + &sw + + if g:tex_indent_items == 1 + " Add another sw for item-environments + if line =~ 'itemize\|description\|enumerate\|thebibliography' + let ind = ind + &sw + endif + endif + endif + + + " Subtract a 'shiftwidth' when an environment ends + if cline =~ '^\s*\\end' && cline !~ 'verbatim' + \&& cline !~ 'document' + \&& cline !~ 'comment' + + if g:tex_indent_items == 1 + " Remove another sw for item-environments + if cline =~ 'itemize\|description\|enumerate\|thebibliography' + let ind = ind - &sw + endif + endif + + let ind = ind - &sw + endif + + + " Special treatment for 'item' + " ---------------------------- + + if g:tex_indent_items == 1 + + " '\item' or '\bibitem' itself: + if cline =~ '^\s*\\\(bib\)\=item' + let ind = ind - &sw + endif + + " lines following to '\item' are intented once again: + if line =~ '^\s*\\\(bib\)\=item' + let ind = ind + &sw + endif + + endif + + return ind +endfunction + diff --git a/.vim/latextags b/.vim/latextags @@ -0,0 +1,11 @@ +#!/usr/bin/perl + +foreach $fname (@ARGV) { + $tags = `fgrep \\label $fname`; + @tagsList = split('\n', $tags); + foreach $tag (@tagsList) { + $tag =~ /.*\\label{([^}]*)}/; + $tagName = $1; + print "$tagName\t$fname\t/label{$tagName}/\n"; + } +} diff --git a/.vim/license.txt b/.vim/license.txt @@ -0,0 +1,24 @@ +Copyright (c) 2009, Fabrice +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/.vim/ltags b/.vim/ltags @@ -0,0 +1,78 @@ +#!/usr/bin/perl +# Author: Dimitri Antoniou <dimitri@risc2.aecom.yu.edu> +# usage: ltags filename +# handles: \label and \cite{ } with one or more arguments +# fails if arguments of cite spread over more than one line +# also searches in files that are \include or \input in the main file + +# get main LaTeX source file from command line: +$mainfile = shift; + +# get names of included files and store them in an array +open MAIN, $mainfile or die "$!" ; +@mainfile=<MAIN>; +@allsrcfiles = map{ /^\\(?:input|include){(.*?)}/ } @mainfile; +unshift @allsrcfiles, $mainfile; + +# loop over all source files +for $srcfile (@allsrcfiles) { + # if \input{fname} append .tex to fname + unless ( $srcfile =~ m/\.tex/ ) { $srcfile = $srcfile . "\.tex" } + open SRC, $srcfile or die "$!" ; + # store contents of source file in array @texfile + @texfile=<SRC>; + + # store lines with \label and \cite (or \citeonline) in arrays + @labelList = grep{ /\\label{/ } @texfile; + @citeList = grep{ /\\(cite|citeonline){/ } @texfile; + + # see if we use an external database; if yes, store its name in $bibfile + ($dbase) = grep{ /^\\bibliography{/ } @texfile; + if ($dbase) { + $dbase =~ m/\\bibliography{(.*?)}/; + $bibfile = $1; + } + + # write \bibitem in tags file + @mrefs=(); + @refs=(); + @multirefs=(); + foreach (@citeList) { + while ( m/\\(?:cite|citeonline){(.*?)}/g ) { + $refs = $1; + # if \cite has more than one argument, split them: + if ($refs =~ /,/) { + @mrefs = split /,/, $refs; + # there might be more than one \cite in a line: + push (@multirefs, @mrefs); + } + else { + @refs = ($refs); + push (@multirefs, @refs); + } + } + # in BibTeX, format is @ARTICLE{Name, }; in source file, \bibitem{Name} + for $ref (@multirefs) { + if ( $dbase ) { + push @unsorttag, "$ref\t$bibfile\t/{$ref,/\n" + } + else { + push @unsorttag, "$ref\t$srcfile\t/bibitem{$ref}/\n" + } + } + } + + # write \label in tag file + foreach (@labelList) { + m/\\label{(.*?)}/; + push @unsorttag, "$1\t$srcfile\t/label{$1}/\n"; + } +} + +# sort tag file; then, eliminate duplicates +@sortedtag = sort @unsorttag; +%seen = (); +@uniqtag = grep { ! $seen{$_} ++ } @sortedtag; + +open(TAGS, "> tags"); +print TAGS @uniqtag; diff --git a/.vim/plugin/._vcsbzr.vim b/.vim/plugin/._vcsbzr.vim Binary files differ. diff --git a/.vim/plugin/._vcscommand.vim b/.vim/plugin/._vcscommand.vim Binary files differ. diff --git a/.vim/plugin/._vcscvs.vim b/.vim/plugin/._vcscvs.vim Binary files differ. diff --git a/.vim/plugin/._vcsgit.vim b/.vim/plugin/._vcsgit.vim Binary files differ. diff --git a/.vim/plugin/._vcshg.vim b/.vim/plugin/._vcshg.vim Binary files differ. diff --git a/.vim/plugin/._vcssccs.vim b/.vim/plugin/._vcssccs.vim Binary files differ. diff --git a/.vim/plugin/._vcssvk.vim b/.vim/plugin/._vcssvk.vim Binary files differ. diff --git a/.vim/plugin/._vcssvn.vim b/.vim/plugin/._vcssvn.vim Binary files differ. diff --git a/.vim/plugin/SyntaxFolds.vim b/.vim/plugin/SyntaxFolds.vim @@ -0,0 +1,323 @@ +" ============================================================================== +" File: syntaxFolds.vim +" Author: Srinath Avadhanula +" ( srinath@fastmail.fm ) +" Last Change: Sun Oct 27 01:00 AM 2002 PST +" Description: Emulation of the syntax folding capability of vim using manual +" folding +" +" This script provides an emulation of the syntax folding of vim using manual +" folding. Just as in syntax folding, the folds are defined by regions. Each +" region is specified by a call to FoldRegions() which accepts 4 parameters: +" +" call FoldRegions(startpat, endpat, startoff, endoff) +" +" startpat: a line matching this pattern defines the beginning of a fold. +" endpat : a line matching this pattern defines the end of a fold. +" startoff: this is the offset from the starting line at which folding will +" actually start +" endoff : like startoff, but gives the offset of the actual fold end from +" the line satisfying endpat. +" startoff and endoff are necessary when the folding region does +" not have a specific end pattern corresponding to a start +" pattern. for example in latex, +" \begin{section} +" defines the beginning of a section, but its not necessary to +" have a corresponding +" \end{section} +" the section is assumed to end 1 line _before_ another section +" starts. +" startskip: a pattern which defines the beginning of a "skipped" region. +" +" For example, suppose we define a \itemize fold as follows: +" startpat = '^\s*\\item', +" endpat = '^\s*\\item\|^\s*\\end{\(enumerate\|itemize\|description\)}', +" startoff = 0, +" endoff = -1 +" +" This defines a fold which starts with a line beginning with an +" \item and ending one line before a line beginning with an +" \item or \end{enumerate} etc. +" +" Then, as long as \item's are not nested things are fine. +" However, once items begin to nest, the fold started by one +" \item can end because of an \item in an \itemize +" environment within this \item. i.e, the following can happen: +" +" \begin{itemize} +" \item Some text <------- fold will start here +" This item will contain a nested item +" \begin{itemize} <----- fold will end here because next line contains \item... +" \item Hello +" \end{itemize} <----- ... instead of here. +" \item Next item of the parent itemize +" \end{itemize} +" +" Therefore, in order to completely define a folding item which +" allows nesting, we need to also define a "skip" pattern. +" startskip and end skip do that. +" Leave '' when there is no nesting. +" endskip: the pattern which defines the end of the "skip" pattern for +" nested folds. +" +" Example: +" 1. A syntax fold region for a latex section is +" startpat = "\\section{" +" endpat = "\\section{" +" startoff = 0 +" endoff = -1 +" startskip = '' +" endskip = '' +" Note that the start and end patterns are thus the same and endoff has a +" negative value to capture the effect of a section ending one line before +" the next starts. +" 2. A syntax fold region for the \itemize environment is: +" startpat = '^\s*\\item', +" endpat = '^\s*\\item\|^\s*\\end{\(enumerate\|itemize\|description\)}', +" startoff = 0, +" endoff = -1, +" startskip = '^\s*\\begin{\(enumerate\|itemize\|description\)}', +" endskip = '^\s*\\end{\(enumerate\|itemize\|description\)}' +" Note the use of startskip and endskip to allow nesting. +" +" +" Each time a call is made to FoldRegions(), all the regions (which might be +" disjoint, but not nested) are folded up. +" Nested folds can be created by successive calls to FoldRegions(). The first +" call defines the region which is deepest in the folding. See MakeTexFolds() +" for an idea of how this works for latex files. + +" Function: AddSyntaxFoldItem (start, end, startoff, endoff [, skipStart, skipEnd]) {{{ +function! AddSyntaxFoldItem(start, end, startoff, endoff, ...) + if a:0 > 0 + let skipStart = a:1 + let skipEnd = a:2 + else + let skipStart = '' + let skipEnd = '' + end + if !exists('b:numFoldItems') + let b:numFoldItems = 0 + end + let b:numFoldItems = b:numFoldItems + 1 + + exe 'let b:startPat_'.b:numFoldItems.' = a:start' + exe 'let b:endPat_'.b:numFoldItems.' = a:end' + exe 'let b:startOff_'.b:numFoldItems.' = a:startoff' + exe 'let b:endOff_'.b:numFoldItems.' = a:endoff' + exe 'let b:skipStartPat_'.b:numFoldItems.' = skipStart' + exe 'let b:skipEndPat_'.b:numFoldItems.' = skipEnd' +endfunction + + +" }}} +" Function: MakeSyntaxFolds (force) {{{ +" Description: This function calls FoldRegions() several times with the +" parameters specifying various regions resulting in a nested fold +" structure for the file. +function! MakeSyntaxFolds(force, ...) + if exists('b:doneFolding') && a:force == 0 + return + end + + let skipEndPattern = '' + if a:0 > 0 + let line1 = a:1 + let skipEndPattern = '\|'.a:2 + else + let line1 = 1 + let r = line('.') + let c = virtcol('.') + + setlocal fdm=manual + normal! zE + end + if !exists('b:numFoldItems') + b:numFoldItems = 1000000 + end + + let i = 1 + + let maxline = line('.') + + while exists('b:startPat_'.i) && i <= b:numFoldItems + exe 'let startPat = b:startPat_'.i + exe 'let endPat = b:endPat_'.i + exe 'let startOff = b:startOff_'.i + exe 'let endOff = b:endOff_'.i + + let skipStart = '' + let skipEnd = '' + if exists('b:skipStartPat_'.i) + exe 'let skipStart = b:skipStartPat_'.i + exe 'let skipEnd = b:skipEndPat_'.i + end + exe line1 + let lastLoc = line1 + + if skipStart != '' + call InitStack('BeginSkipArray') + call FoldRegionsWithSkip(startPat, endPat, startOff, endOff, skipStart, skipEnd, 1, line('$')) + " call PrintError('done folding ['.startPat.']') + else + call FoldRegionsWithNoSkip(startPat, endPat, startOff, endOff, 1, line('$'), '') + end + + let i = i + 1 + endwhile + + exe maxline + + if a:0 == 0 + exe r + exe "normal! ".c."|" + if foldlevel(r) > 1 + exe "normal! ".(foldlevel(r) - 1)."zo" + end + let b:doneFolding = 0 + end +endfunction + + +" }}} +" FoldRegionsWithSkip: folding things such as \item's which can be nested. {{{ +function! FoldRegionsWithSkip(startpat, endpat, startoff, endoff, startskip, endskip, line1, line2) + exe a:line1 + " count the regions which have been skipped as we go along. do not want to + " create a fold which with a beginning or end line in one of the skipped + " regions. + let skippedRegions = '' + + " start searching for either the starting pattern or the end pattern. + while search(a:startskip.'\|'.a:endskip, 'W') + + if getline('.') =~ a:endskip + + let lastBegin = Pop('BeginSkipArray') + " call PrintError('popping '.lastBegin.' from stack and folding till '.line('.')) + call FoldRegionsWithNoSkip(a:startpat, a:endpat, a:startoff, a:endoff, lastBegin, line('.'), skippedRegions) + let skippedRegions = skippedRegions.lastBegin.','.line('.').'|' + + + " if this is the beginning of a skip region, then, push this line as + " the beginning of a skipped region. + elseif getline('.') =~ a:startskip + + " call PrintError('pushing '.line('.').' ['.getline('.').'] into stack') + call Push('BeginSkipArray', line('.')) + + end + endwhile + + " call PrintError('with skip starting at '.a:line1.' returning at line# '.line('.')) +endfunction + +" }}} +" FoldRegionsWithNoSkip: folding things such as \sections which do not nest. {{{ +function! FoldRegionsWithNoSkip(startpat, endpat, startoff, endoff, line1, line2, skippedRegions) + exe a:line1 + + " call PrintError('line1 = '.a:line1.', searching from '.line('.').'... for ['.a:startpat.'') + let lineBegin = s:MySearch(a:startpat, 'in') + " call PrintError('... and finding it at '.lineBegin) + + while lineBegin <= a:line2 + if IsInSkippedRegion(lineBegin, a:skippedRegions) + let lineBegin = s:MySearch(a:startpat, 'out') + " call PrintError(lineBegin.' is being skipped') + continue + end + let lineEnd = s:MySearch(a:endpat, 'out') + while IsInSkippedRegion(lineEnd, a:skippedRegions) && lineEnd <= a:line2 + let lineEnd = s:MySearch(a:endpat, 'out') + endwhile + if lineEnd > a:line2 + exe (lineBegin + a:startoff).','.a:line2.' fold' + break + else + " call PrintError ('for ['.a:startpat.'] '.(lineBegin + a:startoff).','.(lineEnd + a:endoff).' fold') + exe (lineBegin + a:startoff).','.(lineEnd + a:endoff).' fold' + end + + " call PrintError('line1 = '.a:line1.', searching from '.line('.').'... for ['.a:startpat.'') + let lineBegin = s:MySearch(a:startpat, 'in') + " call PrintError('... and finding it at '.lineBegin) + endwhile + + exe a:line2 + return +endfunction + +" }}} +" InitStack: initialize a stack {{{ +function! InitStack(name) + exe 'let s:'.a:name.'_numElems = 0' +endfunction +" }}} +" Push: push element into stack {{{ +function! Push(name, elem) + exe 'let numElems = s:'.a:name.'_numElems' + let numElems = numElems + 1 + exe 'let s:'.a:name.'_Element_'.numElems.' = a:elem' + exe 'let s:'.a:name.'_numElems = numElems' +endfunction +" }}} +" Pop: pops element off stack {{{ +function! Pop(name) + exe 'let numElems = s:'.a:name.'_numElems' + if numElems == 0 + return '' + else + exe 'let ret = s:'.a:name.'_Element_'.numElems + let numElems = numElems - 1 + exe 'let s:'.a:name.'_numElems = numElems' + return ret + end +endfunction +" }}} +" MySearch: just like search(), but returns large number on failure {{{ +function! <SID>MySearch(pat, opt) + if a:opt == 'in' + if getline('.') =~ a:pat + let ret = line('.') + else + let ret = search(a:pat, 'W') + end + else + normal! $ + let ret = search(a:pat, 'W') + end + + if ret == 0 + let ret = line('$') + 1 + end + return ret +endfunction +" }}} +" Function: IsInSkippedRegion (lnum, regions) {{{ +" Description: finds whether a given line number is within one of the regions +" skipped. +function! IsInSkippedRegion(lnum, regions) + let i = 1 + let subset = s:Strntok(a:regions, '|', i) + while subset != '' + let n1 = s:Strntok(subset, ',', 1) + let n2 = s:Strntok(subset, ',', 2) + if a:lnum >= n1 && a:lnum <= n2 + return 1 + end + + let subset = s:Strntok(a:regions, '|', i) + let i = i + 1 + endwhile + + return 0 +endfunction " }}} +" Function: Strntok (string, tok, n) {{{ +" extract the n^th token from s seperated by tok. +" example: Strntok('1,23,3', ',', 2) = 23 +fun! <SID>Strntok(s, tok, n) + return matchstr( a:s.a:tok[0], '\v(\zs([^'.a:tok.']*)\ze['.a:tok.']){'.a:n.'}') +endfun " }}} + +" vim600:fdm=marker diff --git a/.vim/plugin/filebrowser.vim b/.vim/plugin/filebrowser.vim @@ -0,0 +1,250 @@ +" filebrowser.vim: utility file for vim 6.2+ +" +" Copyright: Srinath Avadhanula <srinath AT fastmail DOT fm> +" Parts of this file are taken from explorer.vim which is a plugin file +" distributed with vim under the Vim charityware license. +" License: distributed under the Vim charityware license. +" +" Settings: +" FB_CallBackFunction: the function name which gets called when the user +" presses <cr> on a file-name in the file browser. +" FB_AllowRegexp: A filename has to match this regexp to be displayed. +" FB_RejectRegexp: If a filename matches this regexp, then its not displayed. +" (Both these regexps are '' by default which means no filtering is +" done). + +" line continuation used here. +let s:save_cpo = &cpo +set cpo&vim + +"====================================================================== +" Globally visible functions (API) +"====================================================================== +" FB_OpenFileBrowser: opens a new buffer and displays the file list {{{ +" Description: +function! FB_OpenFileBrowser(dir) + if !isdirectory(a:dir) + return + endif + if exists('s:FB_BufferNumber') + if bufwinnr(s:FB_BufferNumber) != -1 + execute bufwinnr(s:FB_BufferNumber).' wincmd w' + return + endif + execute 'aboveleft split #'.s:FB_BufferNumber + else + aboveleft split __Choose_File__ + let s:FB_BufferNumber = bufnr('%') + endif + call FB_DisplayFiles(a:dir) +endfunction " }}} +" FB_DisplayFiles: displays the files in a given directory {{{ +" Description: +" Call this function only when the cursor is in a temporary buffer +function! FB_DisplayFiles(dir) + if !isdirectory(a:dir) + return + endif + call s:FB_SetSilentSettings() + " make this a "scratch" buffer + call s:FB_SetScratchSettings() + + let allowRegexp = s:FB_GetVar('FB_AllowRegexp', '') + let rejectRegexp = s:FB_GetVar('FB_RejectRegexp', '') + + " change to the directory to make processing simpler. + execute "lcd ".a:dir + " delete everything in the buffer. + " IMPORTANT: we need to be in a scratch buffer + 0,$ d_ + + let allFilenames = glob('*') + let dispFiles = "" + let subDirs = "../\n" + + let allFilenames = allFilenames."\n" + let start = 0 + while 1 + let next = stridx(allFilenames, "\n", start) + let filename = strpart(allFilenames, start, next-start) + if filename == "" + break + endif + + if isdirectory(filename) + let subDirs = subDirs.filename."/\n" + else + if allowRegexp != '' && filename !~ allowRegexp + elseif rejectRegexp != '' && filename =~ rejectRegexp + else + let dispFiles = dispFiles.filename."\n" + endif + endif + + let start = next + 1 + endwhile + + 0put!=dispFiles + 0put!=subDirs + " delte the last empty line resulting from the put + $ d_ + + call s:FB_SetHighlighting() + call s:FB_DisplayHelp() + call s:FB_SetMaps() + + " goto the first file/directory + 0 + call search('^"=', 'w') + normal! j:<bs> + + set nomodified nomodifiable + + call s:FB_ResetSilentSettings() +endfunction " }}} +" FB_SetVar: sets script local variables from outside this script {{{ +" Description: +function! FB_SetVar(varname, value) + let s:{a:varname} = a:value +endfunction " }}} + +" ============================================================================== +" Script local functions below this +" ============================================================================== +" FB_SetHighlighting: sets syntax highlighting for the buffer {{{ +" Description: +" Origin: from explorer.vim in vim +function! <SID>FB_SetHighlighting() + " Set up syntax highlighting + " Something wrong with the evaluation of the conditional though... + if has("syntax") && exists("g:syntax_on") && !has("syntax_items") + syn match browseSynopsis "^\"[ -].*" + syn match browseDirectory "[^\"].*/ " + syn match browseDirectory "[^\"].*/$" + syn match browseCurDir "^\"= .*$" + syn match browseSortBy "^\" Sorted by .*$" contains=browseSuffixInfo + syn match browseSuffixInfo "(.*)$" contained + syn match browseFilter "^\" Not Showing:.*$" + syn match browseFiletime "«\d\+$" + + "hi def link browseSynopsis PreProc + hi def link browseSynopsis Special + hi def link browseDirectory Directory + hi def link browseCurDir Statement + hi def link browseSortBy String + hi def link browseSuffixInfo Type + hi def link browseFilter String + hi def link browseFiletime Ignore + hi def link browseSuffixes Type + endif +endfunction " }}} +" FB_SetMaps: sets buffer local maps {{{ +" Description: +function! <SID>FB_SetMaps() + nnoremap <buffer> <silent> q :bdelete<cr> + nnoremap <buffer> <silent> C :call FB_DisplayFiles(getcwd())<CR> + nnoremap <buffer> <silent> <esc> :bdelete<cr> + nnoremap <buffer> <silent> <CR> :call <SID>FB_EditEntry()<CR> + nnoremap <buffer> <silent> ? :call <SID>FB_ToggleHelp()<CR> + + " lock the user in this window + nnoremap <buffer> <C-w> <nop> +endfunction " }}} +" FB_SetSilentSettings: some settings which make things silent {{{ +" Description: +" Origin: from explorer.vim distributed with vim. +function! <SID>FB_SetSilentSettings() + let s:save_report=&report + let s:save_showcmd = &sc + set report=10000 noshowcmd +endfunction +" FB_ResetSilentSettings: reset settings set by FB_SetSilentSettings +" Description: +function! <SID>FB_ResetSilentSettings() + let &report=s:save_report + let &showcmd = s:save_showcmd +endfunction " }}} +" FB_SetScratchSettings: makes the present buffer a scratch buffer {{{ +" Description: +function! <SID>FB_SetScratchSettings() + " Turn off the swapfile, set the buffer type so that it won't get + " written, and so that it will get deleted when it gets hidden. + setlocal noreadonly modifiable + setlocal noswapfile + setlocal buftype=nowrite + setlocal bufhidden=delete + " Don't wrap around long lines + setlocal nowrap +endfunction + +" }}} +" FB_ToggleHelp: toggles verbosity of help {{{ +" Description: +function! <SID>FB_ToggleHelp() + let s:FB_VerboseHelp = 1 - s:FB_GetVar('FB_VerboseHelp', 0) + + call FB_DisplayFiles('.') +endfunction " }}} +" FB_DisplayHelp: displays a helpful header {{{ +" Description: +function! <SID>FB_DisplayHelp() + let verboseHelp = s:FB_GetVar('FB_VerboseHelp', 0) + if verboseHelp + let txt = + \ "\" <cr>: on file, choose the file and quit\n" + \ ."\" on dir, enter directory\n" + \ ."\" q/<esc>: quit without choosing\n" + \ ."\" C: change directory to getcwd()\n" + \ ."\" ?: toggle help verbosity\n" + \ ."\"= ".getcwd() + else + let txt = "\" ?: toggle help verbosity\n" + \ ."\"= ".getcwd() + endif + 0put!=txt +endfunction " }}} +" FB_EditEntry: handles the user pressing <enter> on a line {{{ +" Description: +function! <SID>FB_EditEntry() + let line = getline('.') + + if isdirectory(line) + call FB_DisplayFiles(line) + endif + + " If the user has a call back function defined on choosing a file, handle + " it. + let cbf = s:FB_GetVar('FB_CallBackFunction', '') + if cbf != '' && line !~ '^" ' && filereadable(line) + let fname = fnamemodify(line, ':p') + bdelete + + let arguments = s:FB_GetVar('FB_CallBackFunctionArgs', '') + if arguments != '' + let arguments = ','.arguments + endif + call Tex_Debug('arguments = '.arguments, 'fb') + call Tex_Debug("call ".cbf."('".fname."'".arguments.')', 'fb') + exec "call ".cbf."('".fname."'".arguments.')' + endif +endfunction " }}} +" FB_GetVar: gets the most local value of a variable {{{ +function! <SID>FB_GetVar(name, default) + if exists('s:'.a:name) + return s:{a:name} + elseif exists('w:'.a:name) + return w:{a:name} + elseif exists('b:'.a:name) + return b:{a:name} + elseif exists('g:'.a:name) + return g:{a:name} + else + return a:default + endif +endfunction + +" }}} + +let &cpo = s:save_cpo + +" vim:fdm=marker:ff=unix:noet:ts=4:sw=4:nowrap diff --git a/.vim/plugin/imaps.vim b/.vim/plugin/imaps.vim @@ -0,0 +1,831 @@ +" File: imaps.vim +" Authors: Srinath Avadhanula <srinath AT fastmail.fm> +" Benji Fisher <benji AT member.AMS.org> +" +" WWW: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/vim-latex/vimfiles/plugin/imaps.vim?only_with_tag=MAIN +" +" Description: insert mode template expander with cursor placement +" while preserving filetype indentation. +" +" $Id: imaps.vim 997 2006-03-20 09:45:45Z srinathava $ +" +" Documentation: {{{ +" +" Motivation: +" this script provides a way to generate insert mode mappings which do not +" suffer from some of the problem of mappings and abbreviations while allowing +" cursor placement after the expansion. It can alternatively be thought of as +" a template expander. +" +" Consider an example. If you do +" +" imap lhs something +" +" then a mapping is set up. However, there will be the following problems: +" 1. the 'ttimeout' option will generally limit how easily you can type the +" lhs. if you type the left hand side too slowly, then the mapping will not +" be activated. +" 2. if you mistype one of the letters of the lhs, then the mapping is +" deactivated as soon as you backspace to correct the mistake. +" +" If, in order to take care of the above problems, you do instead +" +" iab lhs something +" +" then the timeout problem is solved and so is the problem of mistyping. +" however, abbreviations are only expanded after typing a non-word character. +" which causes problems of cursor placement after the expansion and invariably +" spurious spaces are inserted. +" +" Usage Example: +" this script attempts to solve all these problems by providing an emulation +" of imaps wchich does not suffer from its attendant problems. Because maps +" are activated without having to press additional characters, therefore +" cursor placement is possible. furthermore, file-type specific indentation is +" preserved, because the rhs is expanded as if the rhs is typed in literally +" by the user. +" +" The script already provides some default mappings. each "mapping" is of the +" form: +" +" call IMAP (lhs, rhs, ft) +" +" Some characters in the RHS have special meaning which help in cursor +" placement. +" +" Example One: +" +" call IMAP ("bit`", "\\begin{itemize}\<cr>\\item <++>\<cr>\\end{itemize}<++>", "tex") +" +" This effectively sets up the map for "bit`" whenever you edit a latex file. +" When you type in this sequence of letters, the following text is inserted: +" +" \begin{itemize} +" \item * +" \end{itemize}<++> +" +" where * shows the cursor position. The cursor position after inserting the +" text is decided by the position of the first "place-holder". Place holders +" are special characters which decide cursor placement and movement. In the +" example above, the place holder characters are <+ and +>. After you have typed +" in the item, press <C-j> and you will be taken to the next set of <++>'s. +" Therefore by placing the <++> characters appropriately, you can minimize the +" use of movement keys. +" +" NOTE: Set g:Imap_UsePlaceHolders to 0 to disable placeholders altogether. +" Set +" g:Imap_PlaceHolderStart and g:Imap_PlaceHolderEnd +" to something else if you want different place holder characters. +" Also, b:Imap_PlaceHolderStart and b:Imap_PlaceHolderEnd override the values +" of g:Imap_PlaceHolderStart and g:Imap_PlaceHolderEnd respectively. This is +" useful for setting buffer specific place hoders. +" +" Example Two: +" You can use the <C-r> command to insert dynamic elements such as dates. +" call IMAP ('date`', "\<c-r>=strftime('%b %d %Y')\<cr>", '') +" +" sets up the map for date` to insert the current date. +" +"--------------------------------------%<-------------------------------------- +" Bonus: This script also provides a command Snip which puts tearoff strings, +" '----%<----' above and below the visually selected range of lines. The +" length of the string is chosen to be equal to the longest line in the range. +" Recommended Usage: +" '<,'>Snip +"--------------------------------------%<-------------------------------------- +" }}} + +" line continuation used here. +let s:save_cpo = &cpo +set cpo&vim + +" ============================================================================== +" Script Options / Variables +" ============================================================================== +" Options {{{ +if !exists('g:Imap_StickyPlaceHolders') + let g:Imap_StickyPlaceHolders = 1 +endif +if !exists('g:Imap_DeleteEmptyPlaceHolders') + let g:Imap_DeleteEmptyPlaceHolders = 1 +endif +" }}} +" Variables {{{ +" s:LHS_{ft}_{char} will be generated automatically. It will look like +" s:LHS_tex_o = 'fo\|foo\|boo' and contain all mapped sequences ending in "o". +" s:Map_{ft}_{lhs} will be generated automatically. It will look like +" s:Map_c_foo = 'for(<++>; <++>; <++>)', the mapping for "foo". +" +" }}} + +" ============================================================================== +" functions for easy insert mode mappings. +" ============================================================================== +" IMAP: Adds a "fake" insert mode mapping. {{{ +" For example, doing +" IMAP('abc', 'def' ft) +" will mean that if the letters abc are pressed in insert mode, then +" they will be replaced by def. If ft != '', then the "mapping" will be +" specific to the files of type ft. +" +" Using IMAP has a few advantages over simply doing: +" imap abc def +" 1. with imap, if you begin typing abc, the cursor will not advance and +" long as there is a possible completion, the letters a, b, c will be +" displayed on on top of the other. using this function avoids that. +" 2. with imap, if a backspace or arrow key is pressed before completing +" the word, then the mapping is lost. this function allows movement. +" (this ofcourse means that this function is only limited to +" left-hand-sides which do not have movement keys or unprintable +" characters) +" It works by only mapping the last character of the left-hand side. +" when this character is typed in, then a reverse lookup is done and if +" the previous characters consititute the left hand side of the mapping, +" the previously typed characters and erased and the right hand side is +" inserted + +" IMAP: set up a filetype specific mapping. +" Description: +" "maps" the lhs to rhs in files of type 'ft'. If supplied with 2 +" additional arguments, then those are assumed to be the placeholder +" characters in rhs. If unspecified, then the placeholder characters +" are assumed to be '<+' and '+>' These placeholder characters in +" a:rhs are replaced with the users setting of +" [bg]:Imap_PlaceHolderStart and [bg]:Imap_PlaceHolderEnd settings. +" +function! IMAP(lhs, rhs, ft, ...) + + " Find the place holders to save for IMAP_PutTextWithMovement() . + if a:0 < 2 + let phs = '<+' + let phe = '+>' + else + let phs = a:1 + let phe = a:2 + endif + + let hash = s:Hash(a:lhs) + let s:Map_{a:ft}_{hash} = a:rhs + let s:phs_{a:ft}_{hash} = phs + let s:phe_{a:ft}_{hash} = phe + + " Add a:lhs to the list of left-hand sides that end with lastLHSChar: + let lastLHSChar = a:lhs[strlen(a:lhs)-1] + let hash = s:Hash(lastLHSChar) + if !exists("s:LHS_" . a:ft . "_" . hash) + let s:LHS_{a:ft}_{hash} = escape(a:lhs, '\') + else + let s:LHS_{a:ft}_{hash} = escape(a:lhs, '\') .'\|'. s:LHS_{a:ft}_{hash} + endif + + " map only the last character of the left-hand side. + if lastLHSChar == ' ' + let lastLHSChar = '<space>' + end + exe 'inoremap <silent>' + \ escape(lastLHSChar, '|') + \ '<C-r>=<SID>LookupCharacter("' . + \ escape(lastLHSChar, '\|"') . + \ '")<CR>' +endfunction + +" }}} +" IMAP_list: list the rhs and place holders corresponding to a:lhs {{{ +" +" Added mainly for debugging purposes, but maybe worth keeping. +function! IMAP_list(lhs) + let char = a:lhs[strlen(a:lhs)-1] + let charHash = s:Hash(char) + if exists("s:LHS_" . &ft ."_". charHash) && a:lhs =~ s:LHS_{&ft}_{charHash} + let ft = &ft + elseif exists("s:LHS__" . charHash) && a:lhs =~ s:LHS__{charHash} + let ft = "" + else + return "" + endif + let hash = s:Hash(a:lhs) + return "rhs = " . s:Map_{ft}_{hash} . " place holders = " . + \ s:phs_{ft}_{hash} . " and " . s:phe_{ft}_{hash} +endfunction +" }}} +" LookupCharacter: inserts mapping corresponding to this character {{{ +" +" This function extracts from s:LHS_{&ft}_{a:char} or s:LHS__{a:char} +" the longest lhs matching the current text. Then it replaces lhs with the +" corresponding rhs saved in s:Map_{ft}_{lhs} . +" The place-holder variables are passed to IMAP_PutTextWithMovement() . +function! s:LookupCharacter(char) + if IMAP_GetVal('Imap_FreezeImap', 0) == 1 + return a:char + endif + let charHash = s:Hash(a:char) + + " The line so far, including the character that triggered this function: + let text = strpart(getline("."), 0, col(".")-1) . a:char + " Prefer a local map to a global one, even if the local map is shorter. + " Is this what we want? Do we care? + " Use '\V' (very no-magic) so that only '\' is special, and it was already + " escaped when building up s:LHS_{&ft}_{charHash} . + if exists("s:LHS_" . &ft . "_" . charHash) + \ && text =~ "\\C\\V\\(" . s:LHS_{&ft}_{charHash} . "\\)\\$" + let ft = &ft + elseif exists("s:LHS__" . charHash) + \ && text =~ "\\C\\V\\(" . s:LHS__{charHash} . "\\)\\$" + let ft = "" + else + " If this is a character which could have been used to trigger an + " abbreviation, check if an abbreviation exists. + if a:char !~ '\k' + let lastword = matchstr(getline('.'), '\k\+$', '') + call IMAP_Debug('getting lastword = ['.lastword.']', 'imap') + if lastword != '' + " An extremeley wierd way to get around the fact that vim + " doesn't have the equivalent of the :mapcheck() function for + " abbreviations. + let _a = @a + exec "redir @a | silent! iab ".lastword." | redir END" + let abbreviationRHS = matchstr(@a."\n", "\n".'i\s\+'.lastword.'\s\+@\?\zs.*\ze'."\n") + + call IMAP_Debug('getting abbreviationRHS = ['.abbreviationRHS.']', 'imap') + + if @a =~ "No abbreviation found" || abbreviationRHS == "" + let @a = _a + return a:char + endif + + let @a = _a + let abbreviationRHS = escape(abbreviationRHS, '\<"') + exec 'let abbreviationRHS = "'.abbreviationRHS.'"' + + let lhs = lastword.a:char + let rhs = abbreviationRHS.a:char + let phs = IMAP_GetPlaceHolderStart() + let phe = IMAP_GetPlaceHolderEnd() + else + return a:char + endif + else + return a:char + endif + endif + " Find the longest left-hand side that matches the line so far. + " matchstr() returns the match that starts first. This automatically + " ensures that the longest LHS is used for the mapping. + if !exists('lhs') || !exists('rhs') + let lhs = matchstr(text, "\\C\\V\\(" . s:LHS_{ft}_{charHash} . "\\)\\$") + let hash = s:Hash(lhs) + let rhs = s:Map_{ft}_{hash} + let phs = s:phs_{ft}_{hash} + let phe = s:phe_{ft}_{hash} + endif + + if strlen(lhs) == 0 + return a:char + endif + " enough back-spaces to erase the left-hand side; -1 for the last + " character typed: + let bs = substitute(strpart(lhs, 1), ".", "\<bs>", "g") + return bs . IMAP_PutTextWithMovement(rhs, phs, phe) +endfunction + +" }}} +" IMAP_PutTextWithMovement: returns the string with movement appended {{{ +" Description: +" If a:str contains "placeholders", then appends movement commands to +" str in a way that the user moves to the first placeholder and enters +" insert or select mode. If supplied with 2 additional arguments, then +" they are assumed to be the placeholder specs. Otherwise, they are +" assumed to be '<+' and '+>'. These placeholder chars are replaced +" with the users settings of [bg]:Imap_PlaceHolderStart and +" [bg]:Imap_PlaceHolderEnd. +function! IMAP_PutTextWithMovement(str, ...) + + " The placeholders used in the particular input string. These can be + " different from what the user wants to use. + if a:0 < 2 + let phs = '<+' + let phe = '+>' + else + let phs = escape(a:1, '\') + let phe = escape(a:2, '\') + endif + + let text = a:str + + " The user's placeholder settings. + let phsUser = IMAP_GetPlaceHolderStart() + let pheUser = IMAP_GetPlaceHolderEnd() + + " Problem: depending on the setting of the 'encoding' option, a character + " such as "\xab" may not match itself. We try to get around this by + " changing the encoding of all our strings. At the end, we have to + " convert text back. + let phsEnc = s:Iconv(phs, "encode") + let pheEnc = s:Iconv(phe, "encode") + let phsUserEnc = s:Iconv(phsUser, "encode") + let pheUserEnc = s:Iconv(pheUser, "encode") + let textEnc = s:Iconv(text, "encode") + if textEnc != text + let textEncoded = 1 + else + let textEncoded = 0 + endif + + let pattern = '\V\(\.\{-}\)' .phs. '\(\.\{-}\)' .phe. '\(\.\*\)' + " If there are no placeholders, just return the text. + if textEnc !~ pattern + call IMAP_Debug('Not getting '.phs.' and '.phe.' in '.textEnc, 'imap') + return text + endif + " Break text up into "initial <+template+> final"; any piece may be empty. + let initialEnc = substitute(textEnc, pattern, '\1', '') + let templateEnc = substitute(textEnc, pattern, '\2', '') + let finalEnc = substitute(textEnc, pattern, '\3', '') + + " If the user does not want to use placeholders, then remove all but the + " first placeholder. + " Otherwise, replace all occurences of the placeholders here with the + " user's choice of placeholder settings. + if exists('g:Imap_UsePlaceHolders') && !g:Imap_UsePlaceHolders + let finalEnc = substitute(finalEnc, '\V'.phs.'\.\{-}'.phe, '', 'g') + else + let finalEnc = substitute(finalEnc, '\V'.phs.'\(\.\{-}\)'.phe, + \ phsUserEnc.'\1'.pheUserEnc, 'g') + endif + + " The substitutions are done, so convert back, if necessary. + if textEncoded + let initial = s:Iconv(initialEnc, "decode") + let template = s:Iconv(templateEnc, "decode") + let final = s:Iconv(finalEnc, "decode") + else + let initial = initialEnc + let template = templateEnc + let final = finalEnc + endif + + " Build up the text to insert: + " 1. the initial text plus an extra character; + " 2. go to Normal mode with <C-\><C-N>, so it works even if 'insertmode' + " is set, and mark the position; + " 3. replace the extra character with tamplate and final; + " 4. back to Normal mode and restore the cursor position; + " 5. call IMAP_Jumpfunc(). + let template = phsUser . template . pheUser + " Old trick: insert and delete a character to get the same behavior at + " start, middle, or end of line and on empty lines. + let text = initial . "X\<C-\>\<C-N>:call IMAP_Mark('set')\<CR>\"_s" + let text = text . template . final + let text = text . "\<C-\>\<C-N>:call IMAP_Mark('go')\<CR>" + let text = text . "i\<C-r>=IMAP_Jumpfunc('', 1)\<CR>" + + call IMAP_Debug('IMAP_PutTextWithMovement: text = ['.text.']', 'imap') + return text +endfunction + +" }}} +" IMAP_Jumpfunc: takes user to next <+place-holder+> {{{ +" Author: Luc Hermitte +" Arguments: +" direction: flag for the search() function. If set to '', search forwards, +" if 'b', then search backwards. See the {flags} argument of the +" |search()| function for valid values. +" inclusive: In vim, the search() function is 'exclusive', i.e we always goto +" next cursor match even if there is a match starting from the +" current cursor position. Setting this argument to 1 makes +" IMAP_Jumpfunc() also respect a match at the current cursor +" position. 'inclusive'ness is necessary for IMAP() because a +" placeholder string can occur at the very beginning of a map which +" we want to select. +" We use a non-zero value only in special conditions. Most mappings +" should use a zero value. +function! IMAP_Jumpfunc(direction, inclusive) + + " The user's placeholder settings. + let phsUser = IMAP_GetPlaceHolderStart() + let pheUser = IMAP_GetPlaceHolderEnd() + + let searchString = '' + " If this is not an inclusive search or if it is inclusive, but the + " current cursor position does not contain a placeholder character, then + " search for the placeholder characters. + if !a:inclusive || strpart(getline('.'), col('.')-1) !~ '\V\^'.phsUser + let searchString = '\V'.phsUser.'\_.\{-}'.pheUser + endif + + " If we didn't find any placeholders return quietly. + if searchString != '' && !search(searchString, a:direction) + return '' + endif + + " Open any closed folds and make this part of the text visible. + silent! foldopen! + + " Calculate if we have an empty placeholder or if it contains some + " description. + let template = + \ matchstr(strpart(getline('.'), col('.')-1), + \ '\V\^'.phsUser.'\zs\.\{-}\ze\('.pheUser.'\|\$\)') + let placeHolderEmpty = !strlen(template) + + " If we are selecting in exclusive mode, then we need to move one step to + " the right + let extramove = '' + if &selection == 'exclusive' + let extramove = 'l' + endif + + " Select till the end placeholder character. + let movement = "\<C-o>v/\\V".pheUser."/e\<CR>".extramove + + " First remember what the search pattern was. s:RemoveLastHistoryItem will + " reset @/ to this pattern so we do not create new highlighting. + let g:Tex_LastSearchPattern = @/ + + " Now either goto insert mode or select mode. + if placeHolderEmpty && g:Imap_DeleteEmptyPlaceHolders + " delete the empty placeholder into the blackhole. + return movement."\"_c\<C-o>:".s:RemoveLastHistoryItem."\<CR>" + else + return movement."\<C-\>\<C-N>:".s:RemoveLastHistoryItem."\<CR>gv\<C-g>" + endif + +endfunction + +" }}} +" Maps for IMAP_Jumpfunc {{{ +" +" These mappings use <Plug> and thus provide for easy user customization. When +" the user wants to map some other key to jump forward, he can do for +" instance: +" nmap ,f <plug>IMAP_JumpForward +" etc. + +" jumping forward and back in insert mode. +imap <silent> <Plug>IMAP_JumpForward <c-r>=IMAP_Jumpfunc('', 0)<CR> +imap <silent> <Plug>IMAP_JumpBack <c-r>=IMAP_Jumpfunc('b', 0)<CR> + +" jumping in normal mode +nmap <silent> <Plug>IMAP_JumpForward i<c-r>=IMAP_Jumpfunc('', 0)<CR> +nmap <silent> <Plug>IMAP_JumpBack i<c-r>=IMAP_Jumpfunc('b', 0)<CR> + +" deleting the present selection and then jumping forward. +vmap <silent> <Plug>IMAP_DeleteAndJumpForward "_<Del>i<c-r>=IMAP_Jumpfunc('', 0)<CR> +vmap <silent> <Plug>IMAP_DeleteAndJumpBack "_<Del>i<c-r>=IMAP_Jumpfunc('b', 0)<CR> + +" jumping forward without deleting present selection. +vmap <silent> <Plug>IMAP_JumpForward <C-\><C-N>i<c-r>=IMAP_Jumpfunc('', 0)<CR> +vmap <silent> <Plug>IMAP_JumpBack <C-\><C-N>`<i<c-r>=IMAP_Jumpfunc('b', 0)<CR> + +" }}} +" Default maps for IMAP_Jumpfunc {{{ +" map only if there is no mapping already. allows for user customization. +" NOTE: Default mappings for jumping to the previous placeholder are not +" provided. It is assumed that if the user will create such mappings +" hself if e so desires. +if !hasmapto('<Plug>IMAP_JumpForward', 'i') + imap <C-J> <Plug>IMAP_JumpForward +endif +if !hasmapto('<Plug>IMAP_JumpForward', 'n') + nmap <C-J> <Plug>IMAP_JumpForward +endif +if exists('g:Imap_StickyPlaceHolders') && g:Imap_StickyPlaceHolders + if !hasmapto('<Plug>IMAP_JumpForward', 'v') + vmap <C-J> <Plug>IMAP_JumpForward + endif +else + if !hasmapto('<Plug>IMAP_DeleteAndJumpForward', 'v') + vmap <C-J> <Plug>IMAP_DeleteAndJumpForward + endif +endif +" }}} + +nmap <silent> <script> <plug><+SelectRegion+> `<v`> + +" ============================================================================== +" enclosing selected region. +" ============================================================================== +" VEnclose: encloses the visually selected region with given arguments {{{ +" Description: allows for differing action based on visual line wise +" selection or visual characterwise selection. preserves the +" marks and search history. +function! VEnclose(vstart, vend, VStart, VEnd) + + " its characterwise if + " 1. characterwise selection and valid values for vstart and vend. + " OR + " 2. linewise selection and invalid values for VStart and VEnd + if (visualmode() == 'v' && (a:vstart != '' || a:vend != '')) || (a:VStart == '' && a:VEnd == '') + + let newline = "" + let _r = @r + + let normcmd = "normal! \<C-\>\<C-n>`<v`>\"_s" + + exe "normal! \<C-\>\<C-n>`<v`>\"ry" + if @r =~ "\n$" + let newline = "\n" + let @r = substitute(@r, "\n$", '', '') + endif + + " In exclusive selection, we need to select an extra character. + if &selection == 'exclusive' + let movement = 8 + else + let movement = 7 + endif + let normcmd = normcmd. + \ a:vstart."!!mark!!".a:vend.newline. + \ "\<C-\>\<C-N>?!!mark!!\<CR>v".movement."l\"_s\<C-r>r\<C-\>\<C-n>" + + " this little if statement is because till very recently, vim used to + " report col("'>") > length of selected line when `> is $. on some + " systems it reports a -ve number. + if col("'>") < 0 || col("'>") > strlen(getline("'>")) + let lastcol = strlen(getline("'>")) + else + let lastcol = col("'>") + endif + if lastcol - col("'<") != 0 + let len = lastcol - col("'<") + else + let len = '' + endif + + " the next normal! is for restoring the marks. + let normcmd = normcmd."`<v".len."l\<C-\>\<C-N>" + + " First remember what the search pattern was. s:RemoveLastHistoryItem + " will reset @/ to this pattern so we do not create new highlighting. + let g:Tex_LastSearchPattern = @/ + + silent! exe normcmd + " this is to restore the r register. + let @r = _r + " and finally, this is to restore the search history. + execute s:RemoveLastHistoryItem + + else + + exec 'normal! `<O'.a:VStart."\<C-\>\<C-n>" + exec 'normal! `>o'.a:VEnd."\<C-\>\<C-n>" + if &indentexpr != '' + silent! normal! `<kV`>j= + endif + silent! normal! `> + endif +endfunction + +" }}} +" ExecMap: adds the ability to correct an normal/visual mode mapping. {{{ +" Author: Hari Krishna Dara <hari_vim@yahoo.com> +" Reads a normal mode mapping at the command line and executes it with the +" given prefix. Press <BS> to correct and <Esc> to cancel. +function! ExecMap(prefix, mode) + " Temporarily remove the mapping, otherwise it will interfere with the + " mapcheck call below: + let myMap = maparg(a:prefix, a:mode) + exec a:mode."unmap ".a:prefix + + " Generate a line with spaces to clear the previous message. + let i = 1 + let clearLine = "\r" + while i < &columns + let clearLine = clearLine . ' ' + let i = i + 1 + endwhile + + let mapCmd = a:prefix + let foundMap = 0 + let breakLoop = 0 + echon "\rEnter Map: " . mapCmd + while !breakLoop + let char = getchar() + if char !~ '^\d\+$' + if char == "\<BS>" + let mapCmd = strpart(mapCmd, 0, strlen(mapCmd) - 1) + endif + else " It is the ascii code. + let char = nr2char(char) + if char == "\<Esc>" + let breakLoop = 1 + else + let mapCmd = mapCmd . char + if maparg(mapCmd, a:mode) != "" + let foundMap = 1 + let breakLoop = 1 + elseif mapcheck(mapCmd, a:mode) == "" + let mapCmd = strpart(mapCmd, 0, strlen(mapCmd) - 1) + endif + endif + endif + echon clearLine + echon "\rEnter Map: " . mapCmd + endwhile + if foundMap + if a:mode == 'v' + " use a plug to select the region instead of using something like + " `<v`> to avoid problems caused by some of the characters in + " '`<v`>' being mapped. + let gotoc = "\<plug><+SelectRegion+>" + else + let gotoc = '' + endif + exec "normal ".gotoc.mapCmd + endif + exec a:mode.'noremap '.a:prefix.' '.myMap +endfunction + +" }}} + +" ============================================================================== +" helper functions +" ============================================================================== +" Strntok: extract the n^th token from a list {{{ +" example: Strntok('1,23,3', ',', 2) = 23 +fun! <SID>Strntok(s, tok, n) + return matchstr( a:s.a:tok[0], '\v(\zs([^'.a:tok.']*)\ze['.a:tok.']){'.a:n.'}') +endfun + +" }}} +" s:RemoveLastHistoryItem: removes last search item from search history {{{ +" Description: Execute this string to clean up the search history. +let s:RemoveLastHistoryItem = ':call histdel("/", -1)|let @/=g:Tex_LastSearchPattern' + +" }}} +" s:Hash: Return a version of a string that can be used as part of a variable" {{{ +" name. +" Converts every non alphanumeric character into _{ascii}_ where {ascii} is +" the ASCII code for that character... +fun! s:Hash(text) + return substitute(a:text, '\([^[:alnum:]]\)', + \ '\="_".char2nr(submatch(1))."_"', 'g') +endfun +"" }}} +" IMAP_GetPlaceHolderStart and IMAP_GetPlaceHolderEnd: "{{{ +" return the buffer local placeholder variables, or the global one, or the default. +function! IMAP_GetPlaceHolderStart() + if exists("b:Imap_PlaceHolderStart") && strlen(b:Imap_PlaceHolderEnd) + return b:Imap_PlaceHolderStart + elseif exists("g:Imap_PlaceHolderStart") && strlen(g:Imap_PlaceHolderEnd) + return g:Imap_PlaceHolderStart + else + return "<+" +endfun +function! IMAP_GetPlaceHolderEnd() + if exists("b:Imap_PlaceHolderEnd") && strlen(b:Imap_PlaceHolderEnd) + return b:Imap_PlaceHolderEnd + elseif exists("g:Imap_PlaceHolderEnd") && strlen(g:Imap_PlaceHolderEnd) + return g:Imap_PlaceHolderEnd + else + return "+>" +endfun +" }}} +" s:Iconv: a wrapper for iconv()" {{{ +" Problem: after +" let text = "\xab" +" (or using the raw 8-bit ASCII character in a file with 'fenc' set to +" "latin1") if 'encoding' is set to utf-8, then text does not match itself: +" echo text =~ text +" returns 0. +" Solution: When this happens, a re-encoded version of text does match text: +" echo iconv(text, "latin1", "utf8") =~ text +" returns 1. In this case, convert text to utf-8 with iconv(). +" TODO: Is it better to use &encoding instead of "utf8"? Internally, vim +" uses utf-8, and can convert between latin1 and utf-8 even when compiled with +" -iconv, so let's try using utf-8. +" Arguments: +" a:text = text to be encoded or decoded +" a:mode = "encode" (latin1 to utf8) or "decode" (utf8 to latin1) +" Caution: do not encode and then decode without checking whether the text +" has changed, becuase of the :if clause in encoding! +function! s:Iconv(text, mode) + if a:mode == "decode" + return iconv(a:text, "utf8", "latin1") + endif + if a:text =~ '\V\^' . escape(a:text, '\') . '\$' + return a:text + endif + let textEnc = iconv(a:text, "latin1", "utf8") + if textEnc !~ '\V\^' . escape(a:text, '\') . '\$' + call IMAP_Debug('Encoding problems with text '.a:text.' ', 'imap') + endif + return textEnc +endfun +"" }}} +" IMAP_Debug: interface to Tex_Debug if available, otherwise emulate it {{{ +" Description: +" Do not want a memory leak! Set this to zero so that imaps always +" starts out in a non-debugging mode. +if !exists('g:Imap_Debug') + let g:Imap_Debug = 0 +endif +function! IMAP_Debug(string, pattern) + if !g:Imap_Debug + return + endif + if exists('*Tex_Debug') + call Tex_Debug(a:string, a:pattern) + else + if !exists('s:debug_'.a:pattern) + let s:debug_{a:pattern} = a:string + else + let s:debug_{a:pattern} = s:debug_{a:pattern}.a:string + endif + endif +endfunction " }}} +" IMAP_DebugClear: interface to Tex_DebugClear if avaialable, otherwise emulate it {{{ +" Description: +function! IMAP_DebugClear(pattern) + if exists('*Tex_DebugClear') + call Tex_DebugClear(a:pattern) + else + let s:debug_{a:pattern} = '' + endif +endfunction " }}} +" IMAP_PrintDebug: interface to Tex_DebugPrint if avaialable, otherwise emulate it {{{ +" Description: +function! IMAP_PrintDebug(pattern) + if exists('*Tex_PrintDebug') + call Tex_PrintDebug(a:pattern) + else + if exists('s:debug_'.a:pattern) + echo s:debug_{a:pattern} + endif + endif +endfunction " }}} +" IMAP_Mark: Save the cursor position (if a:action == 'set') in a" {{{ +" script-local variable; restore this position if a:action == 'go'. +let s:Mark = "(0,0)" +let s:initBlanks = '' +function! IMAP_Mark(action) + if a:action == 'set' + let s:Mark = "(" . line(".") . "," . col(".") . ")" + let s:initBlanks = matchstr(getline('.'), '^\s*') + elseif a:action == 'go' + execute "call cursor" s:Mark + let blanksNow = matchstr(getline('.'), '^\s*') + if strlen(blanksNow) > strlen(s:initBlanks) + execute 'silent! normal! '.(strlen(blanksNow) - strlen(s:initBlanks)).'l' + elseif strlen(blanksNow) < strlen(s:initBlanks) + execute 'silent! normal! '.(strlen(s:initBlanks) - strlen(blanksNow)).'h' + endif + endif +endfunction "" }}} +" IMAP_GetVal: gets the value of a variable {{{ +" Description: first checks window local, then buffer local etc. +function! IMAP_GetVal(name, ...) + if a:0 > 0 + let default = a:1 + else + let default = '' + endif + if exists('w:'.a:name) + return w:{a:name} + elseif exists('b:'.a:name) + return b:{a:name} + elseif exists('g:'.a:name) + return g:{a:name} + else + return default + endif +endfunction " }}} + +" ============================================================================== +" A bonus function: Snip() +" ============================================================================== +" Snip: puts a scissor string above and below block of text {{{ +" Desciption: +"-------------------------------------%<------------------------------------- +" this puts a the string "--------%<---------" above and below the visually +" selected block of lines. the length of the 'tearoff' string depends on the +" maximum string length in the selected range. this is an aesthetically more +" pleasing alternative instead of hardcoding a length. +"-------------------------------------%<------------------------------------- +function! <SID>Snip() range + let i = a:firstline + let maxlen = -2 + " find out the maximum virtual length of each line. + while i <= a:lastline + exe i + let length = virtcol('$') + let maxlen = (length > maxlen ? length : maxlen) + let i = i + 1 + endwhile + let maxlen = (maxlen > &tw && &tw != 0 ? &tw : maxlen) + let half = maxlen/2 + exe a:lastline + " put a string below + exe "norm! o\<esc>".(half - 1)."a-\<esc>A%<\<esc>".(half - 1)."a-" + " and above. its necessary to put the string below the block of lines + " first because that way the first line number doesnt change... + exe a:firstline + exe "norm! O\<esc>".(half - 1)."a-\<esc>A%<\<esc>".(half - 1)."a-" +endfunction + +com! -nargs=0 -range Snip :<line1>,<line2>call <SID>Snip() +" }}} + +let &cpo = s:save_cpo + +" vim:ft=vim:ts=4:sw=4:noet:fdm=marker:commentstring=\"\ %s:nowrap diff --git a/.vim/plugin/libList.vim b/.vim/plugin/libList.vim @@ -0,0 +1,249 @@ +" File: libList.vim +" Last Change: 2001 Dec 10 +" Maintainer: Gontran BAERTS <gbcreation@free.fr> +" Version: 0.1 +" +" Please don't hesitate to correct my english :) +" Send corrections to <gbcreation@free.fr> +" +"----------------------------------------------------------------------------- +" Description: libList.vim is a set of functions to work with lists or one +" level arrays. +" +"----------------------------------------------------------------------------- +" To Enable: Normally, this file will reside in your plugins directory and be +" automatically sourced. +" +"----------------------------------------------------------------------------- +" Usage: Lists are strings variable with values separated by g:listSep +" character (comma" by default). You may redefine g:listSep variable as you +" wish. +" +" Here are available functions : +" +" - AddListItem( array, newItem, index ) : +" Add item "newItem" to array "array" at "index" position +" - GetListItem( array, index ) : +" Return item at "index" position in array "array" +" - GetListMatchItem( array, pattern ) : +" Return item matching "pattern" in array "array" +" - GetListCount( array ) : +" Return the number of items in array "array" +" - RemoveListItem( array, index ) : +" Remove item at "index" position from array "array" +" - ReplaceListItem( array, index, item ) : +" Remove item at "index" position by "item" in array "array" +" - ExchangeListItems( array, item1Index, item2Index ) : +" Exchange item "item1Index" with item "item2Index" in array "array" +" - QuickSortList( array, beg, end ) : +" Return array "array" with items between "beg" and "end" sorted +" +" Example: +" let mylist="" +" echo GetListCount( mylist ) " --> 0 +" let mylist = AddListItem( mylist, "One", 0 ) " mylist == "One" +" let mylist = AddListItem( mylist, "Three", 1 ) " mylist == "One,Three" +" let mylist = AddListItem( mylist, "Two", 1 ) " mylist == "One,Two,Three" +" echo GetListCount( mylist ) " --> 3 +" echo GetListItem( mylist, 2 ) " --> Three +" echo GetListMatchItem( mylist, "w" ) " --> two +" echo GetListMatchItem( mylist, "e" ) " --> One +" let mylist = RemoveListItem( mylist, 2 ) " mylist == "One,Two" +" echo GetListCount( mylist ) " --> 2 +" let mylist = ReplaceListItem( mylist, 0, "Three" ) " mylist == "Three,Two" +" let mylist = ExchangeListItems( mylist, 0, 1 ) " mylist == "Two,Three" +" let mylist = AddListItem( mylist, "One", 0 ) " mylist == "One,Two,Three" +" let mylist = QuickSortList( mylist, 0, GetListCount(mylist)-1 ) +" " mylist == "One,Three,Two" +" +"----------------------------------------------------------------------------- +" Updates: +" in version 0.1 +" - First version + +" Has this already been loaded ? +if exists("loaded_libList") + finish +endif +let loaded_libList=1 + +"** +" Separator: +" You may change the separator character et any time. +"** +let g:listSep = "," + +"** +"AddListItem: +" Add new item at given position. +" First item index is 0 (zero). +"Parameters: +" - array : Array/List (string of values) which receives the new item. +" - newItem : String containing the item value to add. +" - index : Integer indicating the position at which the new item is added. +" It must be greater than or equals to 0 (zero). +"Return: +"String containing array values, including newItem. +"** +function AddListItem( array, newItem, index ) + if a:index == 0 + if a:array == "" + return a:newItem + endif + return a:newItem . g:listSep . a:array + endif + return substitute( a:array, '\(\%(^\|' . g:listSep . '\)[^' . g:listSep . ']\+\)\{' . a:index . '\}', '\0' . g:listSep . a:newItem , "" ) +endfunction + +"** +"GetListItem: +" Get item at given position. +"Parameters: +" - array : Array/List (string of values). +" - index : Integer indicating the position of item to return. +" It must be greater than or equals to 0 (zero). +"Return: +"String representing the item. +"** +function GetListItem( array, index ) + if a:index == 0 + return matchstr( a:array, '^[^' . g:listSep . ']\+' ) + else + return matchstr( a:array, "[^" . g:listSep . "]\\+", matchend( a:array, '\(\%(^\|' . g:listSep . '\)[^' . g:listSep . ']\+\)\{' . a:index . '\}' . g:listSep ) ) + endif +endfunction + +"** +"GetListMatchItem: +" Get the first item matching given pattern. +"Parameters: +" - array : Array/List (string of values). +" - pattern : Regular expression to match with items. +" Avoid to use ^, $ and listSep characters in pattern, unless you +" know what you do. +"Return: +"String representing the first item that matches the pattern. +"** +function GetListMatchItem( array, pattern ) + return matchstr( a:array, '[^' . g:listSep . ']*' . a:pattern . '[^' . g:listSep . ']*' ) +endfunction + +"** +"ReplaceListItem: +" Replace item at given position by a new one. +"Parameters: +" - array : Array/List (string of values). +" - index : Integer indicating the position of item to replace. +" It must be greater than or equals to 0 (zero). +" - item : String containing the new value of the replaced item. +"Return: +"String containing array values. +"** +function ReplaceListItem( array, index, item ) + if a:index == 0 + return substitute( a:array, '^[^' .g:listSep. ']\+', a:item, "" ) + else + return substitute( a:array, '\(\%(\%(^\|' . g:listSep . '\)[^' . g:listSep . ']\+\)\{' . a:index . '\}\)' . g:listSep . '[^' . g:listSep . ']\+', '\1' . g:listSep . a:item , "" ) + endif +endfunction + +"** +"RemoveListItem: +" Remove item at given position. +"Parameters: +" - array : Array/List (string of values) from which remove an item. +" - index : Integer indicating the position of item to remove. +" It must be greater than or equals to 0 (zero). +"Return: +"String containing array values, except the removed one. +"** +function RemoveListItem( array, index ) + if a:index == 0 + return substitute( a:array, '^[^' .g:listSep. ']\+\(' . g:listSep . '\|$\)', "", "" ) + else + return substitute( a:array, '\(\%(\%(^\|' . g:listSep . '\)[^' . g:listSep . ']\+\)\{' . a:index . '\}\)' . g:listSep . '[^' . g:listSep . ']\+', '\1', "" ) + endif +endfunction + +"** +"ExchangeListItems: +" Exchange item at position item1Index with item at position item2Index. +"Parameters: +" - array : Array/List (string of values). +" - item1index : Integer indicating the position of the first item to exchange. +" It must be greater than or equals to 0 (zero). +" - item2index : Integer indicating the position of the second item to +" exchange. It must be greater than or equals to 0 (zero). +"Return: +"String containing array values. +"** +function ExchangeListItems( array, item1Index, item2Index ) + let item1 = GetListItem( a:array, a:item1Index ) + let array = ReplaceListItem( a:array, a:item1Index, GetListItem( a:array, a:item2Index ) ) + return ReplaceListItem( array, a:item2Index, item1 ) +endfunction + +"** +"GetListCount: +" Number of items in array. +"Parameters: +" - array : Array/List (string of values). +"Return: +"Integer representing the number of items in array. +"Index of last item is GetListCount(array)-1. +"** +function GetListCount( array ) + if a:array == "" | return 0 | endif + let pos = 0 + let cnt = 0 + while pos != -1 + let pos = matchend( a:array, g:listSep, pos ) + let cnt = cnt + 1 + endwhile + return cnt +endfunction + +"** +"QuickSortList: +" Sort array. +"Parameters: +" - array : Array/List (string of values). +" - beg : Min index of the range of items to sort. +" - end : Max index of the range of items to sort. +"Return: +"String containing array values with indicated range of items sorted. +"** +function QuickSortList( array, beg, end ) + let array = a:array + let pivot = GetListItem( array, a:beg ) + let l = a:beg + let r = a:end + while l < r + while GetListItem( array, r ) > pivot + let r = r - 1 + endwhile + if l != r + let array = ReplaceListItem( array, l, GetListItem( array, r ) ) + let array = ReplaceListItem( array, r, pivot ) + let l = l + 1 + endif + + while GetListItem( array, l ) < pivot + let l = l + 1 + endwhile + if l != r + let array = ReplaceListItem( array, r, GetListItem( array, l ) ) + let array = ReplaceListItem( array, l, pivot ) + let r = r - 1 + endif + endwhile + if a:beg < l-1 + let array = QuickSortList( array, a:beg, l-1 ) + endif + if a:end > l+1 + let array = QuickSortList( array, l+1, a:end ) + endif + return array +endfunction + + diff --git a/.vim/plugin/remoteOpen.vim b/.vim/plugin/remoteOpen.vim @@ -0,0 +1,163 @@ +" File: remoteOpen.vim +" Author: Srinath Avadhanula <srinath AT fastmail DOT fm> +" $Id: remoteOpen.vim 1080 2010-01-26 22:02:34Z tmaas $ +" +" Description: +" Often times, an external program needs to open a file in gvim from the +" command line. However, it will not know if the file is already opened in a +" previous vim session. It is not sufficient to simply specify +" +" gvim --remote-silent <filename> +" +" because this simply opens up <filename> in the first remote gvim session it +" sees. This script provides a command RemoteOpen which is meant to be used +" from the command line as follows: +" +" gvim -c ":RemoteOpen +<lnum> <filename>" +" +" where <lnum> is the line-number you wish <filename> to open to. What will +" happen is that a new gvim will start up and enquire from all previous +" sessions if <filename> is already open in any of them. If it is, then it +" will edit the file in that session and bring it to the foreground and itself +" quit. Otherwise, it will not quit and instead open up the file for editing +" at <lnum>. +" +" This was mainly created to be used with Yap (the dvi previewer in miktex), +" so you can specify the program for "inverse search" as specified above. +" This ensures that the inverse search uses the correct gvim each time. +" +" Ofcourse, this requires vim with +clientserver. If not, then RemoteOpen just +" opens in the present session. + +" Enclose <args> in single quotes so it can be passed as a function argument. +com! -nargs=1 RemoteOpen :call RemoteOpen('<args>') +com! -nargs=? RemoteInsert :call RemoteInsert('<args>') + +" RemoteOpen: open a file remotely (if possible) {{{ +" Description: checks all open vim windows to see if this file has been opened +" anywhere and if so, opens it there instead of in this session. +function! RemoteOpen(arglist) + + " First construct line number and filename from argument. a:arglist is of + " the form: + " +10 c:\path\to\file + " or just + " c:\path\to\file + if a:arglist =~ '^\s*+\d\+' + let linenum = matchstr(a:arglist, '^\s*+\zs\d\+\ze') + let filename = matchstr(a:arglist, '^\s*+\d\+\s*\zs.*\ze') + else + let linenum = 1 + let filename = matchstr(a:arglist, '^\s*\zs.*\ze') + endif + let filename = escape(filename, ' ') + call Tex_Debug("linenum = ".linenum.', filename = '.filename, "ropen") + + " If there is no clientserver functionality, then just open in the present + " session and return + if !has('clientserver') + call Tex_Debug("-clientserver, opening locally and returning", "ropen") + exec "e ".filename + exec linenum + normal! zv + return + endif + + " Otherwise, loop through all available servers + let servers = serverlist() + " If there are no servers, open file locally. + if servers == '' + call Tex_Debug("no open servers, opening locally", "ropen") + exec "e ".filename + exec linenum + let g:Remote_Server = 1 + normal! zv + return + endif + + let i = 1 + let server = s:Strntok(servers, "\n", i) + let targetServer = v:servername + + while server != '' + " Find out if there was any server which was used by remoteOpen before + " this. If a new gvim session was ever started via remoteOpen, then + " g:Remote_Server will be set. + if remote_expr(server, 'exists("g:Remote_Server")') + let targetServer = server + endif + + " Ask each server if that file is being edited by them. + let bufnum = remote_expr(server, "bufnr('".filename."')") + " If it is... + if bufnum != -1 + " ask the server to edit that file and come to the foreground. + " set a variable g:Remote_Server to indicate that this server + " session has at least one file opened via RemoteOpen + let targetServer = server + break + end + + let i = i + 1 + let server = s:Strntok(servers, "\n", i) + endwhile + + " If none of the servers have the file open, then open this file in the + " first server. This has the advantage if yap tries to make vim open + " multiple vims, then at least they will all be opened by the same gvim + " server. + call remote_send(targetServer, + \ "\<C-\>\<C-n>". + \ ":let g:Remote_Server = 1\<CR>". + \ ":drop ".filename."\<CR>". + \ ":".linenum."\<CR>zv" + \ ) + call remote_foreground(targetServer) + " quit this vim session + if v:servername != targetServer + q + endif +endfunction " }}} +" RemoteInsert: inserts a \cite'ation remotely (if possible) {{{ +" Description: +function! RemoteInsert(...) + + let citation = matchstr(argv(0), "\\[InsText('.cite{\\zs.\\{-}\\ze}');\\]") + if citation == "" + q + endif + + " Otherwise, loop through all available servers + let servers = serverlist() + + let i = 1 + let server = s:Strntok(servers, "\n", i) + let targetServer = v:servername + + while server != '' + if remote_expr(server, 'exists("g:Remote_WaitingForCite")') + call remote_send(server, citation . "\<CR>") + call remote_foreground(server) + if v:servername != server + q + else + return + endif + endif + + let i = i + 1 + let server = s:Strntok(servers, "\n", i) + endwhile + + q + +endfunction " }}} +" Strntok: extract the n^th token from a list {{{ +" example: Strntok('1,23,3', ',', 2) = 23 +fun! <SID>Strntok(s, tok, n) + return matchstr( a:s.a:tok[0], '\v(\zs([^'.a:tok.']*)\ze['.a:tok.']){'.a:n.'}') +endfun + +" }}} + +" vim:ft=vim:ts=4:sw=4:noet:fdm=marker:commentstring=\"\ %s:nowrap diff --git a/.vim/plugin/vcsbzr.vim b/.vim/plugin/vcsbzr.vim @@ -0,0 +1,264 @@ +" vim600: set foldmethod=marker: +" +" BZR extension for VCSCommand. +" +" Maintainer: Bob Hiestand <bob.hiestand@gmail.com> +" License: +" Copyright (c) Bob Hiestand +" +" Permission is hereby granted, free of charge, to any person obtaining a copy +" of this software and associated documentation files (the "Software"), to +" deal in the Software without restriction, including without limitation the +" rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +" sell copies of the Software, and to permit persons to whom the Software is +" furnished to do so, subject to the following conditions: +" +" The above copyright notice and this permission notice shall be included in +" all copies or substantial portions of the Software. +" +" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +" FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +" IN THE SOFTWARE. +" +" Section: Documentation {{{1 +" +" Options documentation: {{{2 +" +" VCSCommandBZRExec +" This variable specifies the BZR executable. If not set, it defaults to +" 'bzr' executed from the user's executable path. + +" Section: Plugin header {{{1 + +if exists('VCSCommandDisableAll') + finish +endif + +if v:version < 700 + echohl WarningMsg|echomsg 'VCSCommand requires at least VIM 7.0'|echohl None + finish +endif + +if !exists('g:loaded_VCSCommand') + runtime plugin/vcscommand.vim +endif + +if !executable(VCSCommandGetOption('VCSCommandBZRExec', 'bzr')) + " BZR is not installed + finish +endif + +let s:save_cpo=&cpo +set cpo&vim + +" Section: Variable initialization {{{1 + +let s:bzrFunctions = {} + +" Section: Utility functions {{{1 + +" Function: s:Executable() {{{2 +" Returns the executable used to invoke bzr suitable for use in a shell +" command. +function! s:Executable() + return VCSCommandGetOption('VCSCommandBZRExec', 'bzr') +endfunction + +" Function: s:DoCommand(cmd, cmdName, statusText) {{{2 +" Wrapper to VCSCommandDoCommand to add the name of the BZR executable to the +" command argument. +function! s:DoCommand(cmd, cmdName, statusText, options) + if VCSCommandGetVCSType(expand('%')) == 'BZR' + let fullCmd = s:Executable() . ' ' . a:cmd + return VCSCommandDoCommand(fullCmd, a:cmdName, a:statusText, a:options) + else + throw 'BZR VCSCommand plugin called on non-BZR item.' + endif +endfunction + +" Section: VCS function implementations {{{1 + +" Function: s:bzrFunctions.Identify(buffer) {{{2 +function! s:bzrFunctions.Identify(buffer) + let fileName = resolve(bufname(a:buffer)) + let l:save_bzr_log=$BZR_LOG + try + let $BZR_LOG=has("win32") || has("win95") || has("win64") || has("win16") ? "nul" : "/dev/null" + let statusText = s:VCSCommandUtility.system(s:Executable() . ' info -- "' . fileName . '"') + finally + let $BZR_LOG=l:save_bzr_log + endtry + if(v:shell_error) + return 0 + else + return 1 + endif +endfunction + +" Function: s:bzrFunctions.Add() {{{2 +function! s:bzrFunctions.Add(argList) + return s:DoCommand(join(['add'] + a:argList, ' '), 'add', join(a:argList, ' '), {}) +endfunction + +" Function: s:bzrFunctions.Annotate(argList) {{{2 +function! s:bzrFunctions.Annotate(argList) + if len(a:argList) == 0 + if &filetype ==? 'bzrannotate' + " Perform annotation of the version indicated by the current line. + let caption = matchstr(getline('.'),'\v^\s+\zs\d+') + let options = ' -r' . caption + else + let caption = '' + let options = '' + endif + elseif len(a:argList) == 1 && a:argList[0] !~ '^-' + let caption = a:argList[0] + let options = ' -r' . caption + else + let caption = join(a:argList, ' ') + let options = ' ' . caption + endif + + let resultBuffer = s:DoCommand('blame' . options, 'annotate', caption, {}) + if resultBuffer > 0 + normal! 1G2dd + endif + return resultBuffer +endfunction + +" Function: s:bzrFunctions.Commit(argList) {{{2 +function! s:bzrFunctions.Commit(argList) + let resultBuffer = s:DoCommand('commit -F "' . a:argList[0] . '"', 'commit', '', {}) + if resultBuffer == 0 + echomsg 'No commit needed.' + endif +endfunction + +" Function: s:bzrFunctions.Delete() {{{2 +function! s:bzrFunctions.Delete(argList) + return s:DoCommand(join(['rm'] + a:argList, ' '), 'rm', join(a:argList, ' '), {}) +endfunction + +" Function: s:bzrFunctions.Diff(argList) {{{2 +function! s:bzrFunctions.Diff(argList) + if len(a:argList) == 0 + let revOptions = [] + let caption = '' + elseif len(a:argList) <= 2 && match(a:argList, '^-') == -1 + let revOptions = ['-r' . join(a:argList, '..')] + let caption = '(' . a:argList[0] . ' : ' . get(a:argList, 1, 'current') . ')' + else + " Pass-through + let caption = join(a:argList, ' ') + let revOptions = a:argList + endif + + return s:DoCommand(join(['diff'] + revOptions), 'diff', caption, {'allowNonZeroExit': 1}) +endfunction + +" Function: s:bzrFunctions.GetBufferInfo() {{{2 +" Provides version control details for the current file. Current version +" number and current repository version number are required to be returned by +" the vcscommand plugin. +" Returns: List of results: [revision, repository] + +function! s:bzrFunctions.GetBufferInfo() + let originalBuffer = VCSCommandGetOriginalBuffer(bufnr('%')) + let fileName = resolve(bufname(originalBuffer)) + let statusText = s:VCSCommandUtility.system(s:Executable() . ' status -S -- "' . fileName . '"') + let revision = s:VCSCommandUtility.system(s:Executable() . ' revno -- "' . fileName . '"') + if(v:shell_error) + return [] + endif + + " File not under BZR control. + if statusText =~ '^?' + return ['Unknown'] + endif + + let [flags, repository] = matchlist(statusText, '^\(.\{3}\)\s\+\(\S\+\)')[1:2] + if revision == '' + " Error + return ['Unknown'] + elseif flags =~ '^A' + return ['New', 'New'] + else + return [revision, repository] + endif +endfunction + +" Function: s:bzrFunctions.Info(argList) {{{2 +function! s:bzrFunctions.Info(argList) + return s:DoCommand(join(['version-info'] + a:argList, ' '), 'version-info', join(a:argList, ' '), {}) +endfunction + +" Function: s:bzrFunctions.Lock(argList) {{{2 +function! s:bzrFunctions.Lock(argList) + echomsg 'bzr lock is not necessary' +endfunction + +" Function: s:bzrFunctions.Log() {{{2 +function! s:bzrFunctions.Log(argList) + if len(a:argList) == 0 + let options = [] + let caption = '' + elseif len(a:argList) <= 2 && match(a:argList, '^-') == -1 + let options = ['-r' . join(a:argList, ':')] + let caption = options[0] + else + " Pass-through + let options = a:argList + let caption = join(a:argList, ' ') + endif + + let resultBuffer = s:DoCommand(join(['log', '-v'] + options), 'log', caption, {}) + return resultBuffer +endfunction + +" Function: s:bzrFunctions.Revert(argList) {{{2 +function! s:bzrFunctions.Revert(argList) + return s:DoCommand('revert', 'revert', '', {}) +endfunction + +" Function: s:bzrFunctions.Review(argList) {{{2 +function! s:bzrFunctions.Review(argList) + if len(a:argList) == 0 + let versiontag = '(current)' + let versionOption = '' + else + let versiontag = a:argList[0] + let versionOption = ' -r ' . versiontag . ' ' + endif + + return s:DoCommand('cat' . versionOption, 'review', versiontag, {}) +endfunction + +" Function: s:bzrFunctions.Status(argList) {{{2 +function! s:bzrFunctions.Status(argList) + let options = ['-S'] + if len(a:argList) != 0 + let options = a:argList + endif + return s:DoCommand(join(['status'] + options, ' '), 'status', join(options, ' '), {}) +endfunction + +" Function: s:bzrFunctions.Unlock(argList) {{{2 +function! s:bzrFunctions.Unlock(argList) + echomsg 'bzr unlock is not necessary' +endfunction +" Function: s:bzrFunctions.Update(argList) {{{2 +function! s:bzrFunctions.Update(argList) + return s:DoCommand('update', 'update', '', {}) +endfunction + +" Annotate setting {{{2 +let s:bzrFunctions.AnnotateSplitRegex = '^[^|]\+ | ' + +" Section: Plugin Registration {{{1 +let s:VCSCommandUtility = VCSCommandRegisterModule('BZR', expand('<sfile>'), s:bzrFunctions, []) + +let &cpo = s:save_cpo diff --git a/.vim/plugin/vcscommand.vim b/.vim/plugin/vcscommand.vim @@ -0,0 +1,1527 @@ +" vim600: set foldmethod=marker: +" +" Vim plugin to assist in working with files under control of various Version +" Control Systems, such as CVS, SVN, SVK, and git. +" +" Maintainer: Bob Hiestand <bob.hiestand@gmail.com> +" License: +" Copyright (c) Bob Hiestand +" +" Permission is hereby granted, free of charge, to any person obtaining a copy +" of this software and associated documentation files (the "Software"), to +" deal in the Software without restriction, including without limitation the +" rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +" sell copies of the Software, and to permit persons to whom the Software is +" furnished to do so, subject to the following conditions: +" +" The above copyright notice and this permission notice shall be included in +" all copies or substantial portions of the Software. +" +" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +" FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +" IN THE SOFTWARE. +" +" Section: Documentation {{{1 +" +" Provides functions to invoke various source control commands on the current +" file (either the current buffer, or, in the case of an directory buffer, the +" directory and all subdirectories associated with the current buffer). The +" output of the commands is captured in a new scratch window. +" +" This plugin needs additional extension plugins, each specific to a source +" control system, to function. Several options include the name of the +" version control system in the option name. Such options use the placeholder +" text '{VCSType}', which would be replaced in actual usage with 'CVS' or +" 'SVN', for instance. +" +" Command documentation {{{2 +" +" VCSAdd Adds the current file to source control. +" +" VCSAnnotate[!] Displays the current file with each line annotated with the +" version in which it was most recently changed. If an +" argument is given, the argument is used as a revision +" number to display. If not given an argument, it uses the +" most recent version of the file on the current branch. +" Additionally, if the current buffer is a VCSAnnotate buffer +" already, the version number on the current line is used. +" +" If '!' is used, the view of the annotated buffer is split +" so that the annotation is in a separate window from the +" content, and each is highlighted separately. +" +" VCSBlame Alias for 'VCSAnnotate'. +" +" VCSCommit[!] Commits changes to the current file to source control. +" +" If called with arguments, the arguments are the log message. +" +" If '!' is used, an empty log message is committed. +" +" If called with no arguments, this is a two-step command. +" The first step opens a buffer to accept a log message. +" When that buffer is written, it is automatically closed and +" the file is committed using the information from that log +" message. The commit can be abandoned if the log message +" buffer is deleted or wiped before being written. +" +" VCSDelete Deletes the current file and removes it from source control. +" +" VCSDiff With no arguments, this displays the differences between +" the current file and its parent version under source +" control in a new scratch buffer. +" +" With one argument, the diff is performed on the +" current file against the specified revision. +" +" With two arguments, the diff is performed between the +" specified revisions of the current file. +" +" This command uses the 'VCSCommand{VCSType}DiffOpt' variable +" to specify diff options. If that variable does not exist, +" a plugin-specific default is used. If you wish to have no +" options, then set it to the empty string. +" +" VCSGotoOriginal Jumps to the source buffer if the current buffer is a VCS +" scratch buffer. If VCSGotoOriginal[!] is used, remove all +" VCS scratch buffers associated with the original file. +" +" VCSInfo Displays extended information about the current file in a +" new scratch buffer. +" +" VCSLock Locks the current file in order to prevent other users from +" concurrently modifying it. The exact semantics of this +" command depend on the underlying VCS. +" +" VCSLog Displays the version history of the current file in a new +" scratch buffer. +" +" VCSRemove Alias for 'VCSDelete'. +" +" VCSRevert Replaces the modified version of the current file with the +" most recent version from the repository. +" +" VCSReview Displays a particular version of the current file in a new +" scratch buffer. If no argument is given, the most recent +" version of the file on the current branch is retrieved. +" +" VCSStatus Displays versioning information about the current file in a +" new scratch buffer. +" +" VCSUnlock Unlocks the current file in order to allow other users from +" concurrently modifying it. The exact semantics of this +" command depend on the underlying VCS. +" +" VCSUpdate Updates the current file with any relevant changes from the +" repository. +" +" VCSVimDiff Uses vimdiff to display differences between versions of the +" current file. +" +" If no revision is specified, the most recent version of the +" file on the current branch is used. With one argument, +" that argument is used as the revision as above. With two +" arguments, the differences between the two revisions is +" displayed using vimdiff. +" +" With either zero or one argument, the original buffer is +" used to perform the vimdiff. When the scratch buffer is +" closed, the original buffer will be returned to normal +" mode. +" +" Once vimdiff mode is started using the above methods, +" additional vimdiff buffers may be added by passing a single +" version argument to the command. There may be up to 4 +" vimdiff buffers total. +" +" Using the 2-argument form of the command resets the vimdiff +" to only those 2 versions. Additionally, invoking the +" command on a different file will close the previous vimdiff +" buffers. +" +" Mapping documentation: {{{2 +" +" By default, a mapping is defined for each command. User-provided mappings +" can be used instead by mapping to <Plug>CommandName, for instance: +" +" nmap ,ca <Plug>VCSAdd +" +" The default mappings are as follow: +" +" <Leader>ca VCSAdd +" <Leader>cn VCSAnnotate +" <Leader>cN VCSAnnotate! +" <Leader>cc VCSCommit +" <Leader>cD VCSDelete +" <Leader>cd VCSDiff +" <Leader>cg VCSGotoOriginal +" <Leader>cG VCSGotoOriginal! +" <Leader>ci VCSInfo +" <Leader>cl VCSLog +" <Leader>cL VCSLock +" <Leader>cr VCSReview +" <Leader>cs VCSStatus +" <Leader>cu VCSUpdate +" <Leader>cU VCSUnlock +" <Leader>cv VCSVimDiff +" +" Options documentation: {{{2 +" +" Several variables are checked by the script to determine behavior as follow: +" +" VCSCommandCommitOnWrite +" This variable, if set to a non-zero value, causes the pending commit to +" take place immediately as soon as the log message buffer is written. If +" set to zero, only the VCSCommit mapping will cause the pending commit to +" occur. If not set, it defaults to 1. +" +" VCSCommandDeleteOnHide +" This variable, if set to a non-zero value, causes the temporary VCS result +" buffers to automatically delete themselves when hidden. +" +" VCSCommand{VCSType}DiffOpt +" This variable, if set, determines the options passed to the diff command +" of the underlying VCS. Each VCS plugin defines a default value. +" +" VCSCommandDiffSplit +" This variable overrides the VCSCommandSplit variable, but only for buffers +" created with VCSVimDiff. +" +" VCSCommandDisableAll +" This variable, if set, prevents the plugin or any extensions from loading +" at all. This is useful when a single runtime distribution is used on +" multiple systems with varying versions. +" +" VCSCommandDisableMappings +" This variable, if set to a non-zero value, prevents the default command +" mappings from being set. +" +" VCSCommandDisableExtensionMappings +" This variable, if set to a non-zero value, prevents the default command +" mappings from being set for commands specific to an individual VCS. +" +" VCSCommandDisableMenu +" This variable, if set to a non-zero value, prevents the default command +" menu from being set. +" +" VCSCommandEdit +" This variable controls whether to split the current window to display a +" scratch buffer ('split'), or to display it in the current buffer ('edit'). +" If not set, it defaults to 'split'. +" +" VCSCommandEnableBufferSetup +" This variable, if set to a non-zero value, activates VCS buffer management +" mode. This mode means that the buffer variable 'VCSRevision' is set if +" the file is VCS-controlled. This is useful for displaying version +" information in the status bar. Additional options may be set by +" individual VCS plugins. +" +" VCSCommandMappings +" This variable, if set, overrides the default mappings used for shortcuts. +" It should be a List of 2-element Lists, each containing a shortcut and +" function name pair. +" +" VCSCommandMapPrefix +" This variable, if set, overrides the default mapping prefix ('<Leader>c'). +" This allows customization of the mapping space used by the vcscommand +" shortcuts. +" +" VCSCommandMenuPriority +" This variable, if set, overrides the default menu priority '' (empty) +" +" VCSCommandMenuRoot +" This variable, if set, overrides the default menu root 'Plugin.VCS' +" +" VCSCommandResultBufferNameExtension +" This variable, if set to a non-blank value, is appended to the name of the +" VCS command output buffers. For example, '.vcs'. Using this option may +" help avoid problems caused by autocommands dependent on file extension. +" +" VCSCommandResultBufferNameFunction +" This variable, if set, specifies a custom function for naming VCS command +" output buffers. This function will be passed the following arguments: +" +" command - name of the VCS command being executed (such as 'Log' or +" 'Diff'). +" +" originalBuffer - buffer number of the source file. +" +" vcsType - type of VCS controlling this file (such as 'CVS' or 'SVN'). +" +" statusText - extra text associated with the VCS action (such as version +" numbers). +" +" VCSCommandSplit +" This variable controls the orientation of the various window splits that +" may occur (such as with VCSVimDiff, when using a VCS command on a VCS +" command buffer, or when the 'VCSCommandEdit' variable is set to 'split'. +" If set to 'horizontal', the resulting windows will be on stacked on top of +" one another. If set to 'vertical', the resulting windows will be +" side-by-side. If not set, it defaults to 'horizontal' for all but +" VCSVimDiff windows. +" +" VCSCommandVCSTypeOverride +" This variable allows the VCS type detection to be overridden on a +" path-by-path basis. The value of this variable is expected to be a List +" of Lists. Each high-level List item is a List containing two elements. +" The first element is a regular expression that will be matched against the +" full file name of a given buffer. If it matches, the second element will +" be used as the VCS type. +" +" VCSCommandVCSTypePreference +" This variable allows the VCS type detection to be weighted towards a +" specific VCS, in case more than one potential VCS is detected as useable. +" The format of the variable is either a list or a space-separated string +" containing the ordered-by-preference abbreviations of the preferred VCS +" types. +" +" Event documentation {{{2 +" For additional customization, VCSCommand.vim uses User event autocommand +" hooks. Each event is in the VCSCommand group, and different patterns +" match the various hooks. +" +" For instance, the following could be added to the vimrc to provide a 'q' +" mapping to quit a VCS scratch buffer: +" +" augroup VCSCommand +" au VCSCommand User VCSBufferCreated silent! nmap <unique> <buffer> q :bwipeout<cr> +" augroup END +" +" The following hooks are available: +" +" VCSBufferCreated This event is fired just after a VCS command +" output buffer is created. It is executed +" within the context of the new buffer. +" +" VCSBufferSetup This event is fired just after VCS buffer setup +" occurs, if enabled. +" +" VCSPluginInit This event is fired when the VCSCommand plugin +" first loads. +" +" VCSPluginFinish This event is fired just after the VCSCommand +" plugin loads. +" +" VCSVimDiffFinish This event is fired just after the VCSVimDiff +" command executes to allow customization of, +" for instance, window placement and focus. +" +" Section: Plugin header {{{1 + +" loaded_VCSCommand is set to 1 when the initialization begins, and 2 when it +" completes. This allows various actions to only be taken by functions after +" system initialization. + +if exists('VCSCommandDisableAll') + finish +endif + +if exists('loaded_VCSCommand') + finish +endif +let loaded_VCSCommand = 1 + +if v:version < 700 + echohl WarningMsg|echomsg 'VCSCommand requires at least VIM 7.0'|echohl None + finish +endif + +let s:save_cpo=&cpo +set cpo&vim + +" Section: Event group setup {{{1 + +augroup VCSCommand +augroup END + +augroup VCSCommandCommit +augroup END + +" Section: Plugin initialization {{{1 +silent do VCSCommand User VCSPluginInit + +" Section: Constants declaration {{{1 + +let g:VCSCOMMAND_IDENTIFY_EXACT = 1 +let g:VCSCOMMAND_IDENTIFY_INEXACT = -1 + +" Section: Script variable initialization {{{1 + +" Hidden functions for use by extensions +let s:VCSCommandUtility = {} + +" plugin-specific information: {vcs -> [script, {command -> function}, {key -> mapping}]} +let s:plugins = {} + +" Stack of dictionaries representing nested options +let s:executionContext = [] + +" state flag used to vary behavior of certain automated actions +let s:isEditFileRunning = 0 + +" Section: Utility functions {{{1 + +" Function: s:ReportError(mapping) {{{2 +" Displays the given error in a consistent faction. This is intended to be +" invoked from a catch statement. + +function! s:ReportError(error) + echohl WarningMsg|echomsg 'VCSCommand: ' . a:error|echohl None +endfunction + +" Function: s:VCSCommandUtility.system(...) {{{2 +" Replacement for system() function. This version protects the quoting in the +" command line on Windows systems. + +function! s:VCSCommandUtility.system(...) + if (has("win32") || has("win64")) && &sxq !~ '"' + let save_sxq = &sxq + set sxq=\" + endif + try + let output = call('system', a:000) + if exists('*iconv') && has('multi_byte') + if(strlen(&tenc) && &tenc != &enc) + let output = iconv(output, &tenc, &enc) + else + let originalBuffer = VCSCommandGetOriginalBuffer(VCSCommandGetOption('VCSCommandEncodeAsFile', 0)) + if originalBuffer + let fenc = getbufvar(originalBuffer, '&fenc') + if fenc != &enc + let output = iconv(output, fenc, &enc) + endif + endif + endif + + endif + finally + if exists("save_sxq") + let &sxq = save_sxq + endif + endtry + return output +endfunction + +" Function: s:VCSCommandUtility.addMenuItem(shortcut, command) {{{2 +" Adds the given menu item. + +function! s:VCSCommandUtility.addMenuItem(shortcut, command) + if s:menuEnabled + exe 'amenu <silent> '.s:menuPriority.' '.s:menuRoot.'.'.a:shortcut.' '.a:command + endif +endfunction + +" Function: s:VCSCommandUtility.pushContext(context) {{{2 +" Adds a dictionary containing current options to the stack. + +function! s:VCSCommandUtility.pushContext(context) + call insert(s:executionContext, a:context) +endfunction + +" Function: s:VCSCommandUtility.popContext() {{{2 +" Removes a dictionary containing current options from the stack. + +function! s:VCSCommandUtility.popContext() + call remove(s:executionContext, 0) +endfunction + +" Function: s:ClearMenu() {{{2 +" Removes all VCSCommand menu items +function! s:ClearMenu() + if s:menuEnabled + execute 'aunmenu' s:menuRoot + endif +endfunction + +" Function: s:CreateMapping(shortcut, expansion, display) {{{2 +" Creates the given mapping by prepending the contents of +" 'VCSCommandMapPrefix' (by default '<Leader>c') to the given shortcut and +" mapping it to the given plugin function. If a mapping exists for the +" specified shortcut + prefix, emit an error but continue. If a mapping +" exists for the specified function, do nothing. + +function! s:CreateMapping(shortcut, expansion, display) + let lhs = VCSCommandGetOption('VCSCommandMapPrefix', '<Leader>c') . a:shortcut + if !hasmapto(a:expansion) + try + execute 'nmap <silent> <unique>' lhs a:expansion + catch /^Vim(.*):E227:/ + if(&verbose != 0) + echohl WarningMsg|echomsg 'VCSCommand: mapping ''' . lhs . ''' already exists, refusing to overwrite. The mapping for ' . a:display . ' will not be available.'|echohl None + endif + endtry + endif +endfunction + +" Function: s:ExecuteExtensionMapping(mapping) {{{2 +" Invokes the appropriate extension mapping depending on the type of the +" current buffer. + +function! s:ExecuteExtensionMapping(mapping) + let buffer = bufnr('%') + let vcsType = VCSCommandGetVCSType(buffer) + if !has_key(s:plugins, vcsType) + throw 'Unknown VCS type: ' . vcsType + endif + if !has_key(s:plugins[vcsType][2], a:mapping) + throw 'This extended mapping is not defined for ' . vcsType + endif + silent execute 'normal!' ':' . s:plugins[vcsType][2][a:mapping] . "\<CR>" +endfunction + +" Function: s:ExecuteVCSCommand(command, argList) {{{2 +" Calls the indicated plugin-specific VCS command on the current buffer. +" Returns: buffer number of resulting output scratch buffer, or -1 if an error +" occurs. + +function! s:ExecuteVCSCommand(command, argList) + try + let buffer = bufnr('%') + + let vcsType = VCSCommandGetVCSType(buffer) + if !has_key(s:plugins, vcsType) + throw 'Unknown VCS type: ' . vcsType + endif + + let originalBuffer = VCSCommandGetOriginalBuffer(buffer) + let bufferName = bufname(originalBuffer) + + " It is already known that the directory is under VCS control. No further + " checks are needed. Otherwise, perform some basic sanity checks to avoid + " VCS-specific error messages from confusing things. + if !isdirectory(bufferName) + if !filereadable(bufferName) + throw 'No such file ' . bufferName + endif + endif + + let functionMap = s:plugins[vcsType][1] + if !has_key(functionMap, a:command) + throw 'Command ''' . a:command . ''' not implemented for ' . vcsType + endif + return functionMap[a:command](a:argList) + catch + call s:ReportError(v:exception) + return -1 + endtry +endfunction + +" Function: s:GenerateResultBufferName(command, originalBuffer, vcsType, statusText) {{{2 +" Default method of generating the name for VCS result buffers. This can be +" overridden with the VCSResultBufferNameFunction variable. + +function! s:GenerateResultBufferName(command, originalBuffer, vcsType, statusText) + let fileName = bufname(a:originalBuffer) + let bufferName = a:vcsType . ' ' . a:command + if strlen(a:statusText) > 0 + let bufferName .= ' ' . a:statusText + endif + let bufferName .= ' ' . fileName + let counter = 0 + let versionedBufferName = bufferName + while bufexists(versionedBufferName) + let counter += 1 + let versionedBufferName = bufferName . ' (' . counter . ')' + endwhile + return versionedBufferName +endfunction + +" Function: s:GenerateResultBufferNameWithExtension(command, originalBuffer, vcsType, statusText) {{{2 +" Method of generating the name for VCS result buffers that uses the original +" file name with the VCS type and command appended as extensions. + +function! s:GenerateResultBufferNameWithExtension(command, originalBuffer, vcsType, statusText) + let fileName = bufname(a:originalBuffer) + let bufferName = a:vcsType . ' ' . a:command + if strlen(a:statusText) > 0 + let bufferName .= ' ' . a:statusText + endif + let bufferName .= ' ' . fileName . VCSCommandGetOption('VCSCommandResultBufferNameExtension', '.vcs') + let counter = 0 + let versionedBufferName = bufferName + while bufexists(versionedBufferName) + let counter += 1 + let versionedBufferName = '(' . counter . ') ' . bufferName + endwhile + return versionedBufferName +endfunction + +" Function: s:EditFile(command, originalBuffer, statusText) {{{2 +" Creates a new buffer of the given name and associates it with the given +" original buffer. + +function! s:EditFile(command, originalBuffer, statusText) + let vcsType = getbufvar(a:originalBuffer, 'VCSCommandVCSType') + + " Protect against useless buffer set-up + let s:isEditFileRunning += 1 + try + let editCommand = VCSCommandGetOption('VCSCommandEdit', 'split') + if editCommand == 'split' + if VCSCommandGetOption('VCSCommandSplit', 'horizontal') == 'horizontal' + rightbelow split + else + vert rightbelow split + endif + endif + + enew + + call s:SetupScratchBuffer(a:command, vcsType, a:originalBuffer, a:statusText) + + finally + let s:isEditFileRunning -= 1 + endtry +endfunction + +" Function: s:IdentifyVCSType() {{{2 +" This function implements the non-cached identification strategy for +" VcsCommandGetVCSType(). +" +" Returns: VCS type name identified for the given buffer; an exception is +" thrown in case no type can be identified. + +function! s:IdentifyVCSType(buffer) + if exists("g:VCSCommandVCSTypeOverride") + let fullpath = fnamemodify(bufname(a:buffer), ':p') + for [path, vcsType] in g:VCSCommandVCSTypeOverride + if match(fullpath, path) > -1 + return vcsType + endif + endfor + endif + let matches = [] + let exactMatch = '' + let exactMatchCount = 0 + for vcsType in keys(s:plugins) + let identified = s:plugins[vcsType][1].Identify(a:buffer) + if identified + if identified == g:VCSCOMMAND_IDENTIFY_EXACT + let exactMatch = vcsType + let exactMatchCount += 1 + endif + call add(matches, [vcsType, identified]) + endif + endfor + if len(matches) == 1 + return matches[0][0] + elseif len(matches) == 0 + throw 'No suitable plugin' + else + let preferences = VCSCommandGetOption("VCSCommandVCSTypePreference", []) + if len(preferences) > 0 + if type(preferences) == 1 + let listPreferences = split(preferences, '\W\+') + unlet preferences + let preferences = listPreferences + endif + for preferred in preferences + for [vcsType, identified] in matches + if vcsType ==? preferred + return vcsType + endif + endfor + endfor + endif + + if exactMatchCount == 1 + return exactMatch + endif + + throw 'can''t identify VCS type for current buffer due to too many matching VCS: ' . join(map(matches, 'v:val[0]')) + endif +endfunction + +" Function: s:SetupScratchBuffer(command, vcsType, originalBuffer, statusText) {{{2 +" Creates convenience buffer variables and the name of a vcscommand result +" buffer. + +function! s:SetupScratchBuffer(command, vcsType, originalBuffer, statusText) + let nameExtension = VCSCommandGetOption('VCSCommandResultBufferNameExtension', '') + if nameExtension == '' + let nameFunction = VCSCommandGetOption('VCSCommandResultBufferNameFunction', 's:GenerateResultBufferName') + else + let nameFunction = VCSCommandGetOption('VCSCommandResultBufferNameFunction', 's:GenerateResultBufferNameWithExtension') + endif + + let name = call(nameFunction, [a:command, a:originalBuffer, a:vcsType, a:statusText]) + + let b:VCSCommandCommand = a:command + let b:VCSCommandOriginalBuffer = a:originalBuffer + let b:VCSCommandSourceFile = bufname(a:originalBuffer) + let b:VCSCommandVCSType = a:vcsType + if a:statusText != '' + let b:VCSCommandStatusText = a:statusText + endif + + setlocal buftype=nofile + setlocal noswapfile + let &filetype = tolower(a:vcsType . a:command) + + if VCSCommandGetOption('VCSCommandDeleteOnHide', 0) + setlocal bufhidden=delete + endif + silent noautocmd file `=name` +endfunction + +" Function: s:SetupBuffer() {{{2 +" Attempts to set the b:VCSCommandBufferInfo variable + +function! s:SetupBuffer() + if (exists('b:VCSCommandBufferSetup') && b:VCSCommandBufferSetup) + " This buffer is already set up. + return + endif + + if !isdirectory(@%) && (strlen(&buftype) > 0 || !filereadable(@%)) + " No special status for special buffers other than directory buffers. + return + endif + + if !VCSCommandGetOption('VCSCommandEnableBufferSetup', 0) || s:isEditFileRunning > 0 + unlet! b:VCSCommandBufferSetup + return + endif + + try + let vcsType = VCSCommandGetVCSType(bufnr('%')) + let b:VCSCommandBufferInfo = s:plugins[vcsType][1].GetBufferInfo() + silent do VCSCommand User VCSBufferSetup + catch /No suitable plugin/ + " This is not a VCS-controlled file. + let b:VCSCommandBufferInfo = [] + endtry + + let b:VCSCommandBufferSetup = 1 +endfunction + +" Function: s:MarkOrigBufferForSetup(buffer) {{{2 +" Resets the buffer setup state of the original buffer for a given VCS scratch +" buffer. +" Returns: The VCS buffer number in a passthrough mode. + +function! s:MarkOrigBufferForSetup(buffer) + checktime + if a:buffer > 0 + let origBuffer = VCSCommandGetOriginalBuffer(a:buffer) + " This should never not work, but I'm paranoid + if origBuffer != a:buffer + call setbufvar(origBuffer, 'VCSCommandBufferSetup', 0) + endif + endif + return a:buffer +endfunction + +" Function: s:WipeoutCommandBuffers() {{{2 +" Clears all current VCS output buffers of the specified type for a given source. + +function! s:WipeoutCommandBuffers(originalBuffer, VCSCommand) + let buffer = 1 + while buffer <= bufnr('$') + if getbufvar(buffer, 'VCSCommandOriginalBuffer') == a:originalBuffer + if getbufvar(buffer, 'VCSCommandCommand') == a:VCSCommand + execute 'bw' buffer + endif + endif + let buffer = buffer + 1 + endwhile +endfunction + +" Function: s:VimDiffRestore(vimDiffBuff) {{{2 +" Checks whether the given buffer is one whose deletion should trigger +" restoration of an original buffer after it was diffed. If so, it executes +" the appropriate setting command stored with that original buffer. + +function! s:VimDiffRestore(vimDiffBuff) + let s:isEditFileRunning += 1 + try + if exists('t:vcsCommandVimDiffSourceBuffer') + if a:vimDiffBuff == t:vcsCommandVimDiffSourceBuffer + " Original file is being removed. + unlet! t:vcsCommandVimDiffSourceBuffer + unlet! t:vcsCommandVimDiffRestoreCmd + unlet! t:vcsCommandVimDiffScratchList + else + let index = index(t:vcsCommandVimDiffScratchList, a:vimDiffBuff) + if index >= 0 + call remove(t:vcsCommandVimDiffScratchList, index) + if len(t:vcsCommandVimDiffScratchList) == 0 + if exists('t:vcsCommandVimDiffRestoreCmd') + " All scratch buffers are gone, reset the original. + " Only restore if the source buffer is still in Diff mode + + let sourceWinNR = bufwinnr(t:vcsCommandVimDiffSourceBuffer) + if sourceWinNR != -1 + " The buffer is visible in at least one window + let currentWinNR = winnr() + while winbufnr(sourceWinNR) != -1 + if winbufnr(sourceWinNR) == t:vcsCommandVimDiffSourceBuffer + execute sourceWinNR . 'wincmd w' + if getwinvar(0, '&diff') + execute t:vcsCommandVimDiffRestoreCmd + endif + endif + let sourceWinNR = sourceWinNR + 1 + endwhile + execute currentWinNR . 'wincmd w' + else + " The buffer is hidden. It must be visible in order to set the + " diff option. + let currentBufNR = bufnr('') + execute 'hide buffer' t:vcsCommandVimDiffSourceBuffer + if getwinvar(0, '&diff') + execute t:vcsCommandVimDiffRestoreCmd + endif + execute 'hide buffer' currentBufNR + endif + + unlet t:vcsCommandVimDiffRestoreCmd + endif + " All buffers are gone. + unlet t:vcsCommandVimDiffSourceBuffer + unlet t:vcsCommandVimDiffScratchList + endif + endif + endif + endif + finally + let s:isEditFileRunning -= 1 + endtry +endfunction + +" Section: Generic VCS command functions {{{1 + +" Function: s:VCSAnnotate(...) {{{2 +function! s:VCSAnnotate(bang, ...) + call s:VCSCommandUtility.pushContext({'VCSCommandEncodeAsFile': bufnr('%')}) + try + let line = line('.') + let currentBuffer = bufnr('%') + let originalBuffer = VCSCommandGetOriginalBuffer(currentBuffer) + + let annotateBuffer = s:ExecuteVCSCommand('Annotate', a:000) + if annotateBuffer == -1 + return -1 + endif + if a:bang == '!' && VCSCommandGetOption('VCSCommandDisableSplitAnnotate', 0) == 0 + let vcsType = VCSCommandGetVCSType(annotateBuffer) + let functionMap = s:plugins[vcsType][1] + let splitRegex = '' + if has_key(s:plugins[vcsType][1], 'AnnotateSplitRegex') + let splitRegex = s:plugins[vcsType][1]['AnnotateSplitRegex'] + endif + let splitRegex = VCSCommandGetOption('VCSCommand' . vcsType . 'AnnotateSplitRegex', splitRegex) + if splitRegex == '' + return annotateBuffer + endif + let originalFileType = getbufvar(originalBuffer, '&ft') + let annotateFileType = getbufvar(annotateBuffer, '&ft') + + let saveselection = &selection + set selection=inclusive + try + execute "normal! 0zR\<c-v>G/" . splitRegex . "/e\<cr>d" + finally + let &selection = saveselection + endtry + + call setbufvar('%', '&filetype', getbufvar(originalBuffer, '&filetype')) + set scrollbind + leftabove vert new + normal! 0P + execute "normal!" . (col('$') + (&number ? &numberwidth : 0)). "\<c-w>|" + call s:SetupScratchBuffer('annotate', vcsType, originalBuffer, 'header') + wincmd l + endif + + if currentBuffer == originalBuffer + " Starting from the original source buffer, so the + " current line is relevant. + if a:0 == 0 + " No argument list means that we're annotating + " the current version, so jumping to the same + " line is the expected action. + execute "normal!" line . 'G' + if has('folding') + " The execution of the buffer created autocommand + " re-folds the buffer. Display the current line + " unfolded. + normal! zv + endif + endif + endif + + return annotateBuffer + catch + call s:ReportError(v:exception) + return -1 + finally + call s:VCSCommandUtility.popContext() + endtry +endfunction + +" Function: s:VCSCommit() {{{2 +function! s:VCSCommit(bang, message) + try + let vcsType = VCSCommandGetVCSType(bufnr('%')) + if !has_key(s:plugins, vcsType) + throw 'Unknown VCS type: ' . vcsType + endif + + let originalBuffer = VCSCommandGetOriginalBuffer(bufnr('%')) + + " Handle the commit message being specified. If a message is supplied, it + " is used; if bang is supplied, an empty message is used; otherwise, the + " user is provided a buffer from which to edit the commit message. + + if strlen(a:message) > 0 || a:bang == '!' + return s:VCSFinishCommit([a:message], originalBuffer) + endif + + call s:EditFile('commitlog', originalBuffer, '') + setlocal ft=vcscommit + + " Create a commit mapping. + + nnoremap <silent> <buffer> <Plug>VCSCommit :call <SID>VCSFinishCommitWithBuffer()<CR> + + silent 0put ='VCS: ----------------------------------------------------------------------' + silent put ='VCS: Please enter log message. Lines beginning with ''VCS:'' are removed automatically.' + silent put ='VCS: To finish the commit, Type <leader>cc (or your own <Plug>VCSCommit mapping)' + + if VCSCommandGetOption('VCSCommandCommitOnWrite', 1) == 1 + setlocal buftype=acwrite + au VCSCommandCommit BufWriteCmd <buffer> call s:VCSFinishCommitWithBuffer() + silent put ='VCS: or write this buffer' + endif + + silent put ='VCS: ----------------------------------------------------------------------' + $ + setlocal nomodified + silent do VCSCommand User VCSBufferCreated + catch + call s:ReportError(v:exception) + return -1 + endtry +endfunction + +" Function: s:VCSFinishCommitWithBuffer() {{{2 +" Wrapper for s:VCSFinishCommit which is called only from a commit log buffer +" which removes all lines starting with 'VCS:'. + +function! s:VCSFinishCommitWithBuffer() + setlocal nomodified + let currentBuffer = bufnr('%') + let logMessageList = getbufline('%', 1, '$') + call filter(logMessageList, 'v:val !~ ''^\s*VCS:''') + let resultBuffer = s:VCSFinishCommit(logMessageList, b:VCSCommandOriginalBuffer) + if resultBuffer >= 0 + execute 'bw' currentBuffer + endif + return resultBuffer +endfunction + +" Function: s:VCSFinishCommit(logMessageList, originalBuffer) {{{2 +function! s:VCSFinishCommit(logMessageList, originalBuffer) + let messageFileName = tempname() + if exists('*iconv') && has('multi_byte') + if(strlen(&tenc) && &tenc != &enc) + call map(a:logMessageList, 'iconv(v:val, &enc, &tenc)') + endif + endif + call writefile(a:logMessageList, messageFileName) + try + let resultBuffer = s:ExecuteVCSCommand('Commit', [messageFileName]) + if resultBuffer < 0 + return resultBuffer + endif + return s:MarkOrigBufferForSetup(resultBuffer) + finally + call delete(messageFileName) + endtry +endfunction + +" Function: s:VCSGotoOriginal(bang) {{{2 +function! s:VCSGotoOriginal(bang) + let originalBuffer = VCSCommandGetOriginalBuffer(bufnr('%')) + if originalBuffer > 0 + let origWinNR = bufwinnr(originalBuffer) + if origWinNR == -1 + execute 'buffer' originalBuffer + else + execute origWinNR . 'wincmd w' + endif + if a:bang == '!' + let buffnr = 1 + let buffmaxnr = bufnr('$') + while buffnr <= buffmaxnr + if getbufvar(buffnr, 'VCSCommandOriginalBuffer') == originalBuffer + execute 'bw' buffnr + endif + let buffnr = buffnr + 1 + endwhile + endif + endif +endfunction + +function! s:VCSDiff(...) "{{{2 + call s:VCSCommandUtility.pushContext({'VCSCommandEncodeAsFile': bufnr('%')}) + try + let resultBuffer = s:ExecuteVCSCommand('Diff', a:000) + if resultBuffer > 0 + let &filetype = 'diff' + elseif resultBuffer == 0 + echomsg 'No differences found' + endif + return resultBuffer + finally + call s:VCSCommandUtility.popContext() + endtry +endfunction + +function! s:VCSReview(...) "{{{2 + call s:VCSCommandUtility.pushContext({'VCSCommandEncodeAsFile': bufnr('%')}) + try + let resultBuffer = s:ExecuteVCSCommand('Review', a:000) + if resultBuffer > 0 + let &filetype = getbufvar(b:VCSCommandOriginalBuffer, '&filetype') + endif + return resultBuffer + finally + call s:VCSCommandUtility.popContext() + endtry +endfunction + +" Function: s:VCSVimDiff(...) {{{2 +function! s:VCSVimDiff(...) + try + let vcsType = VCSCommandGetVCSType(bufnr('%')) + if !has_key(s:plugins, vcsType) + throw 'Unknown VCS type: ' . vcsType + endif + let originalBuffer = VCSCommandGetOriginalBuffer(bufnr('%')) + let s:isEditFileRunning = s:isEditFileRunning + 1 + try + " If there's already a VimDiff'ed window, restore it. + " There may only be one VCSVimDiff original window at a time. + + if exists('t:vcsCommandVimDiffSourceBuffer') && t:vcsCommandVimDiffSourceBuffer != originalBuffer + " Clear the existing vimdiff setup by removing the result buffers. + call s:WipeoutCommandBuffers(t:vcsCommandVimDiffSourceBuffer, 'vimdiff') + endif + + let orientation = &diffopt =~ 'horizontal' ? 'horizontal' : 'vertical' + let orientation = VCSCommandGetOption('VCSCommandSplit', orientation) + let orientation = VCSCommandGetOption('VCSCommandDiffSplit', orientation) + + " Split and diff + if(a:0 == 2) + " Reset the vimdiff system, as 2 explicit versions were provided. + if exists('t:vcsCommandVimDiffSourceBuffer') + call s:WipeoutCommandBuffers(t:vcsCommandVimDiffSourceBuffer, 'vimdiff') + endif + let resultBuffer = s:VCSReview(a:1) + if resultBuffer < 0 + echomsg 'Can''t open revision ' . a:1 + return resultBuffer + endif + let b:VCSCommandCommand = 'vimdiff' + diffthis + let t:vcsCommandVimDiffScratchList = [resultBuffer] + " If no split method is defined, cheat, and set it to vertical. + call s:VCSCommandUtility.pushContext({'VCSCommandSplit': orientation}) + try + let resultBuffer = s:VCSReview(a:2) + finally + call s:VCSCommandUtility.popContext() + endtry + if resultBuffer < 0 + echomsg 'Can''t open revision ' . a:1 + return resultBuffer + endif + let b:VCSCommandCommand = 'vimdiff' + diffthis + let t:vcsCommandVimDiffScratchList += [resultBuffer] + else + " Add new buffer. Force splitting behavior, otherwise why use vimdiff? + call s:VCSCommandUtility.pushContext({'VCSCommandEdit': 'split', 'VCSCommandSplit': orientation}) + try + if(a:0 == 0) + let resultBuffer = s:VCSReview() + else + let resultBuffer = s:VCSReview(a:1) + endif + finally + call s:VCSCommandUtility.popContext() + endtry + if resultBuffer < 0 + echomsg 'Can''t open current revision' + return resultBuffer + endif + let b:VCSCommandCommand = 'vimdiff' + diffthis + + if !exists('t:vcsCommandVimDiffSourceBuffer') + " New instance of vimdiff. + let t:vcsCommandVimDiffScratchList = [resultBuffer] + + " This could have been invoked on a VCS result buffer, not the + " original buffer. + wincmd W + execute 'buffer' originalBuffer + " Store info for later original buffer restore + let t:vcsCommandVimDiffRestoreCmd = + \ 'call setbufvar('.originalBuffer.', ''&diff'', '.getbufvar(originalBuffer, '&diff').')' + \ . '|call setbufvar('.originalBuffer.', ''&foldcolumn'', '.getbufvar(originalBuffer, '&foldcolumn').')' + \ . '|call setbufvar('.originalBuffer.', ''&foldenable'', '.getbufvar(originalBuffer, '&foldenable').')' + \ . '|call setbufvar('.originalBuffer.', ''&foldmethod'', '''.getbufvar(originalBuffer, '&foldmethod').''')' + \ . '|call setbufvar('.originalBuffer.', ''&foldlevel'', '''.getbufvar(originalBuffer, '&foldlevel').''')' + \ . '|call setbufvar('.originalBuffer.', ''&scrollbind'', '.getbufvar(originalBuffer, '&scrollbind').')' + \ . '|call setbufvar('.originalBuffer.', ''&cursorbind'', '.getbufvar(originalBuffer, '&cursorbind').')' + \ . '|call setbufvar('.originalBuffer.', ''&wrap'', '.getbufvar(originalBuffer, '&wrap').')' + \ . '|if &foldmethod==''manual''|execute ''normal! zE''|endif' + diffthis + wincmd w + else + " Adding a window to an existing vimdiff + let t:vcsCommandVimDiffScratchList += [resultBuffer] + endif + endif + + let t:vcsCommandVimDiffSourceBuffer = originalBuffer + + " Avoid executing the modeline in the current buffer after the autocommand. + + let currentBuffer = bufnr('%') + let saveModeline = getbufvar(currentBuffer, '&modeline') + try + call setbufvar(currentBuffer, '&modeline', 0) + silent do VCSCommand User VCSVimDiffFinish + finally + call setbufvar(currentBuffer, '&modeline', saveModeline) + endtry + return resultBuffer + finally + let s:isEditFileRunning = s:isEditFileRunning - 1 + endtry + catch + call s:ReportError(v:exception) + return -1 + endtry +endfunction + +" Section: Public functions {{{1 + +" Function: VCSCommandGetVCSType() {{{2 +" This function sets the b:VCSCommandVCSType variable in the given buffer to the +" appropriate source control system name and returns the same name. +" +" Returns: VCS type name identified for the given buffer. An exception is +" thrown if no type can be identified. +" +" Rules for determining type: +" 1. use previously-cached value +" 2. use value from 'VCSCommandVCSTypeOverride' +" 3. use single match +" 4. use first matching value from 'VCSCommandTypePreference' +" 5. use single exact match +" 6. error if multiple matching types +" 7. error if no matching types + +function! VCSCommandGetVCSType(buffer) + let vcsType = VCSCommandGetOption('VCSCommandVCSTypeExplicitOverride', '') + if len(vcsType) == 0 + let vcsType = getbufvar(a:buffer, 'VCSCommandVCSType') + if strlen(vcsType) == 0 + let vcsType = s:IdentifyVCSType(a:buffer) + call setbufvar(a:buffer, 'VCSCommandVCSType', vcsType) + endif + endif + return vcsType +endfunction + +" Function: VCSCommandChdir(directory) {{{2 +" Changes the current directory, respecting :lcd changes. + +function! VCSCommandChdir(directory) + let command = 'cd' + if exists("*haslocaldir") && haslocaldir() + let command = 'lcd' + endif + if exists("*fnameescape") + execute command fnameescape(a:directory) + else + execute command escape(a:directory, ' ') + endif +endfunction + +" Function: VCSCommandChangeToCurrentFileDir() {{{2 +" Go to the directory in which the given file is located. + +function! VCSCommandChangeToCurrentFileDir(fileName) + let oldCwd = getcwd() + let newCwd = fnamemodify(resolve(a:fileName), ':p:h') + if strlen(newCwd) > 0 + call VCSCommandChdir(newCwd) + endif + return oldCwd +endfunction + +" Function: VCSCommandGetOriginalBuffer(vcsBuffer) {{{2 +" Attempts to locate the original file to which VCS operations were applied +" for a given buffer. + +function! VCSCommandGetOriginalBuffer(vcsBuffer) + let origBuffer = getbufvar(a:vcsBuffer, 'VCSCommandOriginalBuffer') + if origBuffer + if bufexists(origBuffer) + return origBuffer + else + " Original buffer no longer exists. + throw 'Original buffer for this VCS buffer no longer exists.' + endif + else + " No original buffer + return a:vcsBuffer + endif +endfunction + +" Function: VCSCommandRegisterModule(name, file, commandMap) {{{2 +" Allows VCS modules to register themselves. + +function! VCSCommandRegisterModule(name, path, commandMap, mappingMap) + let s:plugins[a:name] = [a:path, a:commandMap, a:mappingMap] + if !empty(a:mappingMap) + \ && !exists("g:no_plugin_maps") + \ && !VCSCommandGetOption('VCSCommandDisableMappings', 0) + \ && !VCSCommandGetOption('VCSCommandDisableExtensionMappings', 0) + for shortcut in keys(a:mappingMap) + let expansion = ":call <SID>ExecuteExtensionMapping('" . shortcut . "')<CR>" + call s:CreateMapping(shortcut, expansion, a:name . " extension mapping " . shortcut) + endfor + endif + return s:VCSCommandUtility +endfunction + +" Function: VCSCommandDoCommand(cmd, cmdName, statusText, [options]) {{{2 +" General skeleton for VCS function execution. The given command is executed +" after appending the current buffer name (or substituting it for +" <VCSCOMMANDFILE>, if such a token is present). The output is captured in a +" new buffer. +" +" The optional 'options' Dictionary may contain the following options: +" allowNonZeroExit: if non-zero, if the underlying VCS command has a +" non-zero exit status, the command is still considered +" successfuly. This defaults to zero. +" Returns: name of the new command buffer containing the command results + +function! VCSCommandDoCommand(cmd, cmdName, statusText, options) + let allowNonZeroExit = 0 + if has_key(a:options, 'allowNonZeroExit') + let allowNonZeroExit = a:options.allowNonZeroExit + endif + + let originalBuffer = VCSCommandGetOriginalBuffer(bufnr('%')) + if originalBuffer == -1 + throw 'Original buffer no longer exists, aborting.' + endif + + let path = resolve(bufname(originalBuffer)) + + " Work with netrw or other systems where a directory listing is displayed in + " a buffer. + + if isdirectory(path) + let fileName = '.' + else + let fileName = fnamemodify(path, ':t') + endif + + if match(a:cmd, '<VCSCOMMANDFILE>') > 0 + let fullCmd = substitute(a:cmd, '<VCSCOMMANDFILE>', fileName, 'g') + else + let fullCmd = a:cmd . ' -- ' . shellescape(fileName) + endif + + " Change to the directory of the current buffer. This is done for CVS, but + " is left in for other systems as it does not affect them negatively. + + let oldCwd = VCSCommandChangeToCurrentFileDir(path) + try + let output = s:VCSCommandUtility.system(fullCmd) + finally + call VCSCommandChdir(oldCwd) + endtry + + " HACK: if line endings in the repository have been corrupted, the output + " of the command will be confused. + let output = substitute(output, "\r", '', 'g') + + if v:shell_error && !allowNonZeroExit + if strlen(output) == 0 + throw 'Version control command failed' + else + let output = substitute(output, '\n', ' ', 'g') + throw 'Version control command failed: ' . output + endif + endif + + if strlen(output) == 0 + " Handle case of no output. In this case, it is important to check the + " file status, especially since cvs edit/unedit may change the attributes + " of the file with no visible output. + + checktime + return 0 + endif + + call s:EditFile(a:cmdName, originalBuffer, a:statusText) + + silent 0put=output + + " The last command left a blank line at the end of the buffer. If the + " last line is folded (a side effect of the 'put') then the attempt to + " remove the blank line will kill the last fold. + " + " This could be fixed by explicitly detecting whether the last line is + " within a fold, but I prefer to simply unfold the result buffer altogether. + + if has('folding') + normal! zR + endif + + $d + 1 + + " Define the environment and execute user-defined hooks. + + silent do VCSCommand User VCSBufferCreated + return bufnr('%') +endfunction + +" Function: VCSCommandGetOption(name, default) {{{2 +" Grab a user-specified option to override the default provided. Options are +" searched in the window, buffer, then global spaces. + +function! VCSCommandGetOption(name, default) + for context in s:executionContext + if has_key(context, a:name) + return context[a:name] + endif + endfor + if exists('w:' . a:name) + return w:{a:name} + elseif exists('b:' . a:name) + return b:{a:name} + elseif exists('g:' . a:name) + return g:{a:name} + else + return a:default + endif +endfunction + +" Function: VCSCommandDisableBufferSetup() {{{2 +" Global function for deactivating the buffer autovariables. + +function! VCSCommandDisableBufferSetup() + let g:VCSCommandEnableBufferSetup = 0 + silent! augroup! VCSCommandPlugin +endfunction + +" Function: VCSCommandEnableBufferSetup() {{{2 +" Global function for activating the buffer autovariables. + +function! VCSCommandEnableBufferSetup() + let g:VCSCommandEnableBufferSetup = 1 + augroup VCSCommandPlugin + au! + au BufEnter * call s:SetupBuffer() + augroup END + + " Only auto-load if the plugin is fully loaded. This gives other plugins a + " chance to run. + if g:loaded_VCSCommand == 2 + call s:SetupBuffer() + endif +endfunction + +" Function: VCSCommandGetStatusLine() {{{2 +" Default (sample) status line entry for VCS-controlled files. This is only +" useful if VCS-managed buffer mode is on (see the VCSCommandEnableBufferSetup +" variable for how to do this). + +function! VCSCommandGetStatusLine() + if exists('b:VCSCommandCommand') + " This is a result buffer. Return nothing because the buffer name + " contains information already. + return '' + endif + + if exists('b:VCSCommandVCSType') + \ && exists('g:VCSCommandEnableBufferSetup') + \ && g:VCSCommandEnableBufferSetup + \ && exists('b:VCSCommandBufferInfo') + return '[' . join(extend([b:VCSCommandVCSType], b:VCSCommandBufferInfo), ' ') . ']' + else + return '' + endif +endfunction + +function! VCSCommandSetVCSType(type) + if exists('b:VCSCommandBufferSetup') + unlet b:VCSCommandBufferSetup + endif + let b:VCSCommandVCSType = a:type + call s:SetupBuffer() +endfunction + +" Section: Command definitions {{{1 +" Section: Primary commands {{{2 +com! -nargs=* VCSAdd call s:MarkOrigBufferForSetup(s:ExecuteVCSCommand('Add', [<f-args>])) +com! -nargs=* -bang VCSAnnotate call s:VCSAnnotate(<q-bang>, <f-args>) +com! -nargs=* -bang VCSBlame call s:VCSAnnotate(<q-bang>, <f-args>) +com! -nargs=? -bang VCSCommit call s:VCSCommit(<q-bang>, <q-args>) +com! -nargs=* VCSDelete call s:ExecuteVCSCommand('Delete', [<f-args>]) +com! -nargs=* VCSDiff call s:VCSDiff(<f-args>) +com! -nargs=0 -bang VCSGotoOriginal call s:VCSGotoOriginal(<q-bang>) +com! -nargs=* VCSInfo call s:ExecuteVCSCommand('Info', [<f-args>]) +com! -nargs=* VCSLock call s:MarkOrigBufferForSetup(s:ExecuteVCSCommand('Lock', [<f-args>])) +com! -nargs=* VCSLog call s:ExecuteVCSCommand('Log', [<f-args>]) +com! -nargs=* VCSRemove call s:ExecuteVCSCommand('Delete', [<f-args>]) +com! -nargs=0 VCSRevert call s:MarkOrigBufferForSetup(s:ExecuteVCSCommand('Revert', [])) +com! -nargs=? VCSReview call s:VCSReview(<f-args>) +com! -nargs=* VCSStatus call s:ExecuteVCSCommand('Status', [<f-args>]) +com! -nargs=* VCSUnlock call s:MarkOrigBufferForSetup(s:ExecuteVCSCommand('Unlock', [<f-args>])) +com! -nargs=0 VCSUpdate call s:MarkOrigBufferForSetup(s:ExecuteVCSCommand('Update', [])) +com! -nargs=* VCSVimDiff call s:VCSVimDiff(<f-args>) + +" Section: VCS buffer management commands {{{2 +com! VCSCommandDisableBufferSetup call VCSCommandDisableBufferSetup() +com! VCSCommandEnableBufferSetup call VCSCommandEnableBufferSetup() + +" Allow reloading VCSCommand.vim +com! VCSReload let savedPlugins = s:plugins|let s:plugins = {}|call s:ClearMenu()|unlet! g:loaded_VCSCommand|runtime plugin/vcscommand.vim|for plugin in values(savedPlugins)|execute 'source' plugin[0]|endfor|unlet savedPlugins + +" Section: Plugin command mappings {{{1 +if !exists("no_plugin_maps") + nnoremap <silent> <Plug>VCSAdd :VCSAdd<CR> + nnoremap <silent> <Plug>VCSAnnotate :VCSAnnotate<CR> + nnoremap <silent> <Plug>VCSCommit :VCSCommit<CR> + nnoremap <silent> <Plug>VCSDelete :VCSDelete<CR> + nnoremap <silent> <Plug>VCSDiff :VCSDiff<CR> + nnoremap <silent> <Plug>VCSGotoOriginal :VCSGotoOriginal<CR> + nnoremap <silent> <Plug>VCSClearAndGotoOriginal :VCSGotoOriginal!<CR> + nnoremap <silent> <Plug>VCSInfo :VCSInfo<CR> + nnoremap <silent> <Plug>VCSLock :VCSLock<CR> + nnoremap <silent> <Plug>VCSLog :VCSLog<CR> + nnoremap <silent> <Plug>VCSRevert :VCSRevert<CR> + nnoremap <silent> <Plug>VCSReview :VCSReview<CR> + nnoremap <silent> <Plug>VCSSplitAnnotate :VCSAnnotate!<CR> + nnoremap <silent> <Plug>VCSStatus :VCSStatus<CR> + nnoremap <silent> <Plug>VCSUnlock :VCSUnlock<CR> + nnoremap <silent> <Plug>VCSUpdate :VCSUpdate<CR> + nnoremap <silent> <Plug>VCSVimDiff :VCSVimDiff<CR> +endif + +" Section: Default mappings {{{1 + +let s:defaultMappings = [ + \['a', 'VCSAdd'], + \['c', 'VCSCommit'], + \['D', 'VCSDelete'], + \['d', 'VCSDiff'], + \['G', 'VCSClearAndGotoOriginal'], + \['g', 'VCSGotoOriginal'], + \['i', 'VCSInfo'], + \['L', 'VCSLock'], + \['l', 'VCSLog'], + \['N', 'VCSSplitAnnotate'], + \['n', 'VCSAnnotate'], + \['q', 'VCSRevert'], + \['r', 'VCSReview'], + \['s', 'VCSStatus'], + \['U', 'VCSUnlock'], + \['u', 'VCSUpdate'], + \['v', 'VCSVimDiff'], + \] + +if !exists("g:no_plugin_maps") && !VCSCommandGetOption('VCSCommandDisableMappings', 0) + for [s:shortcut, s:vcsFunction] in VCSCommandGetOption('VCSCommandMappings', s:defaultMappings) + call s:CreateMapping(s:shortcut, '<Plug>' . s:vcsFunction, '''' . s:vcsFunction . '''') + endfor + unlet s:shortcut s:vcsFunction +endif +unlet s:defaultMappings + +" Section: Menu items {{{1 + +let s:menuEnabled = !VCSCommandGetOption('VCSCommandDisableMenu', 0) +let s:menuRoot = VCSCommandGetOption('VCSCommandMenuRoot', '&Plugin.VCS') +let s:menuPriority = VCSCommandGetOption('VCSCommandMenuPriority', '') + +for [s:shortcut, s:command] in [ + \['&Add', '<Plug>VCSAdd'], + \['A&nnotate', '<Plug>VCSAnnotate'], + \['&Commit', '<Plug>VCSCommit'], + \['Delete', '<Plug>VCSDelete'], + \['&Diff', '<Plug>VCSDiff'], + \['&Info', '<Plug>VCSInfo'], + \['&Log', '<Plug>VCSLog'], + \['Revert', '<Plug>VCSRevert'], + \['&Review', '<Plug>VCSReview'], + \['&Status', '<Plug>VCSStatus'], + \['&Update', '<Plug>VCSUpdate'], + \['&VimDiff', '<Plug>VCSVimDiff'] + \] + call s:VCSCommandUtility.addMenuItem(s:shortcut, s:command) +endfor +unlet s:shortcut s:command + +" Section: Autocommands to restore vimdiff state {{{1 +augroup VimDiffRestore + au! + au BufUnload * call s:VimDiffRestore(str2nr(expand('<abuf>'))) +augroup END + +" Section: Optional activation of buffer management {{{1 + +if VCSCommandGetOption('VCSCommandEnableBufferSetup', 0) + call VCSCommandEnableBufferSetup() +endif + +" Section: VIM shutdown hook {{{1 + +" Close all result buffers when VIM exits, to prevent them from being restored +" via viminfo. + +" Function: s:CloseAllResultBuffers() {{{2 +" Closes all vcscommand result buffers. +function! s:CloseAllResultBuffers() + " This avoids using bufdo as that may load buffers already loaded in another + " vim process, resulting in an error. + let buffnr = 1 + let buffmaxnr = bufnr('$') + while buffnr <= buffmaxnr + if getbufvar(buffnr, 'VCSCommandOriginalBuffer') != "" + execute 'bw' buffnr + endif + let buffnr = buffnr + 1 + endwhile +endfunction + +augroup VCSCommandVIMShutdown + au! + au VimLeavePre * call s:CloseAllResultBuffers() +augroup END + +" Section: Plugin completion {{{1 + +let loaded_VCSCommand = 2 + +silent do VCSCommand User VCSPluginFinish + +let &cpo = s:save_cpo diff --git a/.vim/plugin/vcscvs.vim b/.vim/plugin/vcscvs.vim @@ -0,0 +1,453 @@ +" vim600: set foldmethod=marker: +" +" CVS extension for VCSCommand. +" +" Maintainer: Bob Hiestand <bob.hiestand@gmail.com> +" License: +" Copyright (c) Bob Hiestand +" +" Permission is hereby granted, free of charge, to any person obtaining a copy +" of this software and associated documentation files (the "Software"), to +" deal in the Software without restriction, including without limitation the +" rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +" sell copies of the Software, and to permit persons to whom the Software is +" furnished to do so, subject to the following conditions: +" +" The above copyright notice and this permission notice shall be included in +" all copies or substantial portions of the Software. +" +" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +" FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +" IN THE SOFTWARE. +" +" Section: Documentation {{{1 +" +" Command documentation {{{2 +" +" The following commands only apply to files under CVS source control. +" +" CVSEdit Performs "cvs edit" on the current file. +" +" CVSEditors Performs "cvs editors" on the current file. +" +" CVSUnedit Performs "cvs unedit" on the current file. +" +" CVSWatch Takes an argument which must be one of [on|off|add|remove]. +" Performs "cvs watch" with the given argument on the current +" file. +" +" CVSWatchers Performs "cvs watchers" on the current file. +" +" CVSWatchAdd Alias for "CVSWatch add" +" +" CVSWatchOn Alias for "CVSWatch on" +" +" CVSWatchOff Alias for "CVSWatch off" +" +" CVSWatchRemove Alias for "CVSWatch remove" +" +" Mapping documentation: {{{2 +" +" By default, a mapping is defined for each command. User-provided mappings +" can be used instead by mapping to <Plug>CommandName, for instance: +" +" nnoremap ,ce <Plug>CVSEdit +" +" The default mappings are as follow: +" +" <Leader>ce CVSEdit +" <Leader>cE CVSEditors +" <Leader>ct CVSUnedit +" <Leader>cwv CVSWatchers +" <Leader>cwa CVSWatchAdd +" <Leader>cwn CVSWatchOn +" <Leader>cwf CVSWatchOff +" <Leader>cwr CVSWatchRemove +" +" Options documentation: {{{2 +" +" VCSCommandCVSExec +" This variable specifies the CVS executable. If not set, it defaults to +" 'cvs' executed from the user's executable path. +" +" VCSCommandCVSDiffOpt +" This variable, if set, determines the options passed to the cvs diff +" command. If not set, it defaults to 'u'. + +" Section: Plugin header {{{1 + +if exists('VCSCommandDisableAll') + finish +endif + +if v:version < 700 + echohl WarningMsg|echomsg 'VCSCommand requires at least VIM 7.0'|echohl None + finish +endif + +if !exists('g:loaded_VCSCommand') + runtime plugin/vcscommand.vim +endif + +if !executable(VCSCommandGetOption('VCSCommandCVSExec', 'cvs')) + " CVS is not installed + finish +endif + +let s:save_cpo=&cpo +set cpo&vim + +" Section: Variable initialization {{{1 + +let s:cvsFunctions = {} + +" Section: Utility functions {{{1 + +" Function: s:Executable() {{{2 +" Returns the executable used to invoke cvs suitable for use in a shell +" command. +function! s:Executable() + return VCSCommandGetOption('VCSCommandCVSExec', 'cvs') +endfunction + +" Function: s:DoCommand(cmd, cmdName, statusText, options) {{{2 +" Wrapper to VCSCommandDoCommand to add the name of the CVS executable to the +" command argument. +function! s:DoCommand(cmd, cmdName, statusText, options) + if VCSCommandGetVCSType(expand('%')) == 'CVS' + let fullCmd = s:Executable() . ' ' . a:cmd + let ret = VCSCommandDoCommand(fullCmd, a:cmdName, a:statusText, a:options) + + if ret > 0 + if getline(line('$')) =~ '^cvs \w\+: closing down connection' + $d + 1 + endif + + endif + + return ret + else + throw 'CVS VCSCommand plugin called on non-CVS item.' + endif +endfunction + +" Function: s:GetRevision() {{{2 +" Function for retrieving the current buffer's revision number. +" Returns: Revision number or an empty string if an error occurs. + +function! s:GetRevision() + if !exists('b:VCSCommandBufferInfo') + let b:VCSCommandBufferInfo = s:cvsFunctions.GetBufferInfo() + endif + + if len(b:VCSCommandBufferInfo) > 0 + return b:VCSCommandBufferInfo[0] + else + return '' + endif +endfunction + +" Section: VCS function implementations {{{1 + +" Function: s:cvsFunctions.Identify(buffer) {{{2 +function! s:cvsFunctions.Identify(buffer) + let fileName = resolve(bufname(a:buffer)) + if isdirectory(fileName) + let directoryName = fileName + else + let directoryName = fnamemodify(fileName, ':h') + endif + if strlen(directoryName) > 0 + let CVSRoot = directoryName . '/CVS/Root' + else + let CVSRoot = 'CVS/Root' + endif + if filereadable(CVSRoot) + return 1 + else + return 0 + endif +endfunction + +" Function: s:cvsFunctions.Add(argList) {{{2 +function! s:cvsFunctions.Add(argList) + return s:DoCommand(join(['add'] + a:argList, ' '), 'add', join(a:argList, ' '), {}) +endfunction + +" Function: s:cvsFunctions.Annotate(argList) {{{2 +function! s:cvsFunctions.Annotate(argList) + if len(a:argList) == 0 + if &filetype ==? 'cvsannotate' + " This is a CVSAnnotate buffer. Perform annotation of the version + " indicated by the current line. + let caption = matchstr(getline('.'),'\v^[0-9.]+') + + if VCSCommandGetOption('VCSCommandCVSAnnotateParent', 0) != 0 + if caption != '1.1' + let revmaj = matchstr(caption,'\v[0-9.]+\ze\.[0-9]+') + let revmin = matchstr(caption,'\v[0-9.]+\.\zs[0-9]+') - 1 + if revmin == 0 + " Jump to ancestor branch + let caption = matchstr(revmaj,'\v[0-9.]+\ze\.[0-9]+') + else + let caption = revmaj . "." . revmin + endif + endif + endif + + let options = ['-r' . caption] + else + " CVS defaults to pulling HEAD, regardless of current branch. + " Therefore, always pass desired revision. + let caption = '' + let options = ['-r' . s:GetRevision()] + endif + elseif len(a:argList) == 1 && a:argList[0] !~ '^-' + let caption = a:argList[0] + let options = ['-r' . caption] + else + let caption = join(a:argList) + let options = a:argList + endif + + let resultBuffer = s:DoCommand(join(['-q', 'annotate'] + options), 'annotate', caption, {}) + if resultBuffer > 0 + " Remove header lines from standard error + silent v/^\d\+\%(\.\d\+\)\+/d + endif + return resultBuffer +endfunction + +" Function: s:cvsFunctions.Commit(argList) {{{2 +function! s:cvsFunctions.Commit(argList) + let resultBuffer = s:DoCommand('commit -F "' . a:argList[0] . '"', 'commit', '', {}) + if resultBuffer == 0 + echomsg 'No commit needed.' + endif + return resultBuffer +endfunction + +" Function: s:cvsFunctions.Delete() {{{2 +" By default, use the -f option to remove the file first. If options are +" passed in, use those instead. +function! s:cvsFunctions.Delete(argList) + let options = ['-f'] + let caption = '' + if len(a:argList) > 0 + let options = a:argList + let caption = join(a:argList, ' ') + endif + return s:DoCommand(join(['remove'] + options, ' '), 'delete', caption, {}) +endfunction + +" Function: s:cvsFunctions.Diff(argList) {{{2 +function! s:cvsFunctions.Diff(argList) + if len(a:argList) == 0 + let revOptions = [] + let caption = '' + elseif len(a:argList) <= 2 && match(a:argList, '^-') == -1 + let revOptions = ['-r' . join(a:argList, ' -r')] + let caption = '(' . a:argList[0] . ' : ' . get(a:argList, 1, 'current') . ')' + else + " Pass-through + let caption = join(a:argList, ' ') + let revOptions = a:argList + endif + + let cvsDiffOpt = VCSCommandGetOption('VCSCommandCVSDiffOpt', 'u') + if cvsDiffOpt == '' + let diffOptions = [] + else + let diffOptions = ['-' . cvsDiffOpt] + endif + + return s:DoCommand(join(['diff'] + diffOptions + revOptions), 'diff', caption, {'allowNonZeroExit': 1}) +endfunction + +" Function: s:cvsFunctions.GetBufferInfo() {{{2 +" Provides version control details for the current file. Current version +" number and current repository version number are required to be returned by +" the vcscommand plugin. This CVS extension adds branch name to the return +" list as well. +" Returns: List of results: [revision, repository, branch] + +function! s:cvsFunctions.GetBufferInfo() + let originalBuffer = VCSCommandGetOriginalBuffer(bufnr('%')) + let fileName = bufname(originalBuffer) + if isdirectory(fileName) + let tag = '' + if filereadable(fileName . '/CVS/Tag') + let tagFile = readfile(fileName . '/CVS/Tag') + if len(tagFile) == 1 + let tag = substitute(tagFile[0], '^T', '', '') + endif + endif + return [tag] + endif + let realFileName = fnamemodify(resolve(fileName), ':t') + if !filereadable(fileName) + return ['Unknown'] + endif + let oldCwd = VCSCommandChangeToCurrentFileDir(fileName) + try + let statusText=s:VCSCommandUtility.system(s:Executable() . ' status -- "' . realFileName . '"') + if(v:shell_error) + return [] + endif + let revision=substitute(statusText, '^\_.*Working revision:\s*\(\d\+\%(\.\d\+\)\+\|New file!\)\_.*$', '\1', '') + + " We can still be in a CVS-controlled directory without this being a CVS + " file + if match(revision, '^New file!$') >= 0 + let revision='New' + elseif match(revision, '^\d\+\.\d\+\%(\.\d\+\.\d\+\)*$') <0 + return ['Unknown'] + endif + + let branch=substitute(statusText, '^\_.*Sticky Tag:\s\+\(\d\+\%(\.\d\+\)\+\|\a[A-Za-z0-9-_]*\|(none)\).*$', '\1', '') + let repository=substitute(statusText, '^\_.*Repository revision:\s*\(\d\+\%(\.\d\+\)\+\|New file!\|No revision control file\)\_.*$', '\1', '') + let repository=substitute(repository, '^New file!\|No revision control file$', 'New', '') + return [revision, repository, branch] + finally + call VCSCommandChdir(oldCwd) + endtry +endfunction + +" Function: s:cvsFunctions.Log() {{{2 +function! s:cvsFunctions.Log(argList) + if len(a:argList) == 0 + let options = [] + let caption = '' + elseif len(a:argList) <= 2 && match(a:argList, '^-') == -1 + let options = ['-r' . join(a:argList, ':')] + let caption = options[0] + else + " Pass-through + let options = a:argList + let caption = join(a:argList, ' ') + endif + + return s:DoCommand(join(['log'] + options), 'log', caption, {}) +endfunction + +" Function: s:cvsFunctions.Revert(argList) {{{2 +function! s:cvsFunctions.Revert(argList) + return s:DoCommand('update -C', 'revert', '', {}) +endfunction + +" Function: s:cvsFunctions.Review(argList) {{{2 +function! s:cvsFunctions.Review(argList) + if len(a:argList) == 0 + let versiontag = '(current)' + let versionOption = '' + else + let versiontag = a:argList[0] + let versionOption = ' -r ' . versiontag . ' ' + endif + + return s:DoCommand('-q update -p' . versionOption, 'review', versiontag, {}) +endfunction + +" Function: s:cvsFunctions.Status(argList) {{{2 +function! s:cvsFunctions.Status(argList) + return s:DoCommand(join(['status'] + a:argList, ' '), 'status', join(a:argList, ' '), {}) +endfunction + +" Function: s:cvsFunctions.Update(argList) {{{2 +function! s:cvsFunctions.Update(argList) + return s:DoCommand('update', 'update', '', {}) +endfunction + +" Section: CVS-specific functions {{{1 + +" Function: s:CVSEdit() {{{2 +function! s:CVSEdit() + return s:DoCommand('edit', 'cvsedit', '', {}) +endfunction + +" Function: s:CVSEditors() {{{2 +function! s:CVSEditors() + return s:DoCommand('editors', 'cvseditors', '', {}) +endfunction + +" Function: s:CVSUnedit() {{{2 +function! s:CVSUnedit() + return s:DoCommand('unedit', 'cvsunedit', '', {}) +endfunction + +" Function: s:CVSWatch(onoff) {{{2 +function! s:CVSWatch(onoff) + if a:onoff !~ '^\c\%(on\|off\|add\|remove\)$' + echoerr 'Argument to CVSWatch must be one of [on|off|add|remove]' + return -1 + end + return s:DoCommand('watch ' . tolower(a:onoff), 'cvswatch', '', {}) +endfunction + +" Function: s:CVSWatchers() {{{2 +function! s:CVSWatchers() + return s:DoCommand('watchers', 'cvswatchers', '', {}) +endfunction + +" Annotate setting {{{2 +let s:cvsFunctions.AnnotateSplitRegex = '): ' + +" Section: Command definitions {{{1 +" Section: Primary commands {{{2 +com! CVSEdit call s:CVSEdit() +com! CVSEditors call s:CVSEditors() +com! CVSUnedit call s:CVSUnedit() +com! -nargs=1 CVSWatch call s:CVSWatch(<f-args>) +com! CVSWatchAdd call s:CVSWatch('add') +com! CVSWatchOn call s:CVSWatch('on') +com! CVSWatchOff call s:CVSWatch('off') +com! CVSWatchRemove call s:CVSWatch('remove') +com! CVSWatchers call s:CVSWatchers() + +" Section: Plugin command mappings {{{1 + +let s:cvsExtensionMappings = {} +if !exists("no_plugin_maps") + let mappingInfo = [ + \['CVSEdit', 'CVSEdit', 'e'], + \['CVSEditors', 'CVSEditors', 'E'], + \['CVSUnedit', 'CVSUnedit', 't'], + \['CVSWatchers', 'CVSWatchers', 'wv'], + \['CVSWatchAdd', 'CVSWatch add', 'wa'], + \['CVSWatchOff', 'CVSWatch off', 'wf'], + \['CVSWatchOn', 'CVSWatch on', 'wn'], + \['CVSWatchRemove', 'CVSWatch remove', 'wr'] + \] + + for [pluginName, commandText, shortCut] in mappingInfo + execute 'nnoremap <silent> <Plug>' . pluginName . ' :' . commandText . '<CR>' + if !hasmapto('<Plug>' . pluginName) + let s:cvsExtensionMappings[shortCut] = commandText + endif + endfor +endif + +" Section: Plugin Registration {{{1 +let s:VCSCommandUtility = VCSCommandRegisterModule('CVS', expand('<sfile>'), s:cvsFunctions, s:cvsExtensionMappings) + +" Section: Menu items {{{1 +for [s:shortcut, s:command] in [ + \['CVS.&Edit', '<Plug>CVSEdit'], + \['CVS.Ed&itors', '<Plug>CVSEditors'], + \['CVS.Unedi&t', '<Plug>CVSUnedit'], + \['CVS.&Watchers', '<Plug>CVSWatchers'], + \['CVS.WatchAdd', '<Plug>CVSWatchAdd'], + \['CVS.WatchOn', '<Plug>CVSWatchOn'], + \['CVS.WatchOff', '<Plug>CVSWatchOff'], + \['CVS.WatchRemove', '<Plug>CVSWatchRemove'] + \] + call s:VCSCommandUtility.addMenuItem(s:shortcut, s:command) +endfor +unlet s:shortcut s:command + +let &cpo = s:save_cpo diff --git a/.vim/plugin/vcsgit.vim b/.vim/plugin/vcsgit.vim @@ -0,0 +1,249 @@ +" vim600: set foldmethod=marker: +" +" git extension for VCSCommand. +" +" Maintainer: Bob Hiestand <bob.hiestand@gmail.com> +" License: +" Copyright (c) Bob Hiestand +" +" Permission is hereby granted, free of charge, to any person obtaining a copy +" of this software and associated documentation files (the "Software"), to +" deal in the Software without restriction, including without limitation the +" rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +" sell copies of the Software, and to permit persons to whom the Software is +" furnished to do so, subject to the following conditions: +" +" The above copyright notice and this permission notice shall be included in +" all copies or substantial portions of the Software. +" +" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +" FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +" IN THE SOFTWARE. +" +" Section: Documentation {{{1 +" +" Options documentation: {{{2 +" +" VCSCommandGitExec +" This variable specifies the git executable. If not set, it defaults to +" 'git' executed from the user's executable path. +" +" VCSCommandGitDiffOpt +" This variable, if set, determines the default options passed to the +" VCSDiff command. If any options (starting with '-') are passed to the +" command, this variable is not used. + +" Section: Plugin header {{{1 + +if exists('VCSCommandDisableAll') + finish +endif + +if v:version < 700 + echohl WarningMsg|echomsg 'VCSCommand requires at least VIM 7.0'|echohl None + finish +endif + +if !exists('g:loaded_VCSCommand') + runtime plugin/vcscommand.vim +endif + +if !executable(VCSCommandGetOption('VCSCommandGitExec', 'git')) + " git is not installed + finish +endif + +let s:save_cpo=&cpo +set cpo&vim + +" Section: Variable initialization {{{1 + +let s:gitFunctions = {} + +" Section: Utility functions {{{1 + +" Function: s:Executable() {{{2 +" Returns the executable used to invoke git suitable for use in a shell +" command. +function! s:Executable() + return VCSCommandGetOption('VCSCommandGitExec', 'git') +endfunction + +" Function: s:DoCommand(cmd, cmdName, statusText, options) {{{2 +" Wrapper to VCSCommandDoCommand to add the name of the git executable to the +" command argument. +function! s:DoCommand(cmd, cmdName, statusText, options) + if VCSCommandGetVCSType(expand('%')) == 'git' + let fullCmd = s:Executable() . ' ' . a:cmd + return VCSCommandDoCommand(fullCmd, a:cmdName, a:statusText, a:options) + else + throw 'git VCSCommand plugin called on non-git item.' + endif +endfunction + +" Section: VCS function implementations {{{1 + +" Function: s:gitFunctions.Identify(buffer) {{{2 +" This function only returns an inexact match due to the detection method used +" by git, which simply traverses the directory structure upward. +function! s:gitFunctions.Identify(buffer) + let oldCwd = VCSCommandChangeToCurrentFileDir(resolve(bufname(a:buffer))) + try + call s:VCSCommandUtility.system(s:Executable() . ' rev-parse --is-inside-work-tree') + if(v:shell_error) + return 0 + else + return g:VCSCOMMAND_IDENTIFY_INEXACT + endif + finally + call VCSCommandChdir(oldCwd) + endtry +endfunction + +" Function: s:gitFunctions.Add(argList) {{{2 +function! s:gitFunctions.Add(argList) + return s:DoCommand(join(['add'] + ['-v'] + a:argList, ' '), 'add', join(a:argList, ' '), {}) +endfunction + +" Function: s:gitFunctions.Annotate(argList) {{{2 +function! s:gitFunctions.Annotate(argList) + if len(a:argList) == 0 + if &filetype == 'gitannotate' + " Perform annotation of the version indicated by the current line. + let options = matchstr(getline('.'),'^\x\+') + else + let options = '' + endif + elseif len(a:argList) == 1 && a:argList[0] !~ '^-' + let options = a:argList[0] + else + let options = join(a:argList, ' ') + endif + + return s:DoCommand('blame ' . options, 'annotate', options, {}) +endfunction + +" Function: s:gitFunctions.Commit(argList) {{{2 +function! s:gitFunctions.Commit(argList) + try + return s:DoCommand('commit -F "' . a:argList[0] . '"', 'commit', '', {}) + catch /\m^Version control command failed.*nothing\%( added\)\? to commit/ + echomsg 'No commit needed.' + endtry +endfunction + +" Function: s:gitFunctions.Delete() {{{2 +" All options are passed through. +function! s:gitFunctions.Delete(argList) + let options = a:argList + let caption = join(a:argList, ' ') + return s:DoCommand(join(['rm'] + options, ' '), 'delete', caption, {}) +endfunction + +" Function: s:gitFunctions.Diff(argList) {{{2 +" Pass-through call to git-diff. If no options (starting with '-') are found, +" then the options in the 'VCSCommandGitDiffOpt' variable are added. +function! s:gitFunctions.Diff(argList) + let gitDiffOpt = VCSCommandGetOption('VCSCommandGitDiffOpt', '') + if gitDiffOpt == '' + let diffOptions = [] + else + let diffOptions = [gitDiffOpt] + for arg in a:argList + if arg =~ '^-' + let diffOptions = [] + break + endif + endfor + endif + + return s:DoCommand(join(['diff'] + diffOptions + a:argList), 'diff', join(a:argList), {}) +endfunction + +" Function: s:gitFunctions.GetBufferInfo() {{{2 +" Provides version control details for the current file. Current version +" number and current repository version number are required to be returned by +" the vcscommand plugin. This CVS extension adds branch name to the return +" list as well. +" Returns: List of results: [revision, repository, branch] + +function! s:gitFunctions.GetBufferInfo() + let oldCwd = VCSCommandChangeToCurrentFileDir(resolve(bufname('%'))) + try + let branch = substitute(s:VCSCommandUtility.system(s:Executable() . ' symbolic-ref -q HEAD'), '\n$', '', '') + if v:shell_error + let branch = 'DETACHED' + else + let branch = substitute(branch, '^refs/heads/', '', '') + endif + + let info = [branch] + + for method in split(VCSCommandGetOption('VCSCommandGitDescribeArgList', (',tags,all,always')), ',', 1) + if method != '' + let method = ' --' . method + endif + let tag = substitute(s:VCSCommandUtility.system(s:Executable() . ' describe' . method), '\n$', '', '') + if !v:shell_error + call add(info, tag) + break + endif + endfor + + return info + finally + call VCSCommandChdir(oldCwd) + endtry +endfunction + +" Function: s:gitFunctions.Log() {{{2 +function! s:gitFunctions.Log(argList) + return s:DoCommand(join(['log'] + a:argList), 'log', join(a:argList, ' '), {}) +endfunction + +" Function: s:gitFunctions.Revert(argList) {{{2 +function! s:gitFunctions.Revert(argList) + return s:DoCommand('checkout', 'revert', '', {}) +endfunction + +" Function: s:gitFunctions.Review(argList) {{{2 +function! s:gitFunctions.Review(argList) + if len(a:argList) == 0 + let revision = 'HEAD' + else + let revision = a:argList[0] + endif + + let oldCwd = VCSCommandChangeToCurrentFileDir(resolve(bufname(VCSCommandGetOriginalBuffer('%')))) + try + let prefix = s:VCSCommandUtility.system(s:Executable() . ' rev-parse --show-prefix') + finally + call VCSCommandChdir(oldCwd) + endtry + + let prefix = substitute(prefix, '\n$', '', '') + let blob = '"' . revision . ':' . prefix . '<VCSCOMMANDFILE>"' + return s:DoCommand('show ' . blob, 'review', revision, {}) +endfunction + +" Function: s:gitFunctions.Status(argList) {{{2 +function! s:gitFunctions.Status(argList) + return s:DoCommand(join(['status'] + a:argList), 'status', join(a:argList), {'allowNonZeroExit': 1}) +endfunction + +" Function: s:gitFunctions.Update(argList) {{{2 +function! s:gitFunctions.Update(argList) + throw "This command is not implemented for git because file-by-file update doesn't make much sense in that context. If you have an idea for what it should do, please let me know." +endfunction + +" Annotate setting {{{2 +let s:gitFunctions.AnnotateSplitRegex = ') ' + +" Section: Plugin Registration {{{1 +let s:VCSCommandUtility = VCSCommandRegisterModule('git', expand('<sfile>'), s:gitFunctions, []) + +let &cpo = s:save_cpo diff --git a/.vim/plugin/vcshg.vim b/.vim/plugin/vcshg.vim @@ -0,0 +1,335 @@ +" vim600: set foldmethod=marker: +" +" Mercurial extension for VCSCommand. This extension is based on svn extension +" to VCSCommand made by Bob Hiestand <bob.hiestand@gmail.com> +" +" Version: 1 +" Maintainer: Vladimir Marek <vlmarek@volny.cz> +" License: +" Copyright (c) 2007 Vladimir Marek +" +" Permission is hereby granted, free of charge, to any person obtaining a copy +" of this software and associated documentation files (the "Software"), to +" deal in the Software without restriction, including without limitation the +" rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +" sell copies of the Software, and to permit persons to whom the Software is +" furnished to do so, subject to the following conditions: +" +" The above copyright notice and this permission notice shall be included in +" all copies or substantial portions of the Software. +" +" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +" FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +" IN THE SOFTWARE. +" +" Section: Documentation {{{1 +" +" Command documentation {{{2 +" +" The following command only applies to files under Mercurial source control. +" +" None currently +" +" Mapping documentation: {{{2 +" +" By default, a mapping is defined for each command. User-provided mappings +" can be used instead by mapping to <Plug>CommandName, for instance: +" +" None currently +" +" The default mappings are as follow: +" +" None currently +" +" Options documentation: {{{2 +" +" VCSCommandHGExec +" This variable specifies the Mercurial executable. If not set, it defaults to +" 'hg' executed from the user's executable path. + +if v:version < 700 + finish +endif + +" Section: Variable initialization {{{1 + +let s:hgFunctions = {} +let s:pushdList = [] + +" Section: Mercurial help functions {{{1 + +" Function: s:Pushd(filename) +" Similar to pushd in shell. Argument can be either directory or filename next +" to which we want to get +function! s:Pushd(filename) + call insert (s:pushdList, VCSCommandChangeToCurrentFileDir(a:filename)) +endfunction + +" Function: s:Popd() +" Does reverse of s:Pushd, similar to shell popd +function! s:Popd() + execute 'cd' escape(remove(s:pushdList,0), ' ') +endfunction + +" Function: s:getToMyBuffer() +" Does several things: +" * Tries to get original buffer number (1) +" * Tries to get original buffer name (2) +" * Tries to get just filename (3) +" * Chdirs to the filename (uses s:Pushd(...)) +" * Returns [(1), (2), (3)] +function! s:getToMyBuffer() + let originalBuffer=VCSCommandGetOriginalBuffer(bufnr('%')) + let fileName=bufname(originalBuffer) + if !filereadable(fileName) + throw 'Unable to access the file '.fileName + endif + let realFileName = fnamemodify(resolve(fileName), ':t') + call s:Pushd(fileName) + return [originalBuffer, fileName, realFileName] +endfunction + +" Section: Utility functions {{{1 + +" Function: s:DoCommand(cmd, cmdName, statusText) {{{2 +" Wrapper to VCSCommandDoCommand to add the name of the HG executable to the +" command argument. +function! s:DoCommand(cmd, cmdName, statusText) + try + if VCSCommandGetVCSType(expand('%')) == 'Mercurial' + let fullCmd = VCSCommandGetOption('VCSCommandHGExec', 'hg') . ' ' . a:cmd + return VCSCommandDoCommand(fullCmd, a:cmdName, a:statusText, {}) + else + throw 'No suitable plugin' + endif + catch /No suitable plugin/ + echohl WarningMsg|echomsg 'Cannot apply Mercurial commands to this file.'|echohl None + endtry +endfunction + +" Section: VCS function implementations {{{1 + +" Function: s:hgFunctions.Identify(buffer) {{{2 +function! s:hgFunctions.Identify(buffer) + let fileName = resolve(bufname(a:buffer)) + if isdirectory(fileName) + let directory = fileName + else + let directory = fnamemodify(fileName, ':h') + endif + + call s:Pushd(directory) + let statusText=system(VCSCommandGetOption('VCSCommandHGExec', 'hg') . ' status -I .') + call s:Popd() + if v:shell_error != 0 + return 0 + endif + return 1 +endfunction + +" Function: s:hgFunctions.Add() {{{2 +function! s:hgFunctions.Add(argList) + return s:DoCommand(join(['add'] + a:argList, ' '), 'add', join(a:argList, ' ')) +endfunction + +" Function: s:hgFunctions.Annotate(argList) {{{2 +function! s:hgFunctions.Annotate(argList) + let [originalBuffer, fileName, realFileName] = s:getToMyBuffer() + try + if len(a:argList) == 0 + if &filetype == 'HGAnnotate' + " Perform annotation of the version indicated by the current line. + let revision = matchstr(getline('.'),'\v^\s*\S*\s*\zs\d+') + else + if !exists('b:VCSCommandBufferInfo') + call VCSCommandEnableBufferSetup() + endif + let l:revision = b:VCSCommandBufferInfo[0] + if revision == '' + throw 'Unable to obtain version information.' + elseif revision == 'Unknown' " XXX + throw 'File not under source control' + elseif revision == 'New' " XXX + throw 'No annotatation available for new file.' + endif + endif + else + let revision=a:argList[0] + endif + + let resultBuffer=s:DoCommand('annotate -u -n -r ' . revision . ' "'. realFileName . '"', 'annotate', revision) + if resultBuffer > 0 + set filetype=HGAnnotate + endif + return resultBuffer + finally + call s:Popd() + endtry +endfunction + +" Function: s:hgFunctions.Commit(argList) {{{2 +function! s:hgFunctions.Commit(argList) + return s:DoCommand('commit -l "' . a:argList[0] . '"', 'commit', '') +endfunction + +" Function: s:hgFunctions.Delete() {{{2 +function! s:hgFunctions.Delete(argList) + return s:DoCommand(join(['remove'] + a:argList, ' '), 'delete', join(a:argList, ' ')) +endfunction + +" 0 args - current file +" 1 args - current file revision REV +" 2 args - current file revisions REV1 & REV2 +" Function: s:hgFunctions.Diff(argList) {{{2 +function! s:hgFunctions.Diff(argList) + if len(a:argList) == 1 + let revOptions = ' -r' . a:argList[0] + let caption = '(' . a:argList[0] . ' : tip)' " XXX I'm not sure if tip fits + elseif len(a:argList) == 2 + let revOptions = ' -r ' . a:argList[0] . ' -r ' . a:argList[1] + let caption = '(' . a:argList[0] . ' : ' . a:argList[1] . ')' + else + let revOptions = '' + let caption = '' + endif + + let resultBuffer = s:DoCommand('diff' . revOptions , 'diff', caption) + if resultBuffer > 0 + set filetype=diff + else + echomsg 'No differences found' + endif + return resultBuffer +endfunction + +" Function: s:hgFunctions.GetBufferInfo() {{{2 +" Provides version control details for the current file. Current version +" number and current repository version number are required to be returned by +" the vcscommand plugin. +" Returns: List of results: [revision, repository, branch] + +function! s:hgFunctions.GetBufferInfo() + let [originalBuffer, fileName, realFileName] = s:getToMyBuffer() + try + let statusText=system(VCSCommandGetOption('VCSCommandHGExec', 'hg') . ' status "' . realFileName . '"') + if(v:shell_error) + return [] + endif + + " File not under Mercurial control. + if statusText =~ '^?' + return ['Unknown'] + endif + + if statusText =~ '^A' + return ['New'] + endif + + let statusText=system(VCSCommandGetOption('VCSCommandHGExec', 'hg') . ' log -l 1 --template "{rev}" "' . realFileName . '"') + if(v:shell_error) + echoerr "Error running 'hg log' :".statusText + return [] + endif + + return [statusText] + finally + call s:Popd() + endtry +endfunction + +" Function: s:hgFunctions.Lock(argList) {{{2 +"function! s:hgFunctions.Lock(argList) +" return s:DoCommand(join(['lock'] + a:argList, ' '), 'lock', join(a:argList, ' ')) +"endfunction + +" Function: s:hgFunctions.Log() {{{2 +function! s:hgFunctions.Log(argList) + if len(a:argList) == 0 + let versionOption = '' + let caption = '' + elseif len(a:argList) == 1 && a:argList[0] !~ "^-" + let versionOption=' -r' . a:argList[0] + let caption = a:argList[0] + else + " Multiple options, or the option starts with '-' + let caption = join(a:argList, ' ') + let versionOption = ' ' . caption + endif + + let resultBuffer=s:DoCommand('log' . versionOption, 'log', caption) + return resultBuffer +endfunction + +" Function: s:hgFunctions.Revert(argList) {{{2 +function! s:hgFunctions.Revert(argList) + return s:DoCommand('revert', 'revert', '') +endfunction + +" Function: s:hgFunctions.Review(argList) {{{2 +function! s:hgFunctions.Review(argList) + if len(a:argList) == 0 + let versiontag = '(current)' + let versionOption = '' + else + let versiontag = a:argList[0] + let versionOption = ' -r ' . versiontag . ' ' + endif + + let resultBuffer = s:DoCommand('cat' . versionOption, 'review', versiontag) + if resultBuffer > 0 + let &filetype=getbufvar(b:VCSCommandOriginalBuffer, '&filetype') + endif + return resultBuffer +endfunction + +" Function: s:hgFunctions.Status(argList) {{{2 +function! s:hgFunctions.Status(argList) + return s:DoCommand(join(['status'] + a:argList, ' '), 'status', join(a:argList, ' ')) +endfunction + +" Function: s:hgFunctions.Unlock(argList) {{{2 +"function! s:hgFunctions.Unlock(argList) +" return s:DoCommand(join(['unlock'] + a:argList, ' '), 'unlock', join(a:argList, ' ')) +"endfunction +" Function: s:hgFunctions.Update(argList) {{{2 +function! s:hgFunctions.Update(argList) + return s:DoCommand('update', 'update', '') +endfunction + +" Section: Mercurial-specific functions {{{1 + +" Section: Command definitions {{{1 +" Section: Primary commands {{{2 + +" None currently + +" Section: Plugin command mappings {{{1 + +let s:hgExtensionMappings = {} +let mappingInfo = [] +for [pluginName, commandText, shortCut] in mappingInfo + execute 'nnoremap <silent> <Plug>' . pluginName . ' :' . commandText . '<CR>' + if !hasmapto('<Plug>' . pluginName) + let s:hgExtensionMappings[shortCut] = commandText + endif +endfor + +" Section: Menu items {{{1 +" None currently + +" Section: Plugin Registration {{{1 +" If the vcscommand.vim plugin hasn't loaded, delay registration until it +" loads. +if exists('g:loaded_VCSCommand') + call VCSCommandRegisterModule('Mercurial', expand('<sfile>'), s:hgFunctions, s:hgExtensionMappings) +else + augroup VCSCommand + au User VCSLoadExtensions call VCSCommandRegisterModule('Mercurial', expand('<sfile>'), s:hgFunctions, s:hgExtensionMappings) + augroup END +endif + +""" TODO """ diff --git a/.vim/plugin/vcssccs.vim b/.vim/plugin/vcssccs.vim @@ -0,0 +1,345 @@ +" vim600: set foldmethod=marker: +" +" Mercurial extension for VCSCommand. This extension is based on svn extension +" to VCSCommand made by Bob Hiestand <bob.hiestand@gmail.com> +" +" Version: 2 +" Maintainer: Vladimir Marek <vlmarek@volny.cz> +" License: +" Copyright (c) 2007 Vladimir Marek +" +" Permission is hereby granted, free of charge, to any person obtaining a copy +" of this software and associated documentation files (the "Software"), to +" deal in the Software without restriction, including without limitation the +" rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +" sell copies of the Software, and to permit persons to whom the Software is +" furnished to do so, subject to the following conditions: +" +" The above copyright notice and this permission notice shall be included in +" all copies or substantial portions of the Software. +" +" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +" FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +" IN THE SOFTWARE. +" +" Section: Documentation {{{1 +" +" Command documentation {{{2 +" +" The following command only applies to files under SCCS source control. +" +" Those functions are NOT implemented (yet?). Their implementation would differ +" for using sccs or TeamWare. Current implementation has enough features to +" support VCSVimDiff and VCSAnnotate +" +" Add +" Delete +" Lock +" Revert +" Unlock +" Update +" +" Mapping documentation: {{{2 +" +" By default, a mapping is defined for each command. User-provided mappings +" can be used instead by mapping to <Plug>CommandName, for instance: +" +" None currently +" +" The default mappings are as follow: +" +" None currently +" +" Options documentation: {{{2 +" +" VCSCommandSCCSPath +" This variable specifies path to the sccs binaries. If not set, it defaults +" to empty string (which means use your $PATH). If set, it MUST end by slash + +if v:version < 700 + finish +endif + +" Section: Variable initialization {{{1 + +let s:sccsFunctions = {} +let s:pushdList = [] + +" Section: Mercurial help functions {{{1 + +" Function: s:Pushd(filename) +" Similar to pushd in shell. Argument can be either directory or filename next +" to which we want to get +function! s:Pushd(filename) + call insert (s:pushdList, VCSCommandChangeToCurrentFileDir(a:filename)) +endfunction + +" Function: s:Popd() +" Does reverse of s:Pushd, similar to shell popd +function! s:Popd() + execute 'cd' escape(remove(s:pushdList,0), ' ') +endfunction + +" Function: s:getToMyBuffer() +" Does several things: +" * Tries to get original buffer number (1) +" * Tries to get original buffer name (2) +" * Tries to get just filename (3) +" * Chdirs to the filename (uses s:Pushd(...)) +" * Returns [(1), (2), (3)] +function! s:getToMyBuffer() + let originalBuffer=VCSCommandGetOriginalBuffer(bufnr('%')) + let fileName=bufname(originalBuffer) + if !filereadable(fileName) + throw 'Unable to access the file '.fileName + endif + let realFileName = fnamemodify(resolve(fileName), ':t') + call s:Pushd(fileName) + return [originalBuffer, fileName, realFileName] +endfunction + +" Section: Utility functions {{{1 + +" Function: s:DoCommand(binary, cmd, cmdName, statusText) {{{2 +" Wrapper to VCSCommandDoCommand to add the path to sccs tools +function! s:DoCommand(binary, cmd, cmdName, statusText) + try + if VCSCommandGetVCSType(expand('%')) == 'SCCS' + let fullCmd = VCSCommandGetOption('VCSCommandSCCSPath', '') . a:binary . ' ' . a:cmd + return VCSCommandDoCommand(fullCmd, a:cmdName, a:statusText, {}) + else + throw 'No suitable plugin' + endif + catch /No suitable plugin/ + echohl WarningMsg|echomsg 'Cannot apply SCCS commands to this file.'|echohl None + endtry +endfunction + +" Section: VCS function implementations {{{1 + +" Function: s:sccsFunctions.Identify(buffer) {{{2 +function! s:sccsFunctions.Identify(buffer) + let fileName = resolve(bufname(a:buffer)) + if isdirectory(fileName) + let directoryName = fileName + else + let directoryName = fnamemodify(fileName, ':h') + endif + if strlen(directoryName) > 0 + let sccsDir = directoryName . '/SCCS' + else + let sccsDir = 'SCCS' + endif + if isdirectory(sccsDir) + return 1 + else + return 0 + endif +endfunction + +" Function: s:sccsFunctions.Add() {{{2 +function! s:sccsFunctions.Add(argList) + echoerr "vcssccs: VCSAdd not implemented" +endfunction + +" Function: s:sccsFunctions.Annotate(argList) {{{2 +function! s:sccsFunctions.Annotate(argList) + let [originalBuffer, fileName, realFileName] = s:getToMyBuffer() + try + if len(a:argList) == 0 + if &filetype == 'SCCSAnnotate' + " Perform annotation of the version indicated by the current line. + let l:revision = matchstr(getline('.'),'\v^\s*\zs\d+\.\d+') + else + if !exists('b:VCSCommandBufferInfo') + call VCSCommandEnableBufferSetup() + endif + let l:revision = b:VCSCommandBufferInfo[0] + if l:revision == '' + throw 'vcssccs: Unable to obtain version information.' + endif + endif + else + let l:revision=a:argList[0] + endif + + let resultBuffer=s:DoCommand('sccs', 'get -p -m -s -r' . l:revision, 'annotate', l:revision) + if resultBuffer > 0 + set filetype=SCCSAnnotate + endif + return resultBuffer + finally + call s:Popd() + endtry +endfunction + +" Function: s:sccsFunctions.Commit(argList) {{{2 +function! s:sccsFunctions.Commit(argList) +" This commits only first line :( +" return s:DoCommand("sccs", "deledit <" . a:argList[0] , 'commit', '') + +" This seems to work ok, but may depend on your shell ... + return s:DoCommand("sccs", "deledit -y\"$(cat " . a:argList[0] .")\"" , 'commit', '') +endfunction + +" Function: s:sccsFunctions.Delete() {{{2 +function! s:sccsFunctions.Delete(argList) + echoerr "vcssccs: VCSDelete not implemented" +endfunction + +" 0 args - current file vs. last revision +" 1 args - current file vs. revision REV +" 2 args - current file revisions REV1 & REV2 +" Function: s:sccsFunctions.Diff(argList) {{{2 +function! s:sccsFunctions.Diff(argList) + if len(a:argList) == 1 " Compare working copy + let command = 'sccs' + let revOptions = 'diffs -r' . a:argList[0] . ' -u' + let caption = '(' . a:argList[0] . ' : working copy)' + elseif len(a:argList) == 2 + let l:fileName = resolve(bufname(VCSCommandGetOriginalBuffer(bufnr('%')))) + let l:fileName = fnamemodify(l:fileName, ':p:h') . '/SCCS/s.' + let command = 'sccsdiff' + let revOptions = ' -r' . a:argList[0] . ' -r' . a:argList[1] . ' -u '.l:fileName.'<VCSCOMMANDFILE>' + let caption = '(' . a:argList[0] . ' : ' . a:argList[1] . ')' + else + let command = 'sccs' + let revOptions = 'diffs -u' + let caption = '' + endif + + let resultBuffer = s:DoCommand(command, revOptions , 'diff', caption) + if resultBuffer > 0 + set filetype=diff + else + echomsg 'No differences found' + endif + return resultBuffer +endfunction + +" Function: s:sccsFunctions.GetBufferInfo() {{{2 +" Provides version control details for the current file. Current version +" number and current repository version number are required to be returned by +" the vcscommand plugin. +" Returns: List of results: [revision, repository, branch] + +function! s:sccsFunctions.GetBufferInfo() + let [originalBuffer, fileName, realFileName] = s:getToMyBuffer() + try + let statusText=system(VCSCommandGetOption('VCSCommandSCCSPath', '') . 'sccs prt -y "' . realFileName . '"') + if(v:shell_error) + return [] + endif + + " Error is returned above anyway + if statusText =~ ' nonexistent (ut4)' + return ['Unknown'] + endif + + " We can't have 'new', sccs create already commits the file +" if statusText =~ '^A' +" return ['New'] +" endif + + let statusText=substitute(statusText, '^[^\t]*...', "", "") + let statusText=substitute(statusText, "\t.*", "", "") + + return [statusText] + finally + call s:Popd() + endtry +endfunction + +" Function: s:sccsFunctions.Lock(argList) {{{2 +function! s:sccsFunctions.Lock(argList) + echoerr "vcssccs: VCSLock not implemented" +endfunction + +" 0 parameters - full log +" 1 parameter - log of the given commit +" Function: s:sccsFunctions.Log() {{{2 +function! s:sccsFunctions.Log(argList) + if len(a:argList) == 0 + let versionOption = '' + let caption = '' + else + let versionOption=' -y' . a:argList[0] + let caption = a:argList[0] + endif + + let resultBuffer=s:DoCommand('sccs', 'prt ' . versionOption, 'log', caption) + return resultBuffer +endfunction + +" Function: s:sccsFunctions.Revert(argList) {{{2 +function! s:sccsFunctions.Revert(argList) + echoerr "vcssccs: VCSRevert not implemented" +endfunction + +" Function: s:sccsFunctions.Review(argList) {{{2 +function! s:sccsFunctions.Review(argList) + if len(a:argList) == 0 + let versiontag = '(current)' + let versionOption = '' + else + let versiontag = a:argList[0] + let versionOption = ' -r ' . versiontag . ' ' + endif + + let resultBuffer = s:DoCommand('sccs', 'get -p -s -k' . versionOption, 'review', versiontag) + if resultBuffer > 0 + let &filetype=getbufvar(b:VCSCommandOriginalBuffer, '&filetype') + endif + return resultBuffer +endfunction + +" Function: s:sccsFunctions.Status(argList) {{{2 +function! s:sccsFunctions.Status(argList) + return s:DoCommand('sccs', join(['sact'] + a:argList, ' '), 'status', join(a:argList, ' ')) +endfunction + +" Function: s:sccsFunctions.Unlock(argList) {{{2 +function! s:sccsFunctions.Unlock(argList) + echoerr "vcssccs: VCSUnlock not implemented" +endfunction + +" Function: s:sccsFunctions.Update(argList) {{{2 +function! s:sccsFunctions.Update(argList) + echoerr "vcssccs: VCSUpdate not implemented" +endfunction + +" Section: SCCS-specific functions {{{1 + +" Section: Command definitions {{{1 +" Section: Primary commands {{{2 + +" None currently + +" Section: Plugin command mappings {{{1 + +let s:sccsExtensionMappings = {} +let mappingInfo = [] +for [pluginName, commandText, shortCut] in mappingInfo + execute 'nnoremap <silent> <Plug>' . pluginName . ' :' . commandText . '<CR>' + if !hasmapto('<Plug>' . pluginName) + let s:sccsExtensionMappings[shortCut] = commandText + endif +endfor + +" Section: Menu items {{{1 +" None currently + +" Section: Plugin Registration {{{1 +" If the vcscommand.vim plugin hasn't loaded, delay registration until it +" loads. +if exists('g:loaded_VCSCommand') + call VCSCommandRegisterModule('SCCS', expand('<sfile>'), s:sccsFunctions, s:sccsExtensionMappings) +else + augroup VCSCommand + au User VCSLoadExtensions call VCSCommandRegisterModule('SCCS', expand('<sfile>'), s:sccsFunctions, s:sccsExtensionMappings) + augroup END +endif diff --git a/.vim/plugin/vcssvk.vim b/.vim/plugin/vcssvk.vim @@ -0,0 +1,259 @@ +" vim600: set foldmethod=marker: +" +" SVK extension for VCSCommand. +" +" Maintainer: Bob Hiestand <bob.hiestand@gmail.com> +" License: +" Copyright (c) Bob Hiestand +" +" Permission is hereby granted, free of charge, to any person obtaining a copy +" of this software and associated documentation files (the "Software"), to +" deal in the Software without restriction, including without limitation the +" rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +" sell copies of the Software, and to permit persons to whom the Software is +" furnished to do so, subject to the following conditions: +" +" The above copyright notice and this permission notice shall be included in +" all copies or substantial portions of the Software. +" +" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +" FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +" IN THE SOFTWARE. +" +" Section: Documentation {{{1 +" +" Options documentation: {{{2 +" +" VCSCommandSVKExec +" This variable specifies the SVK executable. If not set, it defaults to +" 'svk' executed from the user's executable path. + +" Section: Plugin header {{{1 + +if exists('VCSCommandDisableAll') + finish +endif + +if v:version < 700 + echohl WarningMsg|echomsg 'VCSCommand requires at least VIM 7.0'|echohl None + finish +endif + +if !exists('g:loaded_VCSCommand') + runtime plugin/vcscommand.vim +endif + +if !executable(VCSCommandGetOption('VCSCommandSVKExec', 'svk')) + " SVK is not installed + finish +endif + +let s:save_cpo=&cpo +set cpo&vim + +" Section: Variable initialization {{{1 + +let s:svkFunctions = {} + +" Section: Utility functions {{{1 + +" Function: s:Executable() {{{2 +" Returns the executable used to invoke SVK suitable for use in a shell +" command. +function! s:Executable() + return VCSCommandGetOption('VCSCommandSVKExec', 'svk') +endfunction + +" Function: s:DoCommand(cmd, cmdName, statusText, options) {{{2 +" Wrapper to VCSCommandDoCommand to add the name of the SVK executable to the +" command argument. +function! s:DoCommand(cmd, cmdName, statusText, options) + if VCSCommandGetVCSType(expand('%')) == 'SVK' + let fullCmd = s:Executable() . ' ' . a:cmd + return VCSCommandDoCommand(fullCmd, a:cmdName, a:statusText, a:options) + else + throw 'SVK VCSCommand plugin called on non-SVK item.' + endif +endfunction + +" Section: VCS function implementations {{{1 + +" Function: s:svkFunctions.Identify(buffer) {{{2 +function! s:svkFunctions.Identify(buffer) + let fileName = resolve(bufname(a:buffer)) + if isdirectory(fileName) + let directoryName = fileName + else + let directoryName = fnamemodify(fileName, ':p:h') + endif + let statusText = s:VCSCommandUtility.system(s:Executable() . ' info -- "' . directoryName . '"', "no") + if(v:shell_error) + return 0 + else + return 1 + endif +endfunction + +" Function: s:svkFunctions.Add() {{{2 +function! s:svkFunctions.Add(argList) + return s:DoCommand(join(['add'] + a:argList, ' '), 'add', join(a:argList, ' '), {}) +endfunction + +" Function: s:svkFunctions.Annotate(argList) {{{2 +function! s:svkFunctions.Annotate(argList) + if len(a:argList) == 0 + if &filetype ==? 'svkannotate' + " Perform annotation of the version indicated by the current line. + let caption = matchstr(getline('.'),'\v^\s+\zs\d+') + let options = ' -r' . caption + else + let caption = '' + let options = '' + endif + elseif len(a:argList) == 1 && a:argList[0] !~ '^-' + let caption = a:argList[0] + let options = ' -r' . caption + else + let caption = join(a:argList, ' ') + let options = ' ' . caption + endif + + let resultBuffer = s:DoCommand('blame' . options, 'annotate', caption, {}) + if resultBuffer > 0 + normal! 1G2dd + endif + return resultBuffer +endfunction + +" Function: s:svkFunctions.Commit(argList) {{{2 +function! s:svkFunctions.Commit(argList) + let resultBuffer = s:DoCommand('commit -F "' . a:argList[0] . '"', 'commit', '', {}) + if resultBuffer == 0 + echomsg 'No commit needed.' + endif +endfunction + +" Function: s:svkFunctions.Delete() {{{2 +function! s:svkFunctions.Delete(argList) + return s:DoCommand(join(['delete'] + a:argList, ' '), 'delete', join(a:argList, ' '), {}) +endfunction + +" Function: s:svkFunctions.Diff(argList) {{{2 +function! s:svkFunctions.Diff(argList) + if len(a:argList) == 0 + let revOptions = [] + let caption = '' + elseif len(a:argList) <= 2 && match(a:argList, '^-') == -1 + let revOptions = ['-r' . join(a:argList, ':')] + let caption = '(' . a:argList[0] . ' : ' . get(a:argList, 1, 'current') . ')' + else + " Pass-through + let caption = join(a:argList, ' ') + let revOptions = a:argList + endif + + return s:DoCommand(join(['diff'] + revOptions), 'diff', caption, {}) +endfunction + +" Function: s:svkFunctions.GetBufferInfo() {{{2 +" Provides version control details for the current file. Current version +" number and current repository version number are required to be returned by +" the vcscommand plugin. +" Returns: List of results: [revision, repository] + +function! s:svkFunctions.GetBufferInfo() + let originalBuffer = VCSCommandGetOriginalBuffer(bufnr('%')) + let fileName = resolve(bufname(originalBuffer)) + let statusText = s:VCSCommandUtility.system(s:Executable() . ' status -v -- "' . fileName . '"') + if(v:shell_error) + return [] + endif + + " File not under SVK control. + if statusText =~ '^?' + return ['Unknown'] + endif + + let [flags, revision, repository] = matchlist(statusText, '^\(.\{3}\)\s\+\(\S\+\)\s\+\(\S\+\)\s\+\(\S\+\)\s')[1:3] + if revision == '' + " Error + return ['Unknown'] + elseif flags =~ '^A' + return ['New', 'New'] + else + return [revision, repository] + endif +endfunction + +" Function: s:svkFunctions.Info(argList) {{{2 +function! s:svkFunctions.Info(argList) + return s:DoCommand(join(['info'] + a:argList, ' '), 'info', join(a:argList, ' '), {}) +endfunction + +" Function: s:svkFunctions.Lock(argList) {{{2 +function! s:svkFunctions.Lock(argList) + return s:DoCommand(join(['lock'] + a:argList, ' '), 'lock', join(a:argList, ' '), {}) +endfunction + +" Function: s:svkFunctions.Log() {{{2 +function! s:svkFunctions.Log(argList) + if len(a:argList) == 0 + let options = [] + let caption = '' + elseif len(a:argList) <= 2 && match(a:argList, '^-') == -1 + let options = ['-r' . join(a:argList, ':')] + let caption = options[0] + else + " Pass-through + let options = a:argList + let caption = join(a:argList, ' ') + endif + + let resultBuffer = s:DoCommand(join(['log', '-v'] + options), 'log', caption, {}) + return resultBuffer +endfunction + +" Function: s:svkFunctions.Revert(argList) {{{2 +function! s:svkFunctions.Revert(argList) + return s:DoCommand('revert', 'revert', '', {}) +endfunction + +" Function: s:svkFunctions.Review(argList) {{{2 +function! s:svkFunctions.Review(argList) + if len(a:argList) == 0 + let versiontag = '(current)' + let versionOption = '' + else + let versiontag = a:argList[0] + let versionOption = ' -r ' . versiontag . ' ' + endif + + return s:DoCommand('cat' . versionOption, 'review', versiontag, {}) +endfunction + +" Function: s:svkFunctions.Status(argList) {{{2 +function! s:svkFunctions.Status(argList) + let options = ['-v'] + if len(a:argList) != 0 + let options = a:argList + endif + return s:DoCommand(join(['status'] + options, ' '), 'status', join(options, ' '), {}) +endfunction + +" Function: s:svkFunctions.Unlock(argList) {{{2 +function! s:svkFunctions.Unlock(argList) + return s:DoCommand(join(['unlock'] + a:argList, ' '), 'unlock', join(a:argList, ' '), {}) +endfunction +" Function: s:svkFunctions.Update(argList) {{{2 +function! s:svkFunctions.Update(argList) + return s:DoCommand('update', 'update', '', {}) +endfunction + +" Section: Plugin Registration {{{1 +let s:VCSCommandUtility = VCSCommandRegisterModule('SVK', expand('<sfile>'), s:svkFunctions, []) + +let &cpo = s:save_cpo diff --git a/.vim/plugin/vcssvn.vim b/.vim/plugin/vcssvn.vim @@ -0,0 +1,281 @@ +" vim600: set foldmethod=marker: +" +" SVN extension for VCSCommand. +" +" Maintainer: Bob Hiestand <bob.hiestand@gmail.com> +" License: +" Copyright (c) Bob Hiestand +" +" Permission is hereby granted, free of charge, to any person obtaining a copy +" of this software and associated documentation files (the "Software"), to +" deal in the Software without restriction, including without limitation the +" rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +" sell copies of the Software, and to permit persons to whom the Software is +" furnished to do so, subject to the following conditions: +" +" The above copyright notice and this permission notice shall be included in +" all copies or substantial portions of the Software. +" +" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +" FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +" IN THE SOFTWARE. +" +" Section: Documentation {{{1 +" +" Options documentation: {{{2 +" +" VCSCommandSVNExec +" This variable specifies the SVN executable. If not set, it defaults to +" 'svn' executed from the user's executable path. +" +" VCSCommandSVNDiffExt +" This variable, if set, sets the external diff program used by Subversion. +" +" VCSCommandSVNDiffOpt +" This variable, if set, determines the options passed to the svn diff +" command (such as 'u', 'w', or 'b'). + +" Section: Plugin header {{{1 + +if exists('VCSCommandDisableAll') + finish +endif + +if v:version < 700 + echohl WarningMsg|echomsg 'VCSCommand requires at least VIM 7.0'|echohl None + finish +endif + +if !exists('g:loaded_VCSCommand') + runtime plugin/vcscommand.vim +endif + +if !executable(VCSCommandGetOption('VCSCommandSVNExec', 'svn')) + " SVN is not installed + finish +endif + +let s:save_cpo=&cpo +set cpo&vim + +" Section: Variable initialization {{{1 + +let s:svnFunctions = {} + +" Section: Utility functions {{{1 + +" Function: s:Executable() {{{2 +" Returns the executable used to invoke git suitable for use in a shell +" command. +function! s:Executable() + return VCSCommandGetOption('VCSCommandSVNExec', 'svn') +endfunction + +" Function: s:DoCommand(cmd, cmdName, statusText, options) {{{2 +" Wrapper to VCSCommandDoCommand to add the name of the SVN executable to the +" command argument. +function! s:DoCommand(cmd, cmdName, statusText, options) + if VCSCommandGetVCSType(expand('%')) == 'SVN' + let fullCmd = s:Executable() . ' ' . a:cmd + return VCSCommandDoCommand(fullCmd, a:cmdName, a:statusText, a:options) + else + throw 'SVN VCSCommand plugin called on non-SVN item.' + endif +endfunction + +" Section: VCS function implementations {{{1 + +" Function: s:svnFunctions.Identify(buffer) {{{2 +function! s:svnFunctions.Identify(buffer) + let oldCwd = VCSCommandChangeToCurrentFileDir(resolve(bufname(a:buffer))) + try + call s:VCSCommandUtility.system(s:Executable() . ' info .') + if(v:shell_error) + return 0 + else + return g:VCSCOMMAND_IDENTIFY_EXACT + endif + finally + call VCSCommandChdir(oldCwd) + endtry +endfunction + +" Function: s:svnFunctions.Add() {{{2 +function! s:svnFunctions.Add(argList) + return s:DoCommand(join(['add'] + a:argList, ' '), 'add', join(a:argList, ' '), {}) +endfunction + +" Function: s:svnFunctions.Annotate(argList) {{{2 +function! s:svnFunctions.Annotate(argList) + if len(a:argList) == 0 + if &filetype ==? 'svnannotate' + " Perform annotation of the version indicated by the current line. + let caption = matchstr(getline('.'),'\v^\s+\zs\d+') + let options = ' -r' . caption + else + let caption = '' + let options = '' + endif + elseif len(a:argList) == 1 && a:argList[0] !~ '^-' + let caption = a:argList[0] + let options = ' -r' . caption + else + let caption = join(a:argList, ' ') + let options = ' ' . caption + endif + + return s:DoCommand('blame --non-interactive' . options, 'annotate', caption, {}) +endfunction + +" Function: s:svnFunctions.Commit(argList) {{{2 +function! s:svnFunctions.Commit(argList) + let resultBuffer = s:DoCommand('commit --non-interactive -F "' . a:argList[0] . '"', 'commit', '', {}) + if resultBuffer == 0 + echomsg 'No commit needed.' + endif +endfunction + +" Function: s:svnFunctions.Delete() {{{2 +function! s:svnFunctions.Delete(argList) + return s:DoCommand(join(['delete --non-interactive'] + a:argList, ' '), 'delete', join(a:argList, ' '), {}) +endfunction + +" Function: s:svnFunctions.Diff(argList) {{{2 +function! s:svnFunctions.Diff(argList) + if len(a:argList) == 0 + let revOptions = [] + let caption = '' + elseif len(a:argList) <= 2 && match(a:argList, '^-') == -1 + let revOptions = ['-r' . join(a:argList, ':')] + let caption = '(' . a:argList[0] . ' : ' . get(a:argList, 1, 'current') . ')' + else + " Pass-through + let caption = join(a:argList, ' ') + let revOptions = a:argList + endif + + let svnDiffExt = VCSCommandGetOption('VCSCommandSVNDiffExt', '') + if svnDiffExt == '' + let diffExt = [] + else + let diffExt = ['--diff-cmd ' . svnDiffExt] + endif + + let svnDiffOpt = VCSCommandGetOption('VCSCommandSVNDiffOpt', '') + if svnDiffOpt == '' + let diffOptions = [] + else + let diffOptions = ['-x -' . svnDiffOpt] + endif + + return s:DoCommand(join(['diff --non-interactive'] + diffExt + diffOptions + revOptions), 'diff', caption, {}) +endfunction + +" Function: s:svnFunctions.GetBufferInfo() {{{2 +" Provides version control details for the current file. Current version +" number and current repository version number are required to be returned by +" the vcscommand plugin. +" Returns: List of results: [revision, repository, branch] + +function! s:svnFunctions.GetBufferInfo() + let originalBuffer = VCSCommandGetOriginalBuffer(bufnr('%')) + let fileName = bufname(originalBuffer) + let statusText = s:VCSCommandUtility.system(s:Executable() . ' status --non-interactive -v -- "' . fileName . '"') + if(v:shell_error) + return [] + endif + + " File not under SVN control. + if statusText =~ '^?' + return ['Unknown'] + endif + + let [flags, revision, repository] = matchlist(statusText, '^\(.\{9}\)\s*\(\d\+\)\s\+\(\d\+\)')[1:3] + if revision == '' + " Error + return ['Unknown'] + elseif flags =~ '^A' + return ['New', 'New'] + elseif flags =~ '*' + return [revision, repository, '*'] + else + return [revision, repository] + endif +endfunction + +" Function: s:svnFunctions.Info(argList) {{{2 +function! s:svnFunctions.Info(argList) + return s:DoCommand(join(['info --non-interactive'] + a:argList, ' '), 'info', join(a:argList, ' '), {}) +endfunction + +" Function: s:svnFunctions.Lock(argList) {{{2 +function! s:svnFunctions.Lock(argList) + return s:DoCommand(join(['lock --non-interactive'] + a:argList, ' '), 'lock', join(a:argList, ' '), {}) +endfunction + +" Function: s:svnFunctions.Log(argList) {{{2 +function! s:svnFunctions.Log(argList) + if len(a:argList) == 0 + let options = [] + let caption = '' + elseif len(a:argList) <= 2 && match(a:argList, '^-') == -1 + let options = ['-r' . join(a:argList, ':')] + let caption = options[0] + else + " Pass-through + let options = a:argList + let caption = join(a:argList, ' ') + endif + + let resultBuffer = s:DoCommand(join(['log --non-interactive', '-v'] + options), 'log', caption, {}) + return resultBuffer +endfunction + +" Function: s:svnFunctions.Revert(argList) {{{2 +function! s:svnFunctions.Revert(argList) + return s:DoCommand('revert', 'revert', '', {}) +endfunction + +" Function: s:svnFunctions.Review(argList) {{{2 +function! s:svnFunctions.Review(argList) + if len(a:argList) == 0 + let versiontag = '(current)' + let versionOption = '' + else + let versiontag = a:argList[0] + let versionOption = ' -r ' . versiontag . ' ' + endif + + return s:DoCommand('cat --non-interactive' . versionOption, 'review', versiontag, {}) +endfunction + +" Function: s:svnFunctions.Status(argList) {{{2 +function! s:svnFunctions.Status(argList) + let options = ['-u', '-v'] + if len(a:argList) != 0 + let options = a:argList + endif + return s:DoCommand(join(['status --non-interactive'] + options, ' '), 'status', join(options, ' '), {}) +endfunction + +" Function: s:svnFunctions.Unlock(argList) {{{2 +function! s:svnFunctions.Unlock(argList) + return s:DoCommand(join(['unlock --non-interactive'] + a:argList, ' '), 'unlock', join(a:argList, ' '), {}) +endfunction + +" Function: s:svnFunctions.Update(argList) {{{2 +function! s:svnFunctions.Update(argList) + return s:DoCommand('update --non-interactive', 'update', '', {}) +endfunction + +" Annotate setting {{{2 +let s:svnFunctions.AnnotateSplitRegex = '\s\+\S\+\s\+\S\+ ' + +" Section: Plugin Registration {{{1 +let s:VCSCommandUtility = VCSCommandRegisterModule('SVN', expand('<sfile>'), s:svnFunctions, []) + +let &cpo = s:save_cpo diff --git a/.vim/skim-vim b/.vim/skim-vim @@ -0,0 +1,22 @@ +#!/bin/bash + +file="$1" +line="$2" + +[ "${file:0:1}" == "/" ] || file="${PWD}/$file" + +exec osascript \ + -e "set ESC to ASCII character 27" \ + -e "tell application \"Vim\" to activate" \ + -e "tell application \"System Events\"" \ + -e " tell process \"Vim\"" \ + -e " keystroke ESC & \":set hidden\" & return " \ + -e " keystroke \":if bufexists('$file')\" & return " \ + -e " keystroke \":exe \\\":buffer \\\" . bufnr('$file')\" & return " \ + -e " keystroke \":else \" & return " \ + -e " keystroke \": edit ${file// /\\\\ }\" & return " \ + -e " keystroke \":endif\" & return " \ + -e " keystroke \":$line\" & return " \ + -e " keystroke \"zO\" " \ + -e " end tell" \ + -e "end tell" diff --git a/.vim/syntax/._HGAnnotate.vim b/.vim/syntax/._HGAnnotate.vim Binary files differ. diff --git a/.vim/syntax/._SCCSAnnotate.vim b/.vim/syntax/._SCCSAnnotate.vim Binary files differ. diff --git a/.vim/syntax/._cvsannotate.vim b/.vim/syntax/._cvsannotate.vim Binary files differ. diff --git a/.vim/syntax/._gitannotate.vim b/.vim/syntax/._gitannotate.vim Binary files differ. diff --git a/.vim/syntax/._matlab.vim b/.vim/syntax/._matlab.vim Binary files differ. diff --git a/.vim/syntax/._svkannotate.vim b/.vim/syntax/._svkannotate.vim Binary files differ. diff --git a/.vim/syntax/._svnannotate.vim b/.vim/syntax/._svnannotate.vim Binary files differ. diff --git a/.vim/syntax/._vcscommit.vim b/.vim/syntax/._vcscommit.vim Binary files differ. diff --git a/.vim/syntax/HGAnnotate.vim b/.vim/syntax/HGAnnotate.vim @@ -0,0 +1,41 @@ +" Vim syntax file +" Language: Mercurial annotate output +" Maintainer: Bob Hiestand <bob.hiestand@gmail.com> +" Remark: Used by the vcscommand plugin. +" License: +" Copyright (c) 2007 Vladimir Marek +" based on SVNAnnotate.vim by Bob Hiestand +" +" Permission is hereby granted, free of charge, to any person obtaining a copy +" of this software and associated documentation files (the "Software"), to +" deal in the Software without restriction, including without limitation the +" rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +" sell copies of the Software, and to permit persons to whom the Software is +" furnished to do so, subject to the following conditions: +" +" The above copyright notice and this permission notice shall be included in +" all copies or substantial portions of the Software. +" +" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +" FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +" IN THE SOFTWARE. + +if exists("b:current_syntax") + finish +endif + +syn match hgVer /\d\+/ contained +syn match hgName /^\s*\zs\S\+/ contained nextgroup=hgVer skipwhite +syn match hgHead /^\s*\S\+\s\+\d\+/ contains=hgName,hgVer + +if !exists("did_hgannotate_syntax_inits") + let did_hgannotate_syntax_inits = 1 + hi link hgName Type + hi link hgVer Statement +endif + +let b:current_syntax="hgAnnotate" diff --git a/.vim/syntax/SCCSAnnotate.vim b/.vim/syntax/SCCSAnnotate.vim @@ -0,0 +1,38 @@ +" Vim syntax file +" Language: SCCS annotate output +" Maintainer: Bob Hiestand <bob.hiestand@gmail.com> +" Remark: Used by the vcscommand plugin. +" License: +" Copyright (c) 2007 Vladimir Marek +" based on SVNAnnotate.vim by Bob Hiestand +" +" Permission is hereby granted, free of charge, to any person obtaining a copy +" of this software and associated documentation files (the "Software"), to +" deal in the Software without restriction, including without limitation the +" rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +" sell copies of the Software, and to permit persons to whom the Software is +" furnished to do so, subject to the following conditions: +" +" The above copyright notice and this permission notice shall be included in +" all copies or substantial portions of the Software. +" +" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +" FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +" IN THE SOFTWARE. + +if exists("b:current_syntax") + finish +endif + +syn match sccsVer /^\d\+\%(\.\d\+\)\{1,3}/ + +if !exists("did_sccsannotate_syntax_inits") + let did_sccsannotate_syntax_inits = 1 + hi link sccsVer Statement +endif + +let b:current_syntax="SCCSAnnotate" diff --git a/.vim/syntax/arduino.vim b/.vim/syntax/arduino.vim @@ -0,0 +1,58 @@ +" Vim syntax file +" Language: Arduino +" Maintainer: Johannes Hoff <johannes@johanneshoff.com> +" Last Change: 23 December 2011 +" License: VIM license (:help license, replace vim by arduino.vim) + +" Syntax highlighting like in the Arduino IDE +" Automatically generated by the script available at +" https://bitbucket.org/johannes/arduino-vim-syntax +" Using keywords from <arduino>/build/shared/lib/keywords.txt +" From version: ARDUINO 1.0 + +" Thanks to Rik, Erik Nomitch, Adam Obeng and Graeme Cross for helpful feedback! + +" For version 5.x: Clear all syntax items +" For version 6.x: Quit when a syntax file was already loaded +if version < 600 + syntax clear +elseif exists("b:current_syntax") + finish +endif + +" Read the C syntax to start with +if version < 600 + so <sfile>:p:h/cpp.vim +else + runtime! syntax/cpp.vim +endif + +syn keyword arduinoConstant BIN CHANGE DEC DEFAULT EXTERNAL FALLING HALF_PI HEX +syn keyword arduinoConstant HIGH INPUT INTERNAL INTERNAL1V1 INTERNAL2V56 LOW +syn keyword arduinoConstant LSBFIRST MSBFIRST OCT OUTPUT PI RISING TWO_PI + +syn keyword arduinoFunc analogRead analogReference analogWrite +syn keyword arduinoFunc attachInterrupt bit bitClear bitRead bitSet +syn keyword arduinoFunc bitWrite delay delayMicroseconds detachInterrupt +syn keyword arduinoFunc digitalRead digitalWrite highByte interrupts +syn keyword arduinoFunc lowByte micros millis noInterrupts noTone pinMode +syn keyword arduinoFunc pulseIn shiftIn shiftOut tone + +syn keyword arduinoMethod available begin end find findUntil flush loop +syn keyword arduinoMethod parseFloat parseInt peek print println read +syn keyword arduinoMethod readBytes readBytesUntil setTimeout setup + +syn keyword arduinoModule Serial Serial1 Serial2 Serial3 + +syn keyword arduinoStdFunc abs acos asin atan atan2 ceil constrain cos degrees +syn keyword arduinoStdFunc exp floor log map max min radians random randomSeed +syn keyword arduinoStdFunc round sin sq sqrt tan + +syn keyword arduinoType boolean byte null String word + +hi def link arduinoType Type +hi def link arduinoConstant Constant +hi def link arduinoStdFunc Function +hi def link arduinoFunc Function +hi def link arduinoMethod Function +hi def link arduinoModule Identifier diff --git a/.vim/syntax/cvsannotate.vim b/.vim/syntax/cvsannotate.vim @@ -0,0 +1,45 @@ +" Vim syntax file +" Language: CVS annotate output +" Maintainer: Bob Hiestand <bob.hiestand@gmail.com> +" Remark: Used by the cvscommand plugin. Originally written by Mathieu +" Clabaut +" License: +" Copyright (c) Bob Hiestand +" +" Permission is hereby granted, free of charge, to any person obtaining a copy +" of this software and associated documentation files (the "Software"), to +" deal in the Software without restriction, including without limitation the +" rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +" sell copies of the Software, and to permit persons to whom the Software is +" furnished to do so, subject to the following conditions: +" +" The above copyright notice and this permission notice shall be included in +" all copies or substantial portions of the Software. +" +" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +" FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +" IN THE SOFTWARE. + +if version < 600 + syntax clear +elseif exists("b:current_syntax") + finish +endif + +syn match cvsDate /\d\d-...-\d\d/ contained +syn match cvsName /(\S* /hs=s+1,he=e-1 contained nextgroup=cvsDate +syn match cvsVer /^\d\+\(\.\d\+\)\+/ contained nextgroup=cvsName +syn region cvsHead start="^\d\+\.\d\+" end="):" contains=cvsVer,cvsName,cvsDate + +if !exists("did_cvsannotate_syntax_inits") + let did_cvsannotate_syntax_inits = 1 + hi link cvsDate Comment + hi link cvsName Type + hi link cvsVer Statement +endif + +let b:current_syntax="CVSAnnotate" diff --git a/.vim/syntax/gitannotate.vim b/.vim/syntax/gitannotate.vim @@ -0,0 +1,44 @@ +" Vim syntax file +" Language: git annotate output +" Maintainer: Bob Hiestand <bob.hiestand@gmail.com> +" Remark: Used by the vcscommand plugin. +" License: +" Copyright (c) Bob Hiestand +" +" Permission is hereby granted, free of charge, to any person obtaining a copy +" of this software and associated documentation files (the "Software"), to +" deal in the Software without restriction, including without limitation the +" rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +" sell copies of the Software, and to permit persons to whom the Software is +" furnished to do so, subject to the following conditions: +" +" The above copyright notice and this permission notice shall be included in +" all copies or substantial portions of the Software. +" +" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +" FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +" IN THE SOFTWARE. + +if exists("b:current_syntax") + finish +endif + +syn region gitName start="(\@<=" end="\( \d\d\d\d-\)\@=" contained +syn match gitCommit /^\^\?\x\+/ contained +syn match gitDate /\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d [+-]\d\d\d\d/ contained +syn match gitLineNumber /\d\+)\@=/ contained +syn region gitAnnotation start="^" end=") " oneline keepend contains=gitCommit,gitLineNumber,gitDate,gitName + +if !exists("did_gitannotate_syntax_inits") + let did_gitannotate_syntax_inits = 1 + hi link gitName Type + hi link gitCommit Statement + hi link gitDate Comment + hi link gitLineNumber Label +endif + +let b:current_syntax="gitAnnotate" diff --git a/.vim/syntax/matlab.vim b/.vim/syntax/matlab.vim @@ -0,0 +1,357 @@ +" Vim syntax file +" Language: Matlab +" Maintainer: Fabrice Guy <fabrice.guy at gmail dot com> +" Original authors: Mario Eusebio and Preben Guldberg +" Last Change: 2008 Oct 16 : added try/catch/rethrow and class statements +" 2008 Oct 28 : added highlighting for most of Matlab functions +" 2009 Nov 23 : added 'todo' keyword in the matlabTodo keywords +" (for doxygen support) + +" For version 5.x: Clear all syntax items +" For version 6.x: Quit when a syntax file was already loaded +if version < 600 + syntax clear +elseif exists("b:current_syntax") + finish +endif + +syn keyword matlabStatement return function +syn keyword matlabConditional switch case else elseif end if otherwise break continue +syn keyword matlabRepeat do for while +syn keyword matlabStorageClass classdef methods properties events persistent global +syn keyword matlabExceptions try catch rethrow throw + +syn keyword matlabTodo contained TODO NOTE FIXME XXX +syn keyword matlabImport import +" If you do not want these operators lit, uncommment them and the "hi link" below +syn match matlabRelationalOperator "\(==\|\~=\|>=\|<=\|=\~\|>\|<\|=\)" +syn match matlabArithmeticOperator "[-+]" +syn match matlabArithmeticOperator "\.\=[*/\\^]" +syn match matlabLogicalOperator "[&|~]" +syn keyword matlabBoolean true false + +syn match matlabLineContinuation "\.\{3}" + +" String +syn region matlabString start=+'+ end=+'+ oneline + +" If you don't like tabs +syn match matlabTab "\t" + +" Standard numbers +syn match matlabNumber "\<\d\+[ij]\=\>" +" floating point number, with dot, optional exponent +syn match matlabFloat "\<\d\+\(\.\d*\)\=\([edED][-+]\=\d\+\)\=[ij]\=\>" +" floating point number, starting with a dot, optional exponent +syn match matlabFloat "\.\d\+\([edED][-+]\=\d\+\)\=[ij]\=\>" +syn keyword matlabConstant eps Inf NaN pi + + +" Transpose character and delimiters: Either use just [...] or (...) aswell +syn match matlabDelimiter "[][]" +"syn match matlabDelimiter "[][()]" +syn match matlabTransposeOperator "[])a-zA-Z0-9.]'"lc=1 + +syn match matlabSemicolon ";" + +syn match matlabComment "%.*$" contains=matlabTodo,matlabTab +syn region matlabBlockComment start=+%{+ end=+%}+ contains=matlabBlockComment + + +" trigonometric +syn keyword matlabFunc acos acosd acosh acot acotd acoth acsc acscd acsch asec asecd asech asin asind asinh +syn keyword matlabFunc atan atan2 atand atanh cos cosd cosh cot cotd coth csc cscd csch hypot sec secd +syn keyword matlabFunc sech sin sind sinh tan tand tanh +" exponential +syn keyword matlabFunc exp expm1 log log10 log1p log2 nextpow2 nthroot pow2 reallog realpow realsqrt sqrt +" Complex +syn keyword matlabFunc abs angle complex conj cplxpair imag real sign unwrap +" Rounding and Remainder +syn keyword matlabFunc ceil fix floor idivide mod rem round +"Discrete Math (e.g., Prime Factors) +syn keyword matlabFunc factor factorial gcd isprime lcm nchoosek perms primes rat rats +"Polynomials +syn keyword matlabFunc conv deconv poly polyder polyeig polyfit polyint polyval polyvalm residue roots +"Numeric Types +syn keyword matlabFunc arrayfun cast cat class find intmax intmin intwarning ipermute isa isequal isequalwithequalnans isfinite isinf isnan isnumeric isreal isscalar isvector permute realmax realmin reshape squeeze zeros +"Characters and Strings +syn keyword matlabFunc cellstr char eval findstr isstr regexp sprintf sscanf strcat strcmp strcmpi strings strjust strmatch strread strrep strtrim strvcat +"Structures +syn keyword matlabFunc cell2struct deal fieldnames getfield isfield isstruct orderfields rmfield setfield struct struct2cell structfun +"Cell Arrays +syn keyword matlabFunc cell cell2mat celldisp cellfun cellplot iscell iscellstr mat2cell num2cell +"Function Handles +syn keyword matlabFunc feval func2str functions str2func +"Java Classes and Objects +syn keyword matlabFunc clear depfun exist im2java inmem javaaddpath javaArray javachk Generate javaclasspath javaMethod javaObject javarmpath methodsview usejava which +"Data Type Identification +syn keyword matlabFunc ischar isfloat isinteger isjava islogical isobject validateattributes who whos +"Data type conversion +"Numeric +syn keyword matlabFunc double int8 int16 int32 int64 single typecast uint8 uint16 uint32 uint64 +"String to Numeric +syn keyword matlabFunc base2dec bin2dec hex2dec hex2num str2double str2num unicode2native +"Numeric to String +syn keyword matlabFunc dec2base dec2bin dec2hex int2str mat2str native2unicode num2str +"Other Conversions +syn keyword matlabFunc datestr logical num2hex str2mat +"String Creation +syn keyword matlabFunc blanks +"String Identification +syn keyword matlabFunc isletter isspace isstrprop validatestring +"String Manipulation +syn keyword matlabFunc deblank lower upper +"String Parsing +syn keyword matlabFunc regexpi regexprep regexptranslate strfind strtok +"String Evaluation +syn keyword matlabFunc evalc evalin +"String Comparison +syn keyword matlabFunc strncmp strncmpi +"Bit-wise Functions +syn keyword matlabFunc bitand bitcmp bitget bitmax bitor bitset bitshift bitxor swapbytes +"Logical Functions +syn keyword matlabFunc all and any iskeyword isvarname not or xor +"Predefined Dialog Boxes +syn keyword matlabFunc dialog errordlg export2wsdlg helpdlg inputdlg listdlg msgbox printdlg printpreview questdlg uigetdir uigetfile uigetpref uiopen uiputfile uisave uisetcolor uisetfont waitbar warndlg +"Deploying User Interfaces +syn keyword matlabFunc guidata guihandles movegui openfig +"Developing User Interfaces +syn keyword matlabFunc addpref getappdata getpref ginput guide inspect isappdata ispref rmappdata rmpref setappdata setpref uisetpref waitfor waitforbuttonpress +"User Interface Objects +syn keyword matlabFunc uibuttongroup uicontextmenu uicontrol uimenu uipanel uipushtool uitoggletool uitoolbar menu +"Finding Objects from Callbacks +syn keyword matlabFunc findall findfigs findobj gcbf gcbo +"GUI Utility Functions +syn keyword matlabFunc align getpixelposition listfonts selectmoveresize setpixelposition textwrap uistack +"Controlling Program Execution +syn keyword matlabFunc uiresume uiwait +"Basic Plots and Graphs +syn keyword matlabFunc box errorbar hold loglog plot plot3 plotyy polar semilogx semilogy subplot +"Plotting Tools +syn keyword matlabFunc figurepalette pan plotbrowser plotedit plottools propertyeditor rotate3d showplottool zoom + +"Annotating Plots +syn keyword matlabFunc annotation clabel datacursormode datetick gtext legend line rectangle texlabel title xlabel ylabel zlabel +"Area, Bar, and Pie Plots +syn keyword matlabFunc area bar barh bar3 bar3h pareto pie pie3 +"Contour Plots +syn keyword matlabFunc contour contour3 contourc contourf ezcontour ezcontourf +"Direction and Velocity Plots +syn keyword matlabFunc comet comet3 compass feather quiver quiver3 +"Discrete Data Plots +syn keyword matlabFunc stairs stem stem3 +"Function Plots +syn keyword matlabFunc ezmesh ezmeshc ezplot ezplot3 ezpolar ezsurf ezsurfc fplot +"Histograms +syn keyword matlabFunc hist histc rose +"Polygons and Surfaces +syn keyword matlabFunc convhull cylinder delaunay delaunay3 delaunayn dsearch dsearchn ellipsoid fill fill3 inpolygon pcolor polyarea rectint ribbon slice sphere tsearch tsearchn voronoi waterfall +"Scatter/Bubble Plots +syn keyword matlabFunc plotmatrix scatter scatter3 +"Animation +syn keyword matlabFunc getframe im2frame movie noanimate +"Bit-Mapped Images +syn keyword matlabFunc frame2im image imagesc imfinfo imformats imread imwrite ind2rgb +"Printing +syn keyword matlabFunc frameedit hgexport orient print printopt saveas +"Handle Graphics +syn keyword matlabFunc allchild ancestor copyobj delete gca gco get ishandle propedit set +"Object +syn keyword matlabFunc axes figure hggroup hgtransform light patch +"root object +syn keyword matlabFunc surface text +"Plot Objects +syn keyword matlabFunc clf close closereq drawnow gcf hgload hgsave newplot opengl refresh +"Axes Operations +syn keyword matlabFunc axis cla grid ishold makehgtform +"Operating on Object Properties +syn keyword matlabFunc linkaxes linkprop refreshdata +"Data analysis +"Basic Operations +syn keyword matlabFunc brush cumprod cumsum linkdata prod sort sortrows sum +"Descriptive Statistics +syn keyword matlabFunc corrcoef cov max mean median min mode std var +"Filtering and Convolution +syn keyword matlabFunc conv2 convn detrend filter filter2 +"Interpolation and Regression +syn keyword matlabFunc interp1 interp2 interp3 interpn mldivide mrdivide +"Fourier Transforms +syn keyword matlabFunc fft fft2 fftn fftshift fftw ifft ifft2 ifftn ifftshift +"Derivatives and Integrals +syn keyword matlabFunc cumtrapz del2 diff gradient trapz +"File Operations +syn keyword matlabFunc cd copyfile dir fileattrib filebrowser isdir lookfor ls matlabroot mkdir movefile pwd recycle rehash rmdir toolboxdir type what +"Operating System Interface +syn keyword matlabFunc clipboard computer dos getenv hostid maxNumCompThreads perl setenv system unix winqueryreg +"MATLAB Version and License +syn keyword matlabFunc ismac ispc isstudent isunix javachk license prefdir usejava ver verLessThan version +"Basic Information +syn keyword matlabFunc disp display isempty issparse length ndims numel size +"Elementary Matrices and Arrays +syn keyword matlabFunc blkdiag diag eye freqspace ind2sub linspace logspace meshgrid ndgrid ones rand randn sub2ind +"Array Operations +syn keyword matlabFunc accumarray bsxfun cross dot kron tril triu +"Array Manipulation +syn keyword matlabFunc circshift flipdim fliplr flipud horzcat inline repmat rot90 shiftdim vectorize vertcat +"Specialized Matrices +syn keyword matlabFunc compan gallery hadamard hankel hilb invhilb magic pascal rosser toeplitz vander wilkinson +"Matrix Analysis +syn keyword matlabFunc cond condeig det norm normest null orth rank rcond rref subspace trace +"Linear Equations +syn keyword matlabFunc chol cholinc condest funm ilu inv linsolve lscov lsqnonneg lu luinc pinv qr +"Eigenvalues and Singular Values +syn keyword matlabFunc balance cdf2rdf eig eigs gsvd hess ordeig ordqz ordschur rsf2csf schur sqrtm ss2tf svd svds +"Matrix Logarithms and Exponentials +syn keyword matlabFunc expm logm +"Factorization +syn keyword matlabFunc cholupdate planerot qrdelete qrinsert qrupdate qz +"Interpolation +syn keyword matlabFunc griddata griddata3 griddatan interp1q interpft mkpp padecoef pchip ppval spline unmkpp +"Delaunay Triangulation and Tessellation +syn keyword matlabFunc tetramesh trimesh triplot trisurf +"Convex Hull +syn keyword matlabFunc convhulln +"Voronoi Diagrams +syn keyword matlabFunc voronoin +"Cartesian Coordinate System Conversion +syn keyword matlabFunc cart2pol cart2sph pol2cart sph2cart +"Ordinary Differential Equations (IVP) +syn keyword matlabFunc decic deval ode15i ode23 ode45 ode113 ode15s ode23s ode23t ode23tb odefile odeget odeset odextend +"Delay Differential Equations +syn keyword matlabFunc dde23 ddeget ddesd ddeset +"Boundary Value Problems +syn keyword matlabFunc bvp4c bvp5c bvpget bvpinit bvpset bvpxtend +"Partial Differential Equations +syn keyword matlabFunc pdepe pdeval +"Optimization +syn keyword matlabFunc fminbnd fminsearch fzero optimget optimset +"Numerical Integration (Quadrature) +syn keyword matlabFunc dblquad quad quadgk quadl quadv triplequad +"Specialized Math +syn keyword matlabFunc airy besselh besseli besselj besselk bessely beta betainc betaln ellipj ellipke erf erfc erfcx erfinv erfcinv expint gamma gammainc gammaln legendre psi +"Elementary Sparse Matrices +syn keyword matlabFunc spdiags speye sprand sprandn sprandsym +"Full to Sparse Conversion +syn keyword matlabFunc full sparse spconvert +"Working with Sparse Matrices +syn keyword matlabFunc nnz nonzeros nzmax spalloc spfun spones spparms spy +"Reordering Algorithms +syn keyword matlabFunc amd colamd colperm dmperm ldl randperm symamd symrcm +"Linear Algebra +syn keyword matlabFunc spaugment sprank +"Linear Equations (Iterative Methods) +syn keyword matlabFunc bicg bicgstab cgs gmres lsqr minres pcg qmr symmlq +"Tree Operations +syn keyword matlabFunc etree etreeplot gplot symbfact treelayout treeplot +"Timeseries +"General Purpose +syn keyword matlabFunc getdatasamplesize getqualitydesc timeseries tsprops tstool +"Data Manipulation +syn keyword matlabFunc addsample ctranspose delsample getabstime getinterpmethod getsampleusingtime idealfilter resample setabstime setinterpmethod synchronize transpose +"Event Data +syn keyword matlabFunc addevent delevent gettsafteratevent gettsafterevent gettsatevent gettsbeforeatevent gettsbeforeevent gettsbetweenevents +"Descriptive Statistics +syn keyword matlabFunc iqr + +"Time Series Collections +"General Purpose +syn keyword matlabFunc tscollection +"Data Manipulation +syn keyword matlabFunc addsampletocollection addts delsamplefromcollection gettimeseriesnames removets settimeseriesnames +"Set Functions +syn keyword matlabFunc intersect ismember issorted setdiff setxor union unique +"Date and Time Functions +syn keyword matlabFunc addtodate calendar clock cputime date datenum datevec eomday etime now weekday +"M-File Functions and Scripts +syn keyword matlabFunc addOptional addParamValue addRequired createCopy depdir echo input inputname inputParser mfilename namelengthmax nargchk nargin nargout nargoutchk parse pcode +"script Script M-file description +syn keyword matlabFunc varargin varargout +"Evaluation of Expressions and Functions +syn keyword matlabFunc ans assert builtin pause run script symvar +"Timer Functions +syn keyword matlabFunc isvalid start startat stop timer timerfind timerfindall wait +"Variables and Functions in Memory +syn keyword matlabFunc assignin datatipinfo genvarname isglobal memory mislocked mlock munlock pack +"Control Flow +syn keyword matlabFunc parfor +"Error Handling +syn keyword matlabFunc addCause error ferror getReport last lasterr lasterror lastwarn warning +"Classes and Objects +syn keyword matlabFunc addlistener addprop dynamicprops +"events Display class event names +syn keyword matlabFunc findprop getdisp handle hgsetget inferiorto loadobj metaclass notify saveobj setdisp subsasgn subsindex subsref substruct superiorto +"File Name Construction +syn keyword matlabFunc filemarker fileparts filesep fullfile tempdir tempname +"Opening, Loading, Saving Files +syn keyword matlabFunc daqread filehandle importdata load open save uiimport winopen +"Memory Mapping +syn keyword matlabFunc memmapfile +"Low-Level File I/O +syn keyword matlabFunc fclose feof fgetl fgets fopen fprintf fread frewind fscanf fseek ftell fwrite + +"Text Files +syn keyword matlabFunc csvread csvwrite dlmread dlmwrite textread textscan +"XML Documents +syn keyword matlabFunc xmlread xmlwrite xslt +"Microsoft Excel Functions +syn keyword matlabFunc xlsfinfo xlsread xlswrite +"Lotus 1-2-3 Functions +syn keyword matlabFunc wk1finfo wk1read wk1write +"Common Data Format (CDF) +syn keyword matlabFunc cdfepoch cdfinfo cdfread cdfwrite todatenum +"Flexible Image Transport System +syn keyword matlabFunc fitsinfo fitsread +"Hierarchical Data Format (HDF) +syn keyword matlabFunc hdf hdf5 hdf5info hdf5read hdf5write hdfinfo hdfread hdftool +"Band-Interleaved Data +syn keyword matlabFunc multibandread multibandwrite + + +" Define the default highlighting. +" For version 5.7 and earlier: only when not done already +" For version 5.8 and later: only when an item doesn't have highlighting yet +if version >= 508 || !exists("did_matlab_syntax_inits") + if version < 508 + let did_matlab_syntax_inits = 1 + command -nargs=+ HiLink hi link <args> + else + command -nargs=+ HiLink hi def link <args> + endif + + HiLink matlabTransposeOperator matlabOperator + HiLink matlabLineContinuation Special + HiLink matlabLabel Label + HiLink matlabConditional Conditional + HiLink matlabRepeat Repeat + HiLink matlabTodo Todo + HiLink matlabString String + HiLink matlabDelimiter Identifier + HiLink matlabTransposeOther Identifier + HiLink matlabNumber Number + HiLink matlabFloat Float + HiLink matlabConstant Constant + HiLink matlabImplicit matlabStatement + HiLink matlabStatement Statement + HiLink matlabSemicolon SpecialChar + HiLink matlabComment Comment + HiLink matlabBlockComment Comment + HiLink matlabImport Include + HiLink matlabBoolean Boolean + HiLink matlabStorageClass StorageClass + + HiLink matlabArithmeticOperator matlabOperator + HiLink matlabRelationalOperator matlabOperator + HiLink matlabLogicalOperator matlabOperator + HiLink matlabOperator Operator + HiLink matlabExceptions Exception + HiLink matlabFunc Function + +"optional highlighting + "HiLink matlabIdentifier Identifier + "HiLink matlabTab Error + delcommand HiLink +endif + +let b:current_syntax = "matlab" + +"EOF vim: ts=8 noet tw=100 sw=8 sts=0 diff --git a/.vim/syntax/svkannotate.vim b/.vim/syntax/svkannotate.vim @@ -0,0 +1,42 @@ +" Vim syntax file +" Language: SVK annotate output +" Maintainer: Bob Hiestand <bob.hiestand@gmail.com> +" Remark: Used by the vcscommand plugin. +" License: +" Copyright (c) Bob Hiestand +" +" Permission is hereby granted, free of charge, to any person obtaining a copy +" of this software and associated documentation files (the "Software"), to +" deal in the Software without restriction, including without limitation the +" rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +" sell copies of the Software, and to permit persons to whom the Software is +" furnished to do so, subject to the following conditions: +" +" The above copyright notice and this permission notice shall be included in +" all copies or substantial portions of the Software. +" +" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +" FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +" IN THE SOFTWARE. + +if exists("b:current_syntax") + finish +endif + +syn match svkDate /\d\{4}-\d\{1,2}-\d\{1,2}/ skipwhite contained +syn match svkName /(\s*\zs\S\+/ contained nextgroup=svkDate skipwhite +syn match svkVer /^\s*\d\+/ contained nextgroup=svkName skipwhite +syn region svkHead start=/^/ end="):" contains=svkVer,svkName,svkDate oneline + +if !exists("did_svkannotate_syntax_inits") + let did_svkannotate_syntax_inits = 1 + hi link svkName Type + hi link svkDate Comment + hi link svkVer Statement +endif + +let b:current_syntax="svkAnnotate" diff --git a/.vim/syntax/svnannotate.vim b/.vim/syntax/svnannotate.vim @@ -0,0 +1,40 @@ +" Vim syntax file +" Language: SVN annotate output +" Maintainer: Bob Hiestand <bob.hiestand@gmail.com> +" Remark: Used by the vcscommand plugin. +" License: +" Copyright (c) Bob Hiestand +" +" Permission is hereby granted, free of charge, to any person obtaining a copy +" of this software and associated documentation files (the "Software"), to +" deal in the Software without restriction, including without limitation the +" rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +" sell copies of the Software, and to permit persons to whom the Software is +" furnished to do so, subject to the following conditions: +" +" The above copyright notice and this permission notice shall be included in +" all copies or substantial portions of the Software. +" +" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +" FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +" IN THE SOFTWARE. + +if exists("b:current_syntax") + finish +endif + +syn match svnName /\S\+/ contained +syn match svnVer /^\s*\zs\d\+/ contained nextgroup=svnName skipwhite +syn match svnHead /^\s*\d\+\s\+\S\+/ contains=svnVer,svnName + +if !exists("did_svnannotate_syntax_inits") + let did_svnannotate_syntax_inits = 1 + hi link svnName Type + hi link svnVer Statement +endif + +let b:current_syntax="svnAnnotate" diff --git a/.vim/syntax/vcscommit.vim b/.vim/syntax/vcscommit.vim @@ -0,0 +1,31 @@ +" Vim syntax file +" Language: VCS commit file +" Maintainer: Bob Hiestand (bob.hiestand@gmail.com) +" License: +" Copyright (c) Bob Hiestand +" +" Permission is hereby granted, free of charge, to any person obtaining a copy +" of this software and associated documentation files (the "Software"), to +" deal in the Software without restriction, including without limitation the +" rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +" sell copies of the Software, and to permit persons to whom the Software is +" furnished to do so, subject to the following conditions: +" +" The above copyright notice and this permission notice shall be included in +" all copies or substantial portions of the Software. +" +" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +" FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +" IN THE SOFTWARE. + +if exists("b:current_syntax") + finish +endif + +syntax region vcsComment start="^VCS: " end="$" +highlight link vcsComment Comment +let b:current_syntax = "vcscommit" diff --git a/.vim/vimplugin.zip b/.vim/vimplugin.zip Binary files differ.