vim-patch:9.1.0304: filetype: cgdb config file is not recognized (#28294)

Problem:  filetype: cgdb config file is not recognized
Solution: Detect cgdbrc files as cgdbrc filetype
          (Wu, Zhenyu)

closes: vim/vim#14458

1492fe6903

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
This commit is contained in:
zeertzjq 2024-04-12 17:07:24 +08:00 committed by GitHub
parent e4fb3e2007
commit 611cc7de43
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 39 additions and 0 deletions

View File

@ -0,0 +1,21 @@
" Vim filetype plugin file
" Language: cgdbrc
" Maintainer: Wu, Zhenyu <wuzhenyu@ustc.edu>
" Documentation: https://cgdb.github.io/docs/Configuring-CGDB.html
" Latest Revision: 2024-04-09
if exists('b:did_ftplugin')
finish
endif
let b:did_ftplugin = 1
let s:save_cpoptions = &cpoptions
set cpoptions&vim
let b:undo_ftplugin = 'setl com< cms<'
setlocal commentstring=#%s
setlocal comments=:#
let &cpoptions = s:save_cpoptions
unlet s:save_cpoptions

View File

@ -1289,6 +1289,7 @@ local filename = {
['/etc/default/cdrdao'] = 'cdrdaoconf',
['/etc/defaults/cdrdao'] = 'cdrdaoconf',
['cfengine.conf'] = 'cfengine',
cgdbrc = 'cgdbrc',
['CMakeLists.txt'] = 'cmake',
['.alias'] = detect.csh,
['.cshrc'] = detect.csh,

16
runtime/syntax/cgdbrc.vim Normal file
View File

@ -0,0 +1,16 @@
" Vim syntax file
" Language: cgdbrc
" Maintainer: Wu, Zhenyu <wuzhenyu@ustc.edu>
" Documentation: https://cgdb.github.io/docs/Configuring-CGDB.html
" Latest Revision: 2024-04-09
if exists('b:current_syntax')
finish
endif
let b:current_syntax = 'cgdbrc'
runtime! syntax/vim.vim
syn region cgdbComment start="^\s*\#" skip="\\$" end="$" contains=@Spell
highlight default link cgdbComment Comment

View File

@ -146,6 +146,7 @@ func s:GetFilenameChecks() abort
\ 'cf': ['file.cfm', 'file.cfi', 'file.cfc'],
\ 'cfengine': ['cfengine.conf'],
\ 'cfg': ['file.hgrc', 'filehgrc', 'hgrc', 'some-hgrc'],
\ 'cgdbrc': ['cgdbrc'],
\ 'ch': ['file.chf'],
\ 'chaiscript': ['file.chai'],
\ 'chaskell': ['file.chs'],