mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
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)
35cff32dd8
This commit is contained in:
parent
6e6f5a7833
commit
1facad2347
@ -1283,13 +1283,13 @@ au BufNewFile,BufRead *.org,*.org_archive setf org
|
|||||||
" Packet filter conf
|
" Packet filter conf
|
||||||
au BufNewFile,BufRead pf.conf setf pf
|
au BufNewFile,BufRead pf.conf setf pf
|
||||||
|
|
||||||
" Pacman Config (close enough to dosini)
|
" Pacman config
|
||||||
au BufNewFile,BufRead */etc/pacman.conf setf dosini
|
au BufNewFile,BufRead */etc/pacman.conf setf conf
|
||||||
|
|
||||||
" Pacman hooks
|
" Pacman hooks
|
||||||
au BufNewFile,BufRead *.hook
|
au BufNewFile,BufRead *.hook
|
||||||
\ if getline(1) == '[Trigger]' |
|
\ if getline(1) == '[Trigger]' |
|
||||||
\ setf dosini |
|
\ setf conf |
|
||||||
\ endif
|
\ endif
|
||||||
|
|
||||||
" Pam conf
|
" Pam conf
|
||||||
|
@ -103,6 +103,11 @@ local extension = {
|
|||||||
cbl = "cobol",
|
cbl = "cobol",
|
||||||
atg = "coco",
|
atg = "coco",
|
||||||
recipe = "conaryrecipe",
|
recipe = "conaryrecipe",
|
||||||
|
hook = function(path, bufnr)
|
||||||
|
if getline(bufnr, 1) == '[Trigger]' then
|
||||||
|
return "conf"
|
||||||
|
end
|
||||||
|
end,
|
||||||
mklx = "context",
|
mklx = "context",
|
||||||
mkiv = "context",
|
mkiv = "context",
|
||||||
mkii = "context",
|
mkii = "context",
|
||||||
@ -903,7 +908,7 @@ local filename = {
|
|||||||
Dockerfile = "dockerfile",
|
Dockerfile = "dockerfile",
|
||||||
npmrc = "dosini",
|
npmrc = "dosini",
|
||||||
["/etc/yum.conf"] = "dosini",
|
["/etc/yum.conf"] = "dosini",
|
||||||
["/etc/pacman.conf"] = "dosini",
|
["/etc/pacman.conf"] = "conf",
|
||||||
[".npmrc"] = "dosini",
|
[".npmrc"] = "dosini",
|
||||||
[".editorconfig"] = "dosini",
|
[".editorconfig"] = "dosini",
|
||||||
dune = "dune",
|
dune = "dune",
|
||||||
@ -1182,7 +1187,7 @@ local pattern = {
|
|||||||
[".*/etc/DIR_COLORS"] = "dircolors",
|
[".*/etc/DIR_COLORS"] = "dircolors",
|
||||||
[".*/etc/dnsmasq%.conf"] = "dnsmasq",
|
[".*/etc/dnsmasq%.conf"] = "dnsmasq",
|
||||||
["php%.ini%-.*"] = "dosini",
|
["php%.ini%-.*"] = "dosini",
|
||||||
[".*/etc/pacman%.conf"] = "dosini",
|
[".*/etc/pacman%.conf"] = "conf",
|
||||||
[".*/etc/yum%.conf"] = "dosini",
|
[".*/etc/yum%.conf"] = "dosini",
|
||||||
[".*lvs"] = "dracula",
|
[".*lvs"] = "dracula",
|
||||||
[".*lpe"] = "dracula",
|
[".*lpe"] = "dracula",
|
||||||
|
@ -113,7 +113,7 @@ let s:filename_checks = {
|
|||||||
\ 'cobol': ['file.cbl', 'file.cob', 'file.lib'],
|
\ 'cobol': ['file.cbl', 'file.cob', 'file.lib'],
|
||||||
\ 'coco': ['file.atg'],
|
\ 'coco': ['file.atg'],
|
||||||
\ 'conaryrecipe': ['file.recipe'],
|
\ 'conaryrecipe': ['file.recipe'],
|
||||||
\ 'conf': ['auto.master'],
|
\ 'conf': ['/etc/pacman.conf', 'any/etc/pacman.conf', 'auto.master'],
|
||||||
\ 'config': ['configure.in', 'configure.ac', '/etc/hostname.file'],
|
\ 'config': ['configure.in', 'configure.ac', '/etc/hostname.file'],
|
||||||
\ 'context': ['tex/context/any/file.tex', 'file.mkii', 'file.mkiv', 'file.mkvi', 'file.mkxl', 'file.mklx'],
|
\ 'context': ['tex/context/any/file.tex', 'file.mkii', 'file.mkiv', 'file.mkvi', 'file.mkxl', 'file.mklx'],
|
||||||
\ 'cook': ['file.cook'],
|
\ 'cook': ['file.cook'],
|
||||||
@ -152,7 +152,7 @@ let s:filename_checks = {
|
|||||||
\ 'dnsmasq': ['/etc/dnsmasq.conf', '/etc/dnsmasq.d/file', 'any/etc/dnsmasq.conf', 'any/etc/dnsmasq.d/file'],
|
\ 'dnsmasq': ['/etc/dnsmasq.conf', '/etc/dnsmasq.d/file', 'any/etc/dnsmasq.conf', 'any/etc/dnsmasq.d/file'],
|
||||||
\ 'dockerfile': ['Containerfile', 'Dockerfile', 'file.Dockerfile', 'Dockerfile.debian', 'Containerfile.something'],
|
\ 'dockerfile': ['Containerfile', 'Dockerfile', 'file.Dockerfile', 'Dockerfile.debian', 'Containerfile.something'],
|
||||||
\ 'dosbatch': ['file.bat'],
|
\ 'dosbatch': ['file.bat'],
|
||||||
\ 'dosini': ['.editorconfig', '/etc/pacman.conf', '/etc/yum.conf', 'file.ini', 'npmrc', '.npmrc', 'php.ini', 'php.ini-5', 'php.ini-file', '/etc/yum.repos.d/file', 'any/etc/pacman.conf', 'any/etc/yum.conf', 'any/etc/yum.repos.d/file', 'file.wrap'],
|
\ 'dosini': ['.editorconfig', '/etc/yum.conf', 'file.ini', 'npmrc', '.npmrc', 'php.ini', 'php.ini-5', 'php.ini-file', '/etc/yum.repos.d/file', 'any/etc/yum.conf', 'any/etc/yum.repos.d/file', 'file.wrap'],
|
||||||
\ 'dot': ['file.dot', 'file.gv'],
|
\ 'dot': ['file.dot', 'file.gv'],
|
||||||
\ 'dracula': ['file.drac', 'file.drc', 'filelvs', 'filelpe', 'drac.file', 'lpe', 'lvs', 'some-lpe', 'some-lvs'],
|
\ 'dracula': ['file.drac', 'file.drc', 'filelvs', 'filelpe', 'drac.file', 'lpe', 'lvs', 'some-lpe', 'some-lvs'],
|
||||||
\ 'dtd': ['file.dtd'],
|
\ 'dtd': ['file.dtd'],
|
||||||
@ -1172,12 +1172,12 @@ func Test_hook_file()
|
|||||||
|
|
||||||
call writefile(['[Trigger]', 'this is pacman config'], 'Xfile.hook')
|
call writefile(['[Trigger]', 'this is pacman config'], 'Xfile.hook')
|
||||||
split Xfile.hook
|
split Xfile.hook
|
||||||
call assert_equal('dosini', &filetype)
|
call assert_equal('conf', &filetype)
|
||||||
bwipe!
|
bwipe!
|
||||||
|
|
||||||
call writefile(['not pacman'], 'Xfile.hook')
|
call writefile(['not pacman'], 'Xfile.hook')
|
||||||
split Xfile.hook
|
split Xfile.hook
|
||||||
call assert_notequal('dosini', &filetype)
|
call assert_notequal('conf', &filetype)
|
||||||
bwipe!
|
bwipe!
|
||||||
|
|
||||||
call delete('Xfile.hook')
|
call delete('Xfile.hook')
|
||||||
|
Loading…
Reference in New Issue
Block a user