vim-patch:9.1.0316: filetype: some sh and confini files not recognized

Problem:  filetype: some sh and confini files not recognized
Solution: Detect neofetch, '.xprofile', XDG-User-Dirs files,
          paru and makepkg config files
          (Wu, Zhenyu)

See:
- https://github.com/dylanaraps/neofetch/wiki/Customizing-Info#config-file-location
- https://www.freedesktop.org/wiki/Software/xdg-user-dirs/

closes: vim/vim#14505

5a9f7e6750

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
This commit is contained in:
Christian Clason 2024-04-13 18:42:10 +02:00
parent 420f130223
commit 737091d234
2 changed files with 13 additions and 4 deletions

View File

@ -1350,7 +1350,8 @@ local filename = {
['.wakatime.cfg'] = 'dosini',
['nfs.conf'] = 'dosini',
['nfsmount.conf'] = 'dosini',
['/etc/pacman.conf'] = 'confini',
['pacman.conf'] = 'confini',
['paru.conf'] = 'confini',
['mpv.conf'] = 'confini',
dune = 'dune',
jbuild = 'dune',
@ -1568,6 +1569,11 @@ local filename = {
['/etc/serial.conf'] = 'setserial',
['/etc/udev/cdsymlinks.conf'] = 'sh',
['.ash_history'] = 'sh',
['makepkg.conf'] = 'sh',
['.makepkg.conf'] = 'sh',
['user-dirs.dirs'] = 'sh',
['user-dirs.defaults'] = 'sh',
['.xprofile'] = 'sh',
['bash.bashrc'] = detect.bash,
bashrc = detect.bash,
['.bashrc'] = detect.bash,
@ -1765,7 +1771,6 @@ local pattern = {
['php%.ini%-.*'] = 'dosini',
['.*/%.aws/config'] = 'confini',
['.*/%.aws/credentials'] = 'confini',
['.*/etc/pacman%.conf'] = 'confini',
['.*/etc/yum%.conf'] = 'dosini',
['.*/lxqt/.*%.conf'] = 'dosini',
['.*/screengrab/.*%.conf'] = 'dosini',
@ -2047,6 +2052,7 @@ local pattern = {
['.*/etc/services'] = 'services',
['.*/etc/serial%.conf'] = 'setserial',
['.*/etc/udev/cdsymlinks%.conf'] = 'sh',
['.*/neofetch/config%.conf'] = 'sh',
['%.bash[_%-]aliases'] = detect.bash,
['%.bash[_%-]history'] = detect.bash,
['%.bash[_%-]logout'] = detect.bash,

View File

@ -165,7 +165,7 @@ func s:GetFilenameChecks() abort
\ 'conaryrecipe': ['file.recipe'],
\ 'conf': ['auto.master', 'file.conf', 'texdoc.cnf', '.x11vncrc', '.chktexrc', '.ripgreprc', 'ripgreprc', 'file.ctags'],
\ 'config': ['configure.in', 'configure.ac', '/etc/hostname.file', 'any/etc/hostname.file'],
\ 'confini': ['/etc/pacman.conf', 'any/etc/pacman.conf', 'mpv.conf', 'any/.aws/config', 'any/.aws/credentials', 'file.nmconnection'],
\ 'confini': ['pacman.conf', 'paru.conf', 'mpv.conf', 'any/.aws/config', 'any/.aws/credentials', 'file.nmconnection'],
\ 'context': ['tex/context/any/file.tex', 'file.mkii', 'file.mkiv', 'file.mkvi', 'file.mkxl', 'file.mklx'],
\ 'cook': ['file.cook'],
\ 'corn': ['file.corn'],
@ -635,7 +635,10 @@ func s:GetFilenameChecks() abort
\ 'services': ['/etc/services', 'any/etc/services'],
\ 'setserial': ['/etc/serial.conf', 'any/etc/serial.conf'],
\ 'sexplib': ['file.sexp'],
\ 'sh': ['.bashrc', '.bash_profile', '.bash-profile', '.bash_logout', '.bash-logout', '.bash_aliases', '.bash-aliases', '.bash_history', '.bash-history', '/tmp/bash-fc-3Ozjlw', '/tmp/bash-fc.3Ozjlw', 'PKGBUILD', 'APKBUILD', 'file.bash', '/usr/share/doc/bash-completion/filter.sh', '/etc/udev/cdsymlinks.conf', 'any/etc/udev/cdsymlinks.conf', 'file.bats', '.ash_history'],
\ 'sh': ['.bashrc', '.bash_profile', '.bash-profile', '.bash_logout', '.bash-logout', '.bash_aliases', '.bash-aliases', '.bash_history', '.bash-history',
\ '/tmp/bash-fc-3Ozjlw', '/tmp/bash-fc.3Ozjlw', 'PKGBUILD', 'APKBUILD', 'file.bash', '/usr/share/doc/bash-completion/filter.sh',
\ '/etc/udev/cdsymlinks.conf', 'any/etc/udev/cdsymlinks.conf', 'file.bats', '.ash_history', 'any/etc/neofetch/config.conf', '.xprofile',
\ 'user-dirs.defaults', 'user-dirs.dirs', 'makepkg.conf', '.makepkg.conf'],
\ 'sieve': ['file.siv', 'file.sieve'],
\ 'sil': ['file.sil'],
\ 'simula': ['file.sim'],