forked from aniani/vim
patch 9.1.0315: filetype: a few more dosini files are not recognized
Problem: filetype: a few more dosini files are not recognized Solution: Detect wakatime, reply config files, flatpak, nfs config files and a few more python tools as dosini (or toml) (Wu, Zhenyu) Refer: - https://packaging.python.org/en/latest/specifications/pypirc/ - https://jorisroovers.com/gitlint/latest/configuration/ - https://pylint.pycqa.org/en/latest/user_guide/usage/run.html#command-line-options - https://docs.bpython-interpreter.org/en/latest/configuration.html - https://mypy.readthedocs.io/en/stable/config_file.html#the-mypy-configuration-file - https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html#configuration-via-a-file - https://github.com/wakatime/wakatime-cli?tab=readme-ov-file#usage - https://metacpan.org/dist/Reply/view/bin/reply#-cfg-~/.replyrc close: #14512 Signed-off-by: Wu, Zhenyu <wuzhenyu@ustc.edu> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
5392970921
commit
0881329d12
@@ -546,9 +546,18 @@ au BufNewFile,BufRead m3makefile,m3overrides setf m3build
|
|||||||
" XDG mimeapps.list
|
" XDG mimeapps.list
|
||||||
au BufNewFile,BufRead mimeapps.list setf dosini
|
au BufNewFile,BufRead mimeapps.list setf dosini
|
||||||
|
|
||||||
" Many Python tools use dosini as their config, like pip, setuptools, pudb, coverage
|
" Many tools written in Python use dosini as their config
|
||||||
|
" like setuptools, pudb, coverage, pypi, gitlint, oelint-adv, pylint, bpython, mypy
|
||||||
" (must be before *.cfg)
|
" (must be before *.cfg)
|
||||||
au BufNewFile,BufRead pip.conf,setup.cfg,pudb.cfg,.coveragerc setf dosini
|
au BufNewFile,BufRead pip.conf,setup.cfg,pudb.cfg,.coveragerc,.pypirc,.gitlint,.oelint.cfg setf dosini
|
||||||
|
au BufNewFile,BufRead {.,}pylintrc,*/bpython/config,*/mypy/config setf dosini
|
||||||
|
|
||||||
|
" Many tools written in Python use toml as their config, like black
|
||||||
|
au BufNewFile,BufRead .black setf toml
|
||||||
|
au BufNewFile,BufRead black
|
||||||
|
\ if getline(1) =~ 'tool.back'
|
||||||
|
\| setf toml
|
||||||
|
\| endif
|
||||||
|
|
||||||
" LXQt's programs use dosini as their config
|
" LXQt's programs use dosini as their config
|
||||||
au BufNewFile,BufRead */{lxqt,screengrab}/*.conf setf dosini
|
au BufNewFile,BufRead */{lxqt,screengrab}/*.conf setf dosini
|
||||||
@@ -565,6 +574,9 @@ au BufNewFile,BufRead *.qc setf c
|
|||||||
" ~/.texlive/texmf-config/tex/latex/docstrip/docstrip.cfg
|
" ~/.texlive/texmf-config/tex/latex/docstrip/docstrip.cfg
|
||||||
au BufNewFile,BufRead */tex/latex/**.cfg setf tex
|
au BufNewFile,BufRead */tex/latex/**.cfg setf tex
|
||||||
|
|
||||||
|
" Wakatime config
|
||||||
|
au BufNewFile,BufRead .wakatime.cfg setf dosini
|
||||||
|
|
||||||
" Configure files
|
" Configure files
|
||||||
au BufNewFile,BufRead *.cfg\c call dist#ft#FTcfg()
|
au BufNewFile,BufRead *.cfg\c call dist#ft#FTcfg()
|
||||||
|
|
||||||
@@ -777,6 +789,9 @@ au BufNewFile,BufRead *.fir setf firrtl
|
|||||||
" Fish shell
|
" Fish shell
|
||||||
au BufNewFile,BufRead *.fish setf fish
|
au BufNewFile,BufRead *.fish setf fish
|
||||||
|
|
||||||
|
" Flatpak config
|
||||||
|
au BufNewFile,BufRead */flatpak/repo/config setf dosini
|
||||||
|
|
||||||
" FlexWiki - disabled, because it has side effects when a .wiki file
|
" FlexWiki - disabled, because it has side effects when a .wiki file
|
||||||
" is not actually FlexWiki
|
" is not actually FlexWiki
|
||||||
"au BufNewFile,BufRead *.wiki setf flexwiki
|
"au BufNewFile,BufRead *.wiki setf flexwiki
|
||||||
@@ -1654,6 +1669,9 @@ else
|
|||||||
endif
|
endif
|
||||||
au BufNewFile,BufRead *.plx,*.al,*.psgi setf perl
|
au BufNewFile,BufRead *.plx,*.al,*.psgi setf perl
|
||||||
|
|
||||||
|
" Perl Reply
|
||||||
|
au BufNewFile,BufRead .replyrc setf dosini
|
||||||
|
|
||||||
" Perl, XPM or XPM2
|
" Perl, XPM or XPM2
|
||||||
au BufNewFile,BufRead *.pm
|
au BufNewFile,BufRead *.pm
|
||||||
\ if getline(1) =~ "XPM2" |
|
\ if getline(1) =~ "XPM2" |
|
||||||
@@ -2925,6 +2943,9 @@ au BufNewFile,BufRead mutt{ng,}rc*,Mutt{ng,}rc* call s:StarSetf('muttrc')
|
|||||||
au BufNewFile,BufRead .neomuttrc*,*/.neomutt/neomuttrc* call s:StarSetf('neomuttrc')
|
au BufNewFile,BufRead .neomuttrc*,*/.neomutt/neomuttrc* call s:StarSetf('neomuttrc')
|
||||||
au BufNewFile,BufRead neomuttrc*,Neomuttrc* call s:StarSetf('neomuttrc')
|
au BufNewFile,BufRead neomuttrc*,Neomuttrc* call s:StarSetf('neomuttrc')
|
||||||
|
|
||||||
|
" Nfs
|
||||||
|
au BufNewFile,BufRead nfs.conf,nfsmount.conf setf dosini
|
||||||
|
|
||||||
" Nroff macros
|
" Nroff macros
|
||||||
au BufNewFile,BufRead tmac.* call s:StarSetf('nroff')
|
au BufNewFile,BufRead tmac.* call s:StarSetf('nroff')
|
||||||
|
|
||||||
|
@@ -212,7 +212,14 @@ def s:GetFilenameChecks(): dict<list<string>>
|
|||||||
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', 'dockerfile', 'file.Dockerfile', 'file.dockerfile', 'Dockerfile.debian', 'Containerfile.something'],
|
dockerfile: ['Containerfile', 'Dockerfile', 'dockerfile', 'file.Dockerfile', 'file.dockerfile', 'Dockerfile.debian', 'Containerfile.something'],
|
||||||
dosbatch: ['file.bat'],
|
dosbatch: ['file.bat'],
|
||||||
dosini: ['/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', 'file.vbp', 'ja2.ini', 'JA2.INI', 'mimeapps.list', 'pip.conf', 'setup.cfg', 'pudb.cfg', '.coveragerc', 'psprint.conf', 'sofficerc', 'any/.config/lxqt/globalkeyshortcuts.conf', 'any/.config/screengrab/screengrab.conf'],
|
dosini: ['/etc/yum.conf', '/etc/nfs.conf', '/etc/nfsmount.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',
|
||||||
|
'file.vbp', 'ja2.ini', 'JA2.INI', 'mimeapps.list', 'pip.conf', 'setup.cfg', 'pudb.cfg',
|
||||||
|
'.coveragerc', '.pypirc', '.gitlint', '.oelint.cfg', 'pylintrc', '.pylintrc',
|
||||||
|
'/home/user/.config/bpython/config', '/home/user/.config/mypy/config', '.wakatime.cfg', '.replyrc',
|
||||||
|
'psprint.conf', 'sofficerc', 'any/.config/lxqt/globalkeyshortcuts.conf', 'any/.config/screengrab/screengrab.conf',
|
||||||
|
'any/.local/share/flatpak/repo/config'],
|
||||||
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'],
|
||||||
@@ -748,7 +755,7 @@ def s:GetFilenameChecks(): dict<list<string>>
|
|||||||
tla: ['file.tla'],
|
tla: ['file.tla'],
|
||||||
tli: ['file.tli'],
|
tli: ['file.tli'],
|
||||||
tmux: ['tmuxfile.conf', '.tmuxfile.conf', '.tmux-file.conf', '.tmux.conf', 'tmux-file.conf', 'tmux.conf', 'tmux.conf.local'],
|
tmux: ['tmuxfile.conf', '.tmuxfile.conf', '.tmux-file.conf', '.tmux.conf', 'tmux-file.conf', 'tmux.conf', 'tmux.conf.local'],
|
||||||
toml: ['file.toml', 'Gopkg.lock', 'Pipfile', '/home/user/.cargo/config'],
|
toml: ['file.toml', 'Gopkg.lock', 'Pipfile', '/home/user/.cargo/config', '.black'],
|
||||||
tpp: ['file.tpp'],
|
tpp: ['file.tpp'],
|
||||||
treetop: ['file.treetop'],
|
treetop: ['file.treetop'],
|
||||||
trustees: ['trustees.conf'],
|
trustees: ['trustees.conf'],
|
||||||
|
@@ -704,6 +704,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
315,
|
||||||
/**/
|
/**/
|
||||||
314,
|
314,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user