vim-patch:9.1.2042: filetype: systemd quadlet files are not recognized (#37208)

Problem:  filetype: systemd quadlet files are not recognized
Solution: Detect additional patterns as systemd filetype
          (Ac5000)

Reference:
- https://docs.podman.io/en/latest/markdown/podman.1.html
- https://docs.podman.io/en/latest/markdown/podman-systemd.unit.5.html
- https://docs.podman.io/en/latest/markdown/podman-quadlet.1.html

fixes:  vim/vim#15078
closes: vim/vim#19057

0f93c988e9

Co-authored-by: Ac5000 <15003210+Ac5000@users.noreply.github.com>
This commit is contained in:
zeertzjq
2026-01-03 09:44:56 +08:00
committed by GitHub
parent 6deb1c1bf3
commit ca731d2e55
2 changed files with 55 additions and 1 deletions

View File

@@ -2107,6 +2107,24 @@ local pattern = {
['/etc/systemd/system/.*%.d/.*%.conf$'] = 'systemd',
['/etc/systemd/system/.*%.d/%.#'] = 'systemd',
['/etc/systemd/system/%.#'] = 'systemd',
['/etc/containers/systemd/users/.*/.*%.artifact$'] = 'systemd',
['/etc/containers/systemd/users/.*/.*%.build$'] = 'systemd',
['/etc/containers/systemd/users/.*/.*%.container$'] = 'systemd',
['/etc/containers/systemd/users/.*/.*%.image$'] = 'systemd',
['/etc/containers/systemd/users/.*/.*%.kube$'] = 'systemd',
['/etc/containers/systemd/users/.*/.*%.network$'] = 'systemd',
['/etc/containers/systemd/users/.*/.*%.pod$'] = 'systemd',
['/etc/containers/systemd/users/.*/.*%.volume$'] = 'systemd',
['/etc/containers/systemd/users/.*%.artifact$'] = 'systemd',
['/etc/containers/systemd/users/.*%.build$'] = 'systemd',
['/etc/containers/systemd/users/.*%.container$'] = 'systemd',
['/etc/containers/systemd/users/.*%.image$'] = 'systemd',
['/etc/containers/systemd/users/.*%.kube$'] = 'systemd',
['/etc/containers/systemd/users/.*%.network$'] = 'systemd',
['/etc/containers/systemd/users/.*%.pod$'] = 'systemd',
['/etc/containers/systemd/users/.*%.volume$'] = 'systemd',
['/etc/containers/systemd/users/.*/.*%.d/.*%.conf$'] = 'systemd',
['/etc/containers/systemd/users/.*%.d/.*%.conf$'] = 'systemd',
['/etc/config/'] = starsetf(detect.uci),
['/etc/udev/udev%.conf$'] = 'udevconf',
['/etc/udev/permissions%.d/.*%.permissions$'] = 'udevperm',
@@ -2357,6 +2375,14 @@ local pattern = {
['/%.config/systemd/user/%.#'] = 'systemd',
['/%.config/systemd/user/.*%.d/%.#'] = 'systemd',
['/%.config/systemd/user/.*%.d/.*%.conf$'] = 'systemd',
['/containers/systemd/.*%.artifact$'] = 'systemd',
['/containers/systemd/.*%.build$'] = 'systemd',
['/containers/systemd/.*%.container$'] = 'systemd',
['/containers/systemd/.*%.image$'] = 'systemd',
['/containers/systemd/.*%.kube$'] = 'systemd',
['/containers/systemd/.*%.network$'] = 'systemd',
['/containers/systemd/.*%.pod$'] = 'systemd',
['/containers/systemd/.*%.volume$'] = 'systemd',
['/systemd/.*%.automount$'] = 'systemd',
['/systemd/.*%.dnssd$'] = 'systemd',
['/systemd/.*%.link$'] = 'systemd',
@@ -2495,6 +2521,7 @@ local pattern = {
['/pipewire/.*%.conf$'] = 'spajson',
['/wireplumber/.*%.conf$'] = 'spajson',
['/%.ssh/.*%.conf$'] = 'sshconfig',
['/containers/systemd/.*%.d/.*%.conf$'] = 'systemd',
['^%.?tmux.*%.conf$'] = 'tmux',
['^%.?tmux.*%.conf'] = starsetf('tmux'),
['/containers/containers%.conf$'] = 'toml',

View File

@@ -829,7 +829,34 @@ func s:GetFilenameChecks() abort
\ 'any/etc/systemd/system/.#', 'any/etc/systemd/system/.#-file',
\ 'any/etc/systemd/system/file.d/.#',
\ 'any/etc/systemd/system/file.d/.#-file',
\ 'any/etc/systemd/system/file.d/file.conf'],
\ 'any/etc/systemd/system/file.d/file.conf',
\ 'any/containers/systemd/file.artifact',
\ 'any/containers/systemd/file.build',
\ 'any/containers/systemd/file.container',
\ 'any/containers/systemd/file.image',
\ 'any/containers/systemd/file.kube',
\ 'any/containers/systemd/file.network',
\ 'any/containers/systemd/file.pod',
\ 'any/containers/systemd/file.volume',
\ 'any/containers/systemd/users/any/file.artifact',
\ 'any/containers/systemd/users/any/file.build',
\ 'any/containers/systemd/users/any/file.container',
\ 'any/containers/systemd/users/any/file.image',
\ 'any/containers/systemd/users/any/file.kube',
\ 'any/containers/systemd/users/any/file.network',
\ 'any/containers/systemd/users/any/file.pod',
\ 'any/containers/systemd/users/any/file.volume',
\ 'any/containers/systemd/users/file.artifact',
\ 'any/containers/systemd/users/file.build',
\ 'any/containers/systemd/users/file.container',
\ 'any/containers/systemd/users/file.image',
\ 'any/containers/systemd/users/file.kube',
\ 'any/containers/systemd/users/file.network',
\ 'any/containers/systemd/users/file.pod',
\ 'any/containers/systemd/users/file.volume',
\ 'any/containers/systemd/some.d/file.conf',
\ 'etc/containers/systemd/users/1111/some.d/file.conf',
\ 'etc/containers/systemd/users/some.d/file.conf'],
\ 'systemverilog': ['file.sv', 'file.svh'],
\ 'tablegen': ['file.td'],
\ 'tags': ['tags'],