" Vim support file to detect file types
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
-" Last Change: 2017 Jun 20
+" Last Change: 2017 Jun 22
" Listen very carefully, I will say this only once
if exists("did_load_filetypes")
" Plain text files, needs to be far down to not override others. This avoids
" the "conf" type being used if there is a line starting with '#'.
-au BufNewFile,BufRead *.txt,*.text,README setf text
+au BufNewFile,BufRead *.text,README setf text
+
+" Help files match *.txt but should have a last line that is a modeline.
+au BufNewFile,BufRead *.txt
+ \ if getline('$') !~ 'vim:.*ft=help'
+ \| setf text
+ \| endif
" Use the filetype detect plugins. They may overrule any of the previously