patch 9.1.1186: filetype: help files in git repos are not detected
Problem: filetype: help files in git repos are not detected
Solution: detect */doc/*.txt files as help if they end with a help
modeline, even if 'modeline' is off
Here's how I checked that this would still detect vim's own help files
correctly:
$ find . -type f -path '*/doc/*.txt' \
> -exec awk '{ } ENDFILE { print FILENAME ":" $0; }' '{}' + |
> grep -v 'vim:.*\<\(ft\|filetype\)=help\>'
./src/libvterm/doc/seqs.txt: 23 DECSM 42 = DECNRCM, national/multinational character
closes: #16817
Signed-off-by: David Mandelberg <david@mandelberg.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
ce4f9d2a10
commit
16d6fff98e
@ -1,4 +1,4 @@
|
||||
*todo.txt* For Vim version 9.1. Last change: 2025 Feb 21
|
||||
*todo.txt* For Vim version 9.1. Last change: 2025 Mar 08
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -6276,5 +6276,4 @@ Far future and "big" extensions:
|
||||
are reflected in each Vim immediately. Could work with local files but
|
||||
also over the internet. See http://www.codingmonkeys.de/subethaedit/.
|
||||
|
||||
vim:tw=78:sw=4:sts=4:ts=8:noet:ft=help:norl:
|
||||
vim: set fo+=n :
|
||||
vim:tw=78:sw=4:sts=4:ts=8:noet:ft=help:norl:fo+=n:
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
" Vim support file to detect file types
|
||||
"
|
||||
" Maintainer: The Vim Project <https://github.com/vim/vim>
|
||||
" Last Change: 2025 Mar 06
|
||||
" Last Change: 2025 Mar 08
|
||||
" Former Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
|
||||
" Listen very carefully, I will say this only once
|
||||
@ -51,8 +51,11 @@ func s:StarSetf(ft)
|
||||
endif
|
||||
endfunc
|
||||
|
||||
" Vim help file
|
||||
au BufNewFile,BufRead $VIMRUNTIME/doc/*.txt setf help
|
||||
" Vim help file, set ft explicitly, because 'modeline' might be off
|
||||
au BufNewFile,BufRead */doc/*.txt
|
||||
\ if getline('$') =~ 'vim:.*\<\(ft\|filetype\)=help\>'
|
||||
\| setf help
|
||||
\| endif
|
||||
|
||||
" Abaqus or Trasys
|
||||
au BufNewFile,BufRead *.inp call dist#ft#Check_inp()
|
||||
|
||||
Reference in New Issue
Block a user