patch 9.2.0589: filetype: xinitrc files are not recognized

Problem:  filetype: xinitrc files are not recognized
Solution: Detect xinitrc and xserverrc files as sh filetype
          (Enrico Maria De Angelis)

Reference:
https://wiki.archlinux.org/title/Xinit#Configuration

closes: #20419

Signed-off-by: Enrico Maria De Angelis <enricomaria.dean6elis@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Enrico Maria De Angelis
2026-06-03 18:03:56 +00:00
committed by Christian Brabandt
parent dec5b3a72a
commit 5b76ddcc52
3 changed files with 5 additions and 2 deletions
+2 -1
View File
@@ -1,7 +1,7 @@
" Vim support file to detect file types
"
" Maintainer: The Vim Project <https://github.com/vim/vim>
" Last Change: 2026 May 29
" Last Change: 2026 Jun 03
" Former Maintainer: Bram Moolenaar <Bram@vim.org>
" If the filetype can be detected from extension or file name(the final path component),
@@ -1038,6 +1038,7 @@ au BufNewFile,BufRead *.decl,*.dcl,*.dec
" Gentoo ebuilds and Arch Linux PKGBUILDs are actually bash scripts.
" NOTE: Patterns ending in a star are further down, these have lower priority.
au BufNewFile,BufRead .bashrc,bashrc,bash.bashrc,.bash[_-]profile,.bash[_-]logout,.bash[_-]aliases,.bash[_-]history,bash-fc[-.],*.ebuild,*.bash,*.eclass,PKGBUILD,*.bats,*.cygport call dist#ft#SetFileTypeSH("bash")
au BufNewFile,BufRead ~/.x{init,server}rc,/etc/X11/xinit/x{initrc{,.d/*},serverrc} setf sh
au BufNewFile,BufRead .kshrc,*.ksh call dist#ft#SetFileTypeSH("ksh")
au BufNewFile,BufRead */etc/profile,.profile,*.sh,*.envrc,.envrc.* call dist#ft#SetFileTypeSH(getline(1))
" Shell script (Arch Linux) or PHP file (Drupal)
+1 -1
View File
@@ -746,7 +746,7 @@ def s:GetFilenameChecks(): dict<list<string>>
'/tmp/bash-fc-3Ozjlw', '/tmp/bash-fc.3Ozjlw', 'PKGBUILD', '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', 'file.mdd', 'file.cygport', '.envrc', '.envrc.file', 'file.envrc', 'devscripts.conf',
'.devscripts', 'file.lo', 'file.la', 'file.lai'],
'.devscripts', 'file.lo', 'file.la', 'file.lai', '/etc/X11/xinit/xinitrc', '/etc/X11/xinit/xserverrc', '~/.xinitrc', '/etc/X11/xinit/xinitrc.d/foobar'],
shaderslang: ['file.slang'],
sieve: ['file.siv', 'file.sieve'],
sil: ['file.sil'],
+2
View File
@@ -729,6 +729,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
589,
/**/
588,
/**/