From 1facad23473eb2d045fe77199b3b0b9fd2586895 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sun, 17 Apr 2022 23:30:13 +0200 Subject: vim-patch:8.2.4778: pacman files use dosini filetype (#18152) Problem: Pacman files use dosini filetype. Solution: Use conf instead. (Chaoren Lin, closes vim/vim#10213) https://github.com/vim/vim/commit/35cff32dd82e5e2b72453b9f27d0655fc5b8a639 --- runtime/filetype.vim | 6 +++--- runtime/lua/vim/filetype.lua | 9 +++++++-- 2 files changed, 10 insertions(+), 5 deletions(-) (limited to 'runtime') diff --git a/runtime/filetype.vim b/runtime/filetype.vim index b6c183e712..5e73374649 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -1283,13 +1283,13 @@ au BufNewFile,BufRead *.org,*.org_archive setf org " Packet filter conf au BufNewFile,BufRead pf.conf setf pf -" Pacman Config (close enough to dosini) -au BufNewFile,BufRead */etc/pacman.conf setf dosini +" Pacman config +au BufNewFile,BufRead */etc/pacman.conf setf conf " Pacman hooks au BufNewFile,BufRead *.hook \ if getline(1) == '[Trigger]' | - \ setf dosini | + \ setf conf | \ endif " Pam conf diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua index 27a3366e0f..d8d4afb6c2 100644 --- a/runtime/lua/vim/filetype.lua +++ b/runtime/lua/vim/filetype.lua @@ -103,6 +103,11 @@ local extension = { cbl = "cobol", atg = "coco", recipe = "conaryrecipe", + hook = function(path, bufnr) + if getline(bufnr, 1) == '[Trigger]' then + return "conf" + end + end, mklx = "context", mkiv = "context", mkii = "context", @@ -903,7 +908,7 @@ local filename = { Dockerfile = "dockerfile", npmrc = "dosini", ["/etc/yum.conf"] = "dosini", - ["/etc/pacman.conf"] = "dosini", + ["/etc/pacman.conf"] = "conf", [".npmrc"] = "dosini", [".editorconfig"] = "dosini", dune = "dune", @@ -1182,7 +1187,7 @@ local pattern = { [".*/etc/DIR_COLORS"] = "dircolors", [".*/etc/dnsmasq%.conf"] = "dnsmasq", ["php%.ini%-.*"] = "dosini", - [".*/etc/pacman%.conf"] = "dosini", + [".*/etc/pacman%.conf"] = "conf", [".*/etc/yum%.conf"] = "dosini", [".*lvs"] = "dracula", [".*lpe"] = "dracula", -- cgit