From b156ffedb623aa773a1a2a33af69e47e0536a574 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sat, 27 Nov 2021 16:20:29 +0100 Subject: vim-patch:8.2.3685: Visual studio project files are not recognized Problem: Visual studio project files are not recognized. Solution: Use the xml file type. (Doug Kearns) https://github.com/vim/vim/commit/c07f11e42fc2eac5e750bf05aa3030f9b02a22ca --- runtime/filetype.vim | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'runtime') diff --git a/runtime/filetype.vim b/runtime/filetype.vim index 1b48070128..cbb9e9687e 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -2055,9 +2055,15 @@ au BufNewFile,BufRead *.xml call dist#ft#FTxml() " XMI (holding UML models) is also XML au BufNewFile,BufRead *.xmi setf xml -" CSPROJ files are Visual Studio.NET's XML-based project config files +" CSPROJ files are Visual Studio.NET's XML-based C# project config files au BufNewFile,BufRead *.csproj,*.csproj.user setf xml +" FSPROJ files are Visual Studio.NET's XML-based F# project config files +au BufNewFile,BufRead *.fsproj,*.fsproj.user setf xml + +" VBPROJ files are Visual Studio.NET's XML-based Visual Basic project config files +au BufNewFile,BufRead *.vbproj,*.vbproj.user setf xml + " Qt Linguist translation source and Qt User Interface Files are XML " However, for .ts Typescript is more common. au BufNewFile,BufRead *.ui setf xml -- cgit From c1c567602106a8bcc0efa63b7c1e3812b8b8fd29 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sat, 27 Nov 2021 16:23:28 +0100 Subject: vim-patch:8.2.3452: MPD files are not recognized Problem: MPD files are not recognized. Solution: Recognize MPD files as XML. (Steven Penny, closes vim/vim#8893) https://github.com/vim/vim/commit/690c524ce6629f9ff67728541ba211f831caf0ee --- runtime/filetype.vim | 3 +++ 1 file changed, 3 insertions(+) (limited to 'runtime') diff --git a/runtime/filetype.vim b/runtime/filetype.vim index cbb9e9687e..a36911bbdb 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -1095,6 +1095,9 @@ au BufNewFile,BufRead *.moo setf moo " Modconf au BufNewFile,BufRead */etc/modules.conf,*/etc/modules,*/etc/conf.modules setf modconf +" MPD is based on XML +au BufNewFile,BufRead *.mpd setf xml + " Mplayer config au BufNewFile,BufRead mplayer.conf,*/.mplayer/config setf mplayerconf -- cgit From 47ad1a3584cce47a062d07236bf71984550c82c6 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sat, 27 Nov 2021 16:26:15 +0100 Subject: vim-patch:8.2.3458: not all dictdconf files are recognized Problem: Not all dictdconf files are recognized. Solution: Adjust the pattern. (Doug Kearns) https://github.com/vim/vim/commit/be01090efad242e30728275dea05420db6f96257 --- runtime/filetype.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime') diff --git a/runtime/filetype.vim b/runtime/filetype.vim index a36911bbdb..e3b38889d6 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -484,7 +484,7 @@ au BufNewFile,BufRead *.desktop,*.directory setf desktop au BufNewFile,BufRead dict.conf,.dictrc setf dictconf " Dictd config -au BufNewFile,BufRead dictd.conf setf dictdconf +au BufNewFile,BufRead dictd*.conf setf dictdconf " Diff files au BufNewFile,BufRead *.diff,*.rej setf diff -- cgit From b339cb5aca331673018e176fe2fb01c00f0496b9 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sat, 27 Nov 2021 16:26:26 +0100 Subject: vim-patch:8.2.3451: not all apache files are recognized Problem: Not all apache files are recognized. Solution: Adjust the filetype pattern. (Zdenek Dohnal, closes vim/vim#8882) https://github.com/vim/vim/commit/770ddbe1595f6dab836304203d5ca2e0b069266f --- runtime/filetype.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime') diff --git a/runtime/filetype.vim b/runtime/filetype.vim index e3b38889d6..4bd75d496e 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -2164,7 +2164,7 @@ au BufNewFile,BufRead proftpd.conf* call s:StarSetf('apachestyle') " More Apache config files au BufNewFile,BufRead access.conf*,apache.conf*,apache2.conf*,httpd.conf*,srm.conf* call s:StarSetf('apache') -au BufNewFile,BufRead */etc/apache2/*.conf*,*/etc/apache2/conf.*/*,*/etc/apache2/mods-*/*,*/etc/apache2/sites-*/*,*/etc/httpd/conf.d/*.conf* call s:StarSetf('apache') +au BufNewFile,BufRead */etc/apache2/*.conf*,*/etc/apache2/conf.*/*,*/etc/apache2/mods-*/*,*/etc/apache2/sites-*/*,*/etc/httpd/conf.*/*,*/etc/httpd/mods-*/*,*/etc/httpd/sites-*/*,*/etc/httpd/conf.d/*.conf* call s:StarSetf('apache') " Asterisk config file au BufNewFile,BufRead *asterisk/*.conf* call s:StarSetf('asterisk') -- cgit From ea5699399ed641aaf45cfbf845861595d2c38d37 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sat, 27 Nov 2021 18:39:34 +0100 Subject: vim-patch:8.2.3686: filetype detection often mixes up Forth and F# Problem: Filetype detection often mixes up Forth and F#. Solution: Add a function to inspect the file contents. (Doug Kearns) https://github.com/vim/vim/commit/3d14c0f2b964195d08b34bb43f89ec5f99255194 --- runtime/autoload/dist/ft.vim | 17 +++++++++++++++++ runtime/doc/filetype.txt | 12 ++++++------ runtime/doc/syntax.txt | 8 ++++++++ runtime/filetype.vim | 5 ++++- runtime/scripts.vim | 4 ++++ 5 files changed, 39 insertions(+), 7 deletions(-) (limited to 'runtime') diff --git a/runtime/autoload/dist/ft.vim b/runtime/autoload/dist/ft.vim index 344889249b..0cbcb1bbb5 100644 --- a/runtime/autoload/dist/ft.vim +++ b/runtime/autoload/dist/ft.vim @@ -219,6 +219,23 @@ func dist#ft#FTe() endif endfunc +" Distinguish between Forth and F#. +" Provided by Doug Kearns. +func dist#ft#FTfs() + if exists("g:filetype_fs") + exe "setf " . g:filetype_fs + else + let line = getline(nextnonblank(1)) + " comments and colon definitions + if line =~ '^\s*\.\=( ' || line =~ '^\s*\\G\= ' || line =~ '^\\$' + \ || line =~ '^\s*: \S' + setf forth + else + setf fs + endif + endif +endfunc + " Distinguish between HTML, XHTML and Django func dist#ft#FThtml() let n = 1 diff --git a/runtime/doc/filetype.txt b/runtime/doc/filetype.txt index 42a9993c8c..bbbe71ec3a 100644 --- a/runtime/doc/filetype.txt +++ b/runtime/doc/filetype.txt @@ -128,18 +128,19 @@ can be used to overrule the filetype used for certain extensions: file name variable ~ *.asa g:filetype_asa |ft-aspvbs-syntax| |ft-aspperl-syntax| - *.asp g:filetype_asp |ft-aspvbs-syntax| |ft-aspperl-syntax| *.asm g:asmsyntax |ft-asm-syntax| - *.prg g:filetype_prg - *.pl g:filetype_pl - *.inc g:filetype_inc - *.w g:filetype_w |ft-cweb-syntax| + *.asp g:filetype_asp |ft-aspvbs-syntax| |ft-aspperl-syntax| + *.fs g:filetype_fs |ft-forth-syntax| *.i g:filetype_i |ft-progress-syntax| + *.inc g:filetype_inc *.m g:filetype_m |ft-mathematica-syntax| *.p g:filetype_p |ft-pascal-syntax| + *.pl g:filetype_pl *.pp g:filetype_pp |ft-pascal-syntax| + *.prg g:filetype_prg *.sh g:bash_is_sh |ft-sh-syntax| *.tex g:tex_flavor |ft-tex-plugin| + *.w g:filetype_w |ft-cweb-syntax| *filetype-ignore* To avoid that certain files are being inspected, the g:ft_ignore_pat variable @@ -494,7 +495,6 @@ Options: For further discussion of fortran_have_tabs and the method used for the detection of source format see |ft-fortran-syntax|. - GIT COMMIT *ft-gitcommit-plugin* One command, :DiffGitCached, is provided to show a diff of the current commit diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index e423c59efe..72f08c37ca 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -1497,6 +1497,14 @@ gvim display. Here, statements are colored LightYellow instead of Yellow, and conditionals are LightBlue for better distinction. +FORTH *forth.vim* *ft-forth-syntax* + +Files matching "*.fs" could be F# or Forth. If the automatic detection +doesn't work for you, or you don't edit F# at all, use this in your +startup vimrc: > + :let filetype_fs = "forth" + + FORTRAN *fortran.vim* *ft-fortran-syntax* Default highlighting and dialect ~ diff --git a/runtime/filetype.vim b/runtime/filetype.vim index 4bd75d496e..0cad37531d 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -628,7 +628,10 @@ au BufNewFile,BufRead auto.master setf conf au BufNewFile,BufRead *.mas,*.master setf master " Forth -au BufNewFile,BufRead *.fs,*.ft,*.fth setf forth +au BufNewFile,BufRead *.ft,*.fth setf forth + +" F# or Forth +au BufNewFile,BufRead *.fs call dist#ft#FTfs() " Reva Forth au BufNewFile,BufRead *.frt setf reva diff --git a/runtime/scripts.vim b/runtime/scripts.vim index 0ff8e49088..3790b1c10f 100644 --- a/runtime/scripts.vim +++ b/runtime/scripts.vim @@ -198,6 +198,10 @@ if s:line1 =~# "^#!" elseif s:name =~# 'fish\>' set ft=fish + " Gforth + elseif s:name =~# 'gforth\>' + set ft=forth + endif unlet s:name -- cgit