patch 9.2.0589: filetype: xinitrc files are not recognized
Commit:
https://github.com/vim/vim/commit/5b76ddcc5220603b9c062d3e230faad9b0aed0d2
Author: Enrico Maria De Angelis <[email protected]>
Date: Wed Jun 3 18:03:56 2026 +0000
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 <[email protected]>
Signed-off-by: Christian Brabandt <[email protected]>
diff --git a/runtime/filetype.vim b/runtime/filetype.vim
index 3590ebe97..680b62b37 100644
--- a/runtime/filetype.vim
+++ b/runtime/filetype.vim
@@ -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 <[email protected]>
" 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)
diff --git a/src/testdir/test_filetype.vim b/src/testdir/test_filetype.vim
index 9dd8767fb..30f803f24 100644
--- a/src/testdir/test_filetype.vim
+++ b/src/testdir/test_filetype.vim
@@ -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'],
diff --git a/src/version.c b/src/version.c
index a7031b84b..9b38c195f 100644
--- a/src/version.c
+++ b/src/version.c
@@ -729,6 +729,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 589,
/**/
588,
/**/
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/vim_dev/E1wUq7L-003ofU-N0%40256bit.org.