commit c78e276881eb94aae749a6832c39bbc3622e4440
parent 8c22ba8b798ee054bc209763a82d99bcbc259335
Author: zeertzjq <zeertzjq@outlook.com>
Date: Fri, 20 Feb 2026 09:16:41 +0800
vim-patch:9.2.0027: filetype: yara files are not recognized
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: vim/vim#19460
https://github.com/vim/vim/commit/7d93ae57f0dc9da7eee8d582dd0d5a22922ffed8
Co-authored-by: Thomas Dupuy <thom4s.d@gmail.com>
Diffstat:
2 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua
@@ -1433,6 +1433,8 @@ local extension = {
kyml = 'yaml',
grc = detect_line1('<%?xml', 'xml', 'yaml'),
yang = 'yang',
+ yara = 'yara',
+ yar = 'yara',
yuck = 'yuck',
z8a = 'z8a',
zig = 'zig',
diff --git a/test/old/testdir/test_filetype.vim b/test/old/testdir/test_filetype.vim
@@ -984,6 +984,7 @@ func s:GetFilenameChecks() abort
\ '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'],