| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " LaTeX filetype plugin | 
					
						
							|  |  |  | " Language:     LaTeX (ft=tex) | 
					
						
							|  |  |  | " Maintainer:   Benji Fisher, Ph.D. <benji@member.AMS.org> | 
					
						
							| 
									
										
										
										
											2006-04-19 21:23:36 +00:00
										 |  |  | " Version:	1.4 | 
					
						
							|  |  |  | " Last Change:	Wed 19 Apr 2006 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | "  URL:		http://www.vim.org/script.php?script_id=411 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-03-24 22:21:52 +00:00
										 |  |  | " Only do this when not done yet for this buffer. | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | if exists("b:did_ftplugin") | 
					
						
							|  |  |  |   finish | 
					
						
							|  |  |  | endif | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-03-24 22:21:52 +00:00
										 |  |  | " Start with plain TeX.  This will also define b:did_ftplugin . | 
					
						
							|  |  |  | source $VIMRUNTIME/ftplugin/plaintex.vim | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-03-24 22:21:52 +00:00
										 |  |  | " Avoid problems if running in 'compatible' mode. | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | let s:save_cpo = &cpo | 
					
						
							|  |  |  | set cpo&vim | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-04-19 21:23:36 +00:00
										 |  |  | let b:undo_ftplugin .= "| setl inex<" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Allow "[d" to be used to find a macro definition: | 
					
						
							|  |  |  | " Recognize plain TeX \def as well as LaTeX \newcommand and \renewcommand . | 
					
						
							|  |  |  | " I may as well add the AMS-LaTeX DeclareMathOperator as well. | 
					
						
							| 
									
										
										
										
											2006-03-24 22:21:52 +00:00
										 |  |  | let &l:define .= '\|\\\(re\)\=new\(boolean\|command\|counter\|environment\|font' | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 	\ . '\|if\|length\|savebox\|theorem\(style\)\=\)\s*\*\=\s*{\=' | 
					
						
							|  |  |  | 	\ . '\|DeclareMathOperator\s*{\=\s*' | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Tell Vim how to recognize LaTeX \include{foo} and plain \input bar : | 
					
						
							| 
									
										
										
										
											2006-03-24 22:21:52 +00:00
										 |  |  | let &l:include .= '\|\\include{' | 
					
						
							| 
									
										
										
										
											2021-09-09 21:55:11 +02:00
										 |  |  | " On some file systems, "{" and "}" are included in 'isfname'.  In case the | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " TeX file has \include{fname} (LaTeX only), strip everything except "fname". | 
					
						
							|  |  |  | let &l:includeexpr = "substitute(v:fname, '^.\\{-}{\\|}.*', '', 'g')" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " The following lines enable the macros/matchit.vim plugin for | 
					
						
							|  |  |  | " extended matching with the % key. | 
					
						
							| 
									
										
										
										
											2006-03-24 22:21:52 +00:00
										 |  |  | " ftplugin/plaintex.vim already defines b:match_skip and b:match_ignorecase | 
					
						
							| 
									
										
										
										
											2006-04-19 21:23:36 +00:00
										 |  |  | " and matches \(, \), \[, \], \{, and \} . | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | if exists("loaded_matchit") | 
					
						
							| 
									
										
										
										
											2006-04-19 21:23:36 +00:00
										 |  |  |   let b:match_words .= ',\\begin\s*\({\a\+\*\=}\):\\end\s*\1' | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | endif " exists("loaded_matchit") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | let &cpo = s:save_cpo | 
					
						
							| 
									
										
										
										
											2012-03-11 15:57:40 +01:00
										 |  |  | unlet s:save_cpo | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " vim:sts=2:sw=2: |