Package: vim / 2:8.0.0197-4+deb9u1

debian/Add-recognition-of-more-LaTeX-commands-for-tex-filetype-d.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
From: Stefano Zacchiroli <zack@debian.org>
Date: Fri, 25 Aug 2006 13:33:04 +0200
Subject: Add recognition of more LaTeX commands for tex filetype detection

Since filetype detection of TeX files defaults to plaintex, we've added
detection of some additional LaTeX commands to help sway the detection
to LaTeX.

Closes: #384479
Signed-off-by: James McCoy <jamessan@debian.org>
---
 runtime/filetype.vim | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/runtime/filetype.vim b/runtime/filetype.vim
index 9c9c808..13e2c04 100644
--- a/runtime/filetype.vim
+++ b/runtime/filetype.vim
@@ -2227,7 +2227,7 @@ func! s:FTtex()
     call cursor(1,1)
     let firstNC = search('^\s*[^[:space:]%]', 'c', 1000)
     if firstNC " Check the next thousand lines for a LaTeX or ConTeXt keyword.
-      let lpat = 'documentclass\>\|usepackage\>\|begin{\|newcommand\>\|renewcommand\>'
+      let lpat = 'documentclass\>\|usepackage\>\|begin{\|newcommand\>\|renewcommand\>\|part\>\|chapter\>\|section\>\|subsection\>\|subsubsection\>\|paragraph\>\|subparagraph\>\|subsubparagraph'
       let cpat = 'start\a\+\|setup\a\+\|usemodule\|enablemode\|enableregime\|setvariables\|useencoding\|usesymbols\|stelle\a\+\|verwende\a\+\|stel\a\+\|gebruik\a\+\|usa\a\+\|imposta\a\+\|regle\a\+\|utilisemodule\>'
       let kwline = search('^\s*\\\%(' . lpat . '\)\|^\s*\\\(' . cpat . '\)',
 			      \ 'cnp', firstNC + 1000)