From c78e276881eb94aae749a6832c39bbc3622e4440 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 20 Feb 2026 09:16:41 +0800 Subject: [PATCH] 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 --- runtime/lua/vim/filetype.lua | 2 ++ test/old/testdir/test_filetype.vim | 1 + 2 files changed, 3 insertions(+) diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua index 8beafe608b..42b0a109f8 100644 --- 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 index 08159bef50..7beb3d3734 100644 --- 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'],