patch 9.1.1606: filetype: a few more files are not recognized
Problem: filetype: a few more files are not recognized Solution: guess Mail, Info and Terminfo files by its content (lacygoill) closes: #17880 Signed-off-by: lacygoill <lacygoill@lacygoill.me> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
8a65a49d50
commit
eb2aebeb79
7
runtime/autoload/dist/script.vim
vendored
7
runtime/autoload/dist/script.vim
vendored
@ -264,6 +264,7 @@ def DetectFromText(line1: string)
|
||||
|
||||
# ELM Mail files
|
||||
elseif line1 =~ '^From \([a-zA-Z][a-zA-Z_0-9\.=-]*\(@[^ ]*\)\=\|-\) .* \(19\|20\)\d\d$'
|
||||
|| line1 =~ '^\creturn-path:\s<.*@.*>$'
|
||||
setl ft=mail
|
||||
|
||||
# Mason
|
||||
@ -453,6 +454,12 @@ def DetectFromText(line1: string)
|
||||
elseif line1 =~ '^#n\%($\|\s\)'
|
||||
setl ft=sed
|
||||
|
||||
elseif line1 =~ '^#\s\+Reconstructed via infocmp from file:'
|
||||
setl ft=terminfo
|
||||
|
||||
elseif line1 =~ '^File: .*\.info, Node: .*, \%(Next\|Prev\): .*, Up: \|This is the top of the INFO tree.'
|
||||
setl ft=info
|
||||
|
||||
else
|
||||
var lnum = 1
|
||||
while getline(lnum) =~ "^? " && lnum < line("$")
|
||||
|
Reference in New Issue
Block a user