From 08fa71fd274530be23b6ae6b10222afee0b57522 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Wed, 23 Aug 2023 19:32:11 +0800 Subject: vim-patch:9.0.1773: cannot distinguish Forth and Fortran *.f files (#24841) Problem: cannot distinguish Forth and Fortran *.f files Solution: Add Filetype detection Code Also add *.4th as a Forth filetype closes: vim/vim#12251 https://github.com/vim/vim/commit/19a3bc3addf9b4aa8150a01b11b4249c67d15d3b Don't remove filetype files from Vim patches: - filetype.vim, script.vim, ft.vim usually contain useful changes - script.vim and ft.vim don't even have their paths spelled correctly Co-authored-by: Doug Kearns --- runtime/doc/filetype.txt | 1 + runtime/doc/syntax.txt | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'runtime/doc') diff --git a/runtime/doc/filetype.txt b/runtime/doc/filetype.txt index 9ebdc71eb2..cf60ecdb6b 100644 --- a/runtime/doc/filetype.txt +++ b/runtime/doc/filetype.txt @@ -144,6 +144,7 @@ variables can be used to overrule the filetype used for certain extensions: `*.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 498c55389a..59f8235ad2 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -1542,9 +1542,10 @@ example, FORM files, use this in your startup vimrc: > 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" -- cgit