]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.2.0589: filetype: xinitrc files are not recognized v9.2.0589
authorEnrico Maria De Angelis <enricomaria.dean6elis@gmail.com>
Wed, 3 Jun 2026 18:03:56 +0000 (18:03 +0000)
committerChristian Brabandt <cb@256bit.org>
Wed, 3 Jun 2026 18:07:51 +0000 (18:07 +0000)
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>
runtime/filetype.vim
src/testdir/test_filetype.vim
src/version.c

index 3590ebe97c6dcdd6aece2539534069c434db300d..680b62b37abc742be9ac61d95d5545a5f2745cd4 100644 (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)
index 9dd8767fba074c13800af5f1c4ed37d17afe4960..30f803f2411e9baa063e1d6533a772d8991a8f91 100644 (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'],
index a7031b84b57c5b9bad3174382c69c47689c8bc6c..9b38c195f83eea4610e1bd80d40ccd56abf4c896 100644 (file)
@@ -729,6 +729,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    589,
 /**/
     588,
 /**/