aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Clason <c.clason@uni-graz.at>2024-04-13 18:42:10 +0200
committerChristian Clason <c.clason@uni-graz.at>2024-04-14 13:21:10 +0200
commit737091d234b510ca71d991936ccf96c07d93a167 (patch)
tree65bab3e0b49900a169d15503c001f7a7eaa03098
parent420f130223314805eac356d03eab98ff94961686 (diff)
downloadrneovim-737091d234b510ca71d991936ccf96c07d93a167.tar.gz
rneovim-737091d234b510ca71d991936ccf96c07d93a167.tar.bz2
rneovim-737091d234b510ca71d991936ccf96c07d93a167.zip
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 https://github.com/vim/vim/commit/5a9f7e6750727f81d0638e7ce0ee6bcb01742570 Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
-rw-r--r--runtime/lua/vim/filetype.lua10
-rw-r--r--test/old/testdir/test_filetype.vim7
2 files changed, 13 insertions, 4 deletions
diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua
index 583839e28d..76250626da 100644
--- a/runtime/lua/vim/filetype.lua
+++ b/runtime/lua/vim/filetype.lua
@@ -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,
diff --git a/test/old/testdir/test_filetype.vim b/test/old/testdir/test_filetype.vim
index 19f8ce93e4..09efc25ed3 100644
--- a/test/old/testdir/test_filetype.vim
+++ b/test/old/testdir/test_filetype.vim
@@ -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'],