Bram Moolenaar | 8424a62 | 2006-04-19 21:23:36 +0000 | [diff] [blame] | 1 | " filetype plugin for TeX and variants |
| 2 | " Language: TeX (ft=initex) |
| 3 | " Maintainer: Benji Fisher, Ph.D. <benji@member.AMS.org> |
| 4 | " Version: 1.0 |
| 5 | " Last Change: Wed 19 Apr 2006 |
Riley Bruins | 0a08306 | 2024-06-03 20:40:45 +0200 | [diff] [blame] | 6 | " Last Change: Thu 23 May 2024 by Riley Bruins <ribru17@gmail.com> ('commentstring') |
Bram Moolenaar | 8424a62 | 2006-04-19 21:23:36 +0000 | [diff] [blame] | 7 | |
| 8 | " Only do this when not done yet for this buffer. |
| 9 | if exists("b:did_ftplugin") |
| 10 | finish |
| 11 | endif |
| 12 | |
| 13 | " Don't load another plugin for this buffer. |
| 14 | let b:did_ftplugin = 1 |
| 15 | |
| 16 | " Avoid problems if running in 'compatible' mode. |
| 17 | let s:save_cpo = &cpo |
| 18 | set cpo&vim |
| 19 | |
| 20 | let b:undo_ftplugin = "setl com< cms< define< include< sua<" |
| 21 | |
| 22 | " Set 'comments' to format dashed lists in comments |
| 23 | setlocal com=sO:%\ -,mO:%\ \ ,eO:%%,:% |
| 24 | |
| 25 | " Set 'commentstring' to recognize the % comment character: |
| 26 | " (Thanks to Ajit Thakkar.) |
Riley Bruins | 0a08306 | 2024-06-03 20:40:45 +0200 | [diff] [blame] | 27 | setlocal cms=%\ %s |
Bram Moolenaar | 8424a62 | 2006-04-19 21:23:36 +0000 | [diff] [blame] | 28 | |
| 29 | " Allow "[d" to be used to find a macro definition: |
| 30 | let &l:define='\\\([egx]\|char\|mathchar\|count\|dimen\|muskip\|skip\|toks\)\=' |
| 31 | \ . 'def\|\\font\|\\\(future\)\=let' |
| 32 | |
| 33 | " Tell Vim to recognize \input bar : |
| 34 | let &l:include = '\\input' |
| 35 | setlocal suffixesadd=.tex |
| 36 | |
| 37 | let &cpo = s:save_cpo |
Bram Moolenaar | 84f7235 | 2012-03-11 15:57:40 +0100 | [diff] [blame] | 38 | unlet s:save_cpo |
Bram Moolenaar | 8424a62 | 2006-04-19 21:23:36 +0000 | [diff] [blame] | 39 | |
| 40 | " vim:sts=2:sw=2: |