]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.2.0027: filetype: yara files are not recognized v9.2.0027
authorThomas Dupuy <thom4s.d@gmail.com>
Thu, 19 Feb 2026 16:12:06 +0000 (16:12 +0000)
committerChristian Brabandt <cb@256bit.org>
Thu, 19 Feb 2026 16:12:06 +0000 (16:12 +0000)
Problem:  filetype: yara files are not recognized
Solution: Detect *.yara and *.yar files as yara filetype
          (Thomas Dupuy).

Reference:
- https://github.com/VirusTotal/yara
- https://github.com/VirusTotal/yara-x

closes: #19460

Signed-off-by: Thomas Dupuy <thom4s.d@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/autoload/dist/ft.vim
src/testdir/test_filetype.vim
src/version.c

index d5bd636bde0450339a318ce31ecbd8103d3e99ec..30f3c1460800f0514fb16ab2d14f93e23e13b6e7 100644 (file)
@@ -3,7 +3,7 @@ vim9script
 # Vim functions for file type detection
 #
 # Maintainer:          The Vim Project <https://github.com/vim/vim>
-# Last Change:         2026 Feb 18
+# Last Change:         2026 Feb 19
 # Former Maintainer:   Bram Moolenaar <Bram@vim.org>
 
 # These functions are moved here from runtime/filetype.vim to make startup
@@ -3017,6 +3017,9 @@ const ft_from_ext = {
   "raml": "raml",
   # YANG
   "yang": "yang",
+  # YARA, YARA-X
+  "yara": "yara",
+  "yar": "yara",
   # Yuck
   "yuck": "yuck",
   # Zimbu
index 82caa2baf3fb451612ecef2395aaad590aaca07a..8da2b8f8ac4cf269befe21ed68cbb549434be125 100644 (file)
@@ -987,6 +987,7 @@ def s:GetFilenameChecks(): dict<list<string>>
     yaml: ['file.yaml', 'file.yml', 'file.eyaml', 'file.kyaml', 'file.kyml', 'any/.bundle/config', '.clangd', '.clang-format', '.clang-tidy', 'file.mplstyle', 'matplotlibrc', 'yarn.lock',
            '/home/user/.kube/config', '/home/user/.kube/kuberc', '.condarc', 'condarc', '.mambarc', 'mambarc', 'pixi.lock'],
     yang: ['file.yang'],
+    yara: ['file.yara', 'file.yar'],
     yuck: ['file.yuck'],
     z8a: ['file.z8a'],
     zathurarc: ['zathurarc'],
index 2a85c543d4af3e8878f9b289db1c621909b6651c..4744ccf220fb367860f13db945d8a264c34729a5 100644 (file)
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    27,
 /**/
     26,
 /**/