comparison runtime/filetype.vim @ 34910:4973939ca651 v9.1.0315

patch 9.1.0315: filetype: a few more dosini files are not recognized Commit: https://github.com/vim/vim/commit/0881329d129866fa49444e7fb6e622e54285a8ff Author: Wu, Zhenyu <wuzhenyu@ustc.edu> Date: Sat Apr 13 18:13:42 2024 +0200 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>
author Christian Brabandt <cb@256bit.org>
date Sat, 13 Apr 2024 18:30:03 +0200
parents 8ca8c94914e3
children e1670b4b1466
comparison
equal deleted inserted replaced
34909:5599fba31c2b 34910:4973939ca651
544 au BufNewFile,BufRead m3makefile,m3overrides setf m3build 544 au BufNewFile,BufRead m3makefile,m3overrides setf m3build
545 545
546 " XDG mimeapps.list 546 " XDG mimeapps.list
547 au BufNewFile,BufRead mimeapps.list setf dosini 547 au BufNewFile,BufRead mimeapps.list setf dosini
548 548
549 " Many Python tools use dosini as their config, like pip, setuptools, pudb, coverage 549 " Many tools written in Python use dosini as their config
550 " like setuptools, pudb, coverage, pypi, gitlint, oelint-adv, pylint, bpython, mypy
550 " (must be before *.cfg) 551 " (must be before *.cfg)
551 au BufNewFile,BufRead pip.conf,setup.cfg,pudb.cfg,.coveragerc setf dosini 552 au BufNewFile,BufRead pip.conf,setup.cfg,pudb.cfg,.coveragerc,.pypirc,.gitlint,.oelint.cfg setf dosini
553 au BufNewFile,BufRead {.,}pylintrc,*/bpython/config,*/mypy/config setf dosini
554
555 " Many tools written in Python use toml as their config, like black
556 au BufNewFile,BufRead .black setf toml
557 au BufNewFile,BufRead black
558 \ if getline(1) =~ 'tool.back'
559 \| setf toml
560 \| endif
552 561
553 " LXQt's programs use dosini as their config 562 " LXQt's programs use dosini as their config
554 au BufNewFile,BufRead */{lxqt,screengrab}/*.conf setf dosini 563 au BufNewFile,BufRead */{lxqt,screengrab}/*.conf setf dosini
555 564
556 " Quake 565 " Quake
562 571
563 " LaTeX packages use LaTeX as their configuration, such as: 572 " LaTeX packages use LaTeX as their configuration, such as:
564 " ~/.texlive/texmf-config/tex/latex/hyperref/hyperref.cfg 573 " ~/.texlive/texmf-config/tex/latex/hyperref/hyperref.cfg
565 " ~/.texlive/texmf-config/tex/latex/docstrip/docstrip.cfg 574 " ~/.texlive/texmf-config/tex/latex/docstrip/docstrip.cfg
566 au BufNewFile,BufRead */tex/latex/**.cfg setf tex 575 au BufNewFile,BufRead */tex/latex/**.cfg setf tex
576
577 " Wakatime config
578 au BufNewFile,BufRead .wakatime.cfg setf dosini
567 579
568 " Configure files 580 " Configure files
569 au BufNewFile,BufRead *.cfg\c call dist#ft#FTcfg() 581 au BufNewFile,BufRead *.cfg\c call dist#ft#FTcfg()
570 582
571 " Cucumber 583 " Cucumber
774 " FIRRTL - Flexible Internal Representation for RTL 786 " FIRRTL - Flexible Internal Representation for RTL
775 au BufNewFile,BufRead *.fir setf firrtl 787 au BufNewFile,BufRead *.fir setf firrtl
776 788
777 " Fish shell 789 " Fish shell
778 au BufNewFile,BufRead *.fish setf fish 790 au BufNewFile,BufRead *.fish setf fish
791
792 " Flatpak config
793 au BufNewFile,BufRead */flatpak/repo/config setf dosini
779 794
780 " FlexWiki - disabled, because it has side effects when a .wiki file 795 " FlexWiki - disabled, because it has side effects when a .wiki file
781 " is not actually FlexWiki 796 " is not actually FlexWiki
782 "au BufNewFile,BufRead *.wiki setf flexwiki 797 "au BufNewFile,BufRead *.wiki setf flexwiki
783 798
1652 else 1667 else
1653 au BufNewFile,BufRead *.pl call dist#ft#FTpl() 1668 au BufNewFile,BufRead *.pl call dist#ft#FTpl()
1654 endif 1669 endif
1655 au BufNewFile,BufRead *.plx,*.al,*.psgi setf perl 1670 au BufNewFile,BufRead *.plx,*.al,*.psgi setf perl
1656 1671
1672 " Perl Reply
1673 au BufNewFile,BufRead .replyrc setf dosini
1674
1657 " Perl, XPM or XPM2 1675 " Perl, XPM or XPM2
1658 au BufNewFile,BufRead *.pm 1676 au BufNewFile,BufRead *.pm
1659 \ if getline(1) =~ "XPM2" | 1677 \ if getline(1) =~ "XPM2" |
1660 \ setf xpm2 | 1678 \ setf xpm2 |
1661 \ elseif getline(1) =~ "XPM" | 1679 \ elseif getline(1) =~ "XPM" |
2922 au BufNewFile,BufRead mutt{ng,}rc*,Mutt{ng,}rc* call s:StarSetf('muttrc') 2940 au BufNewFile,BufRead mutt{ng,}rc*,Mutt{ng,}rc* call s:StarSetf('muttrc')
2923 2941
2924 " Neomutt setup file 2942 " Neomutt setup file
2925 au BufNewFile,BufRead .neomuttrc*,*/.neomutt/neomuttrc* call s:StarSetf('neomuttrc') 2943 au BufNewFile,BufRead .neomuttrc*,*/.neomutt/neomuttrc* call s:StarSetf('neomuttrc')
2926 au BufNewFile,BufRead neomuttrc*,Neomuttrc* call s:StarSetf('neomuttrc') 2944 au BufNewFile,BufRead neomuttrc*,Neomuttrc* call s:StarSetf('neomuttrc')
2945
2946 " Nfs
2947 au BufNewFile,BufRead nfs.conf,nfsmount.conf setf dosini
2927 2948
2928 " Nroff macros 2949 " Nroff macros
2929 au BufNewFile,BufRead tmac.* call s:StarSetf('nroff') 2950 au BufNewFile,BufRead tmac.* call s:StarSetf('nroff')
2930 2951
2931 " OpenBSD hostname.if 2952 " OpenBSD hostname.if