patch 9.0.1773: cannot distinguish Forth and Fortran *.f files
Problem: cannot distinguish Forth and Fortran *.f files
Solution: Add Filetype detection Code
Also add *.4th as a Forth filetype
closes: #12251
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
diff --git a/runtime/doc/filetype.txt b/runtime/doc/filetype.txt
index 05574eb..0504722 100644
--- a/runtime/doc/filetype.txt
+++ b/runtime/doc/filetype.txt
@@ -146,6 +146,7 @@
*.cls g:filetype_cls
*.csh g:filetype_csh |ft-csh-syntax|
*.dat g:filetype_dat
+ *.f g:filetype_f |ft-forth-syntax|
*.frm g:filetype_frm |ft-form-syntax|
*.fs g:filetype_fs |ft-forth-syntax|
*.i g:filetype_i |ft-progress-syntax|
diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt
index 17f8139..29a1239 100644
--- a/runtime/doc/syntax.txt
+++ b/runtime/doc/syntax.txt
@@ -1579,9 +1579,10 @@
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: >
+Files matching "*.f" could be Fortran or Forth and those matching "*.fs" could
+be F# or Forth. If the automatic detection doesn't work for you, or you don't
+edit F# or Fortran at all, use this in your startup vimrc: >
+ :let filetype_f = "forth"
:let filetype_fs = "forth"