Install vim73
[msysgit/mtrensch.git] / share / vim / vim73 / ftplugin / tex.vim
blob408992743991d250563b312af78fee5cd76be64c
1 " LaTeX filetype plugin
2 " Language:     LaTeX (ft=tex)
3 " Maintainer:   Benji Fisher, Ph.D. <benji@member.AMS.org>
4 " Version:      1.4
5 " Last Change:  Wed 19 Apr 2006
6 "  URL:         http://www.vim.org/script.php?script_id=411
8 " Only do this when not done yet for this buffer.
9 if exists("b:did_ftplugin")
10   finish
11 endif
13 " Start with plain TeX.  This will also define b:did_ftplugin .
14 source $VIMRUNTIME/ftplugin/plaintex.vim
16 " Avoid problems if running in 'compatible' mode.
17 let s:save_cpo = &cpo
18 set cpo&vim
20 let b:undo_ftplugin .= "| setl inex<"
22 " Allow "[d" to be used to find a macro definition:
23 " Recognize plain TeX \def as well as LaTeX \newcommand and \renewcommand .
24 " I may as well add the AMS-LaTeX DeclareMathOperator as well.
25 let &l:define .= '\|\\\(re\)\=new\(boolean\|command\|counter\|environment\|font'
26         \ . '\|if\|length\|savebox\|theorem\(style\)\=\)\s*\*\=\s*{\='
27         \ . '\|DeclareMathOperator\s*{\=\s*'
29 " Tell Vim how to recognize LaTeX \include{foo} and plain \input bar :
30 let &l:include .= '\|\\include{'
31 " On some file systems, "{" and "}" are inluded in 'isfname'.  In case the
32 " TeX file has \include{fname} (LaTeX only), strip everything except "fname".
33 let &l:includeexpr = "substitute(v:fname, '^.\\{-}{\\|}.*', '', 'g')"
35 " The following lines enable the macros/matchit.vim plugin for
36 " extended matching with the % key.
37 " ftplugin/plaintex.vim already defines b:match_skip and b:match_ignorecase
38 " and matches \(, \), \[, \], \{, and \} .
39 if exists("loaded_matchit")
40   let b:match_words .= ',\\begin\s*\({\a\+\*\=}\):\\end\s*\1'
41 endif " exists("loaded_matchit")
43 let &cpo = s:save_cpo
45 " vim:sts=2:sw=2: