aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--runtime/ftplugin/cgdbrc.vim21
-rw-r--r--runtime/lua/vim/filetype.lua1
-rw-r--r--runtime/syntax/cgdbrc.vim16
-rw-r--r--test/old/testdir/test_filetype.vim1
4 files changed, 39 insertions, 0 deletions
diff --git a/runtime/ftplugin/cgdbrc.vim b/runtime/ftplugin/cgdbrc.vim
new file mode 100644
index 0000000000..46cf135c5c
--- /dev/null
+++ b/runtime/ftplugin/cgdbrc.vim
@@ -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
diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua
index d2c6d87774..c0c64be94b 100644
--- a/runtime/lua/vim/filetype.lua
+++ b/runtime/lua/vim/filetype.lua
@@ -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,
diff --git a/runtime/syntax/cgdbrc.vim b/runtime/syntax/cgdbrc.vim
new file mode 100644
index 0000000000..1ace370d8c
--- /dev/null
+++ b/runtime/syntax/cgdbrc.vim
@@ -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
diff --git a/test/old/testdir/test_filetype.vim b/test/old/testdir/test_filetype.vim
index d1f6950128..1a31d129bc 100644
--- a/test/old/testdir/test_filetype.vim
+++ b/test/old/testdir/test_filetype.vim
@@ -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'],