Skip to content

Commit 5a9f7e6

Browse files
Freed-Wuchrisbra
authored andcommitted
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: #14505 Signed-off-by: Wu, Zhenyu <wuzhenyu@ustc.edu> Signed-off-by: Christian Brabandt <cb@256bit.org>
1 parent 0881329 commit 5a9f7e6

3 files changed

Lines changed: 21 additions & 3 deletions

File tree

runtime/filetype.vim

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1514,6 +1514,9 @@ au BufNewFile,BufRead Neomuttrc setf neomuttrc
15141514
" Netrc
15151515
au BufNewFile,BufRead .netrc setf netrc
15161516

1517+
" Neofetch
1518+
au BufNewFile,BufRead */neofetch/config.conf setf sh
1519+
15171520
" Nginx
15181521
au BufNewFile,BufRead *.nginx,nginx*.conf,*nginx.conf,*/etc/nginx/*,*/usr/local/nginx/conf/*,*/nginx/*.conf setf nginx
15191522

@@ -1604,16 +1607,20 @@ au BufNewFile,BufRead *.org,*.org_archive setf org
16041607
au BufNewFile,BufRead pf.conf setf pf
16051608

16061609
" ini style config files, using # comments
1607-
au BufNewFile,BufRead */etc/pacman.conf,mpv.conf setf confini
1610+
au BufNewFile,BufRead pacman.conf,mpv.conf setf confini
16081611
au BufNewFile,BufRead */.aws/config,*/.aws/credentials setf confini
16091612
au BufNewFile,BufRead *.nmconnection setf confini
1613+
au BufNewFile,BufRead paru.conf setf confini
16101614

16111615
" Pacman hooks
16121616
au BufNewFile,BufRead *.hook
16131617
\ if getline(1) == '[Trigger]' |
16141618
\ setf confini |
16151619
\ endif
16161620

1621+
" Pacman makepkg
1622+
au BufNewFile,BufRead {.,}makepkg.conf setf sh
1623+
16171624
" Pacman log
16181625
au BufNewFile,BufRead pacman.log setf pacmanlog
16191626

@@ -2640,12 +2647,18 @@ au BufNewFile,BufRead *.web
26402647
" Windows Scripting Host and Windows Script Component
26412648
au BufNewFile,BufRead *.ws[fc] setf wsh
26422649

2650+
" Xdg-user-dirs
2651+
au BufNewFile,BufRead user-dirs.dirs,user-dirs.defaults setf sh
2652+
26432653
" XHTML
26442654
au BufNewFile,BufRead *.xhtml,*.xht setf xhtml
26452655

26462656
" X11vnc
26472657
au BufNewFile,BufRead .x11vncrc setf conf
26482658

2659+
" Xprofile
2660+
au BufNewFile,BufRead .xprofile setf sh
2661+
26492662
" X Pixmap (dynamically sets colors, this used to trigger on BufEnter to make
26502663
" it work better, but that breaks setting 'filetype' manually)
26512664
au BufNewFile,BufRead *.xpm

src/testdir/test_filetype.vim

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ def s:GetFilenameChecks(): dict<list<string>>
164164
conaryrecipe: ['file.recipe'],
165165
conf: ['auto.master', 'file.conf', 'texdoc.cnf', '.x11vncrc', '.chktexrc', '.ripgreprc', 'ripgreprc', 'file.ctags'],
166166
config: ['configure.in', 'configure.ac', '/etc/hostname.file', 'any/etc/hostname.file'],
167-
confini: ['/etc/pacman.conf', 'any/etc/pacman.conf', 'mpv.conf', 'any/.aws/config', 'any/.aws/credentials', 'file.nmconnection'],
167+
confini: ['pacman.conf', 'paru.conf', 'mpv.conf', 'any/.aws/config', 'any/.aws/credentials', 'file.nmconnection'],
168168
context: ['tex/context/any/file.tex', 'file.mkii', 'file.mkiv', 'file.mkvi', 'file.mkxl', 'file.mklx'],
169169
cook: ['file.cook'],
170170
corn: ['file.corn'],
@@ -634,7 +634,10 @@ def s:GetFilenameChecks(): dict<list<string>>
634634
services: ['/etc/services', 'any/etc/services'],
635635
setserial: ['/etc/serial.conf', 'any/etc/serial.conf'],
636636
sexplib: ['file.sexp'],
637-
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'],
637+
sh: ['.bashrc', '.bash_profile', '.bash-profile', '.bash_logout', '.bash-logout', '.bash_aliases', '.bash-aliases', '.bash_history', '.bash-history',
638+
'/tmp/bash-fc-3Ozjlw', '/tmp/bash-fc.3Ozjlw', 'PKGBUILD', 'APKBUILD', 'file.bash', '/usr/share/doc/bash-completion/filter.sh',
639+
'/etc/udev/cdsymlinks.conf', 'any/etc/udev/cdsymlinks.conf', 'file.bats', '.ash_history', 'any/etc/neofetch/config.conf', '.xprofile',
640+
'user-dirs.defaults', 'user-dirs.dirs', 'makepkg.conf', '.makepkg.conf'],
638641
sieve: ['file.siv', 'file.sieve'],
639642
sil: ['file.sil'],
640643
simula: ['file.sim'],

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,8 @@ static char *(features[]) =
704704

705705
static int included_patches[] =
706706
{ /* Add new patch number below this line */
707+
/**/
708+
316,
707709
/**/
708710
315,
709711
/**/

0 commit comments

Comments
 (0)