Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
tex.vim47 linesDownload Raw Back to ftplugin
1" LaTeX filetype plugin2" Language:     LaTeX (ft=tex)3" Maintainer:   Benji Fisher, Ph.D. <benji@member.AMS.org>4" Version:	1.45" Last Change:	Wed 19 Apr 20066"  URL:		http://www.vim.org/script.php?script_id=4117 8" Only do this when not done yet for this buffer.9if exists("b:did_ftplugin")10  finish11endif12 13" Start with plain TeX.  This will also define b:did_ftplugin .14source $VIMRUNTIME/ftplugin/plaintex.vim15 16" Avoid problems if running in 'compatible' mode.17let s:save_cpo = &cpo18set cpo&vim19 20let b:undo_ftplugin .= "| setl inex<"21 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.25let &l:define .= '\|\\\(re\)\=new\(boolean\|command\|counter\|environment\|font'26	\ . '\|if\|length\|savebox\|theorem\(style\)\=\)\s*\*\=\s*{\='27	\ . '\|DeclareMathOperator\s*{\=\s*'28 29" Tell Vim how to recognize LaTeX \include{foo} and plain \input bar :30let &l:include .= '\|\\include{'31" On some file systems, "{" and "}" are included in 'isfname'.  In case the32" TeX file has \include{fname} (LaTeX only), strip everything except "fname".33let &l:includeexpr = "substitute(v:fname, '^.\\{-}{\\|}.*', '', 'g')"34 35" The following lines enable the macros/matchit.vim plugin for36" extended matching with the % key.37" ftplugin/plaintex.vim already defines b:match_skip and b:match_ignorecase38" and matches \(, \), \[, \], \{, and \} .39if exists("loaded_matchit")40  let b:match_words .= ',\\begin\s*\({\a\+\*\=}\):\\end\s*\1'41endif " exists("loaded_matchit")42 43let &cpo = s:save_cpo44unlet s:save_cpo45 46" vim:sts=2:sw=2:47 
codekingpro/portable-devtools · Team Ai