mirror of
https://github.com/vim/vim
synced 2025-07-16 01:01:58 +00:00
runtime(filetype): improve *.h filetype detection
This commit changes *.h files to default to C (instead of C++), and deprecates the existing `g:c_syntax_for_h` and `g:ch_syntax_for_h` variables in favor of a unified `g:filetype_h`, like is used for other ambiguous file extensions. closes: #17135 Signed-off-by: Amelia Clarke <selene@perilune.dev> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
5ecb452f5b
commit
3041cf67d3
@ -1,7 +1,7 @@
|
||||
" Vim support file to detect file types
|
||||
"
|
||||
" Maintainer: The Vim Project <https://github.com/vim/vim>
|
||||
" Last Change: 2025 Apr 18
|
||||
" Last Change: 2025 Apr 19
|
||||
" Former Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
|
||||
" Listen very carefully, I will say this only once
|
||||
@ -436,9 +436,8 @@ au BufNewFile,BufRead *.ixx,*.mpp setf cpp
|
||||
" https://clang.llvm.org/docs/StandardCPlusPlusModules.html#file-name-requirement
|
||||
au BufNewFile,BufRead *.cppm,*.ccm,*.cxxm,*.c++m setf cpp
|
||||
|
||||
" .h files can be C, Ch C++, ObjC or ObjC++.
|
||||
" Set c_syntax_for_h if you want C, ch_syntax_for_h if you want Ch. ObjC is
|
||||
" detected automatically.
|
||||
" .h files can be C, C++, Ch, Objective-C, or Objective-C++.
|
||||
" Set g_filetype_h to set a different filetype
|
||||
au BufNewFile,BufRead *.h call dist#ft#FTheader()
|
||||
|
||||
" Ch (CHscript)
|
||||
|
Reference in New Issue
Block a user