robin/laufey

git clone https://git.robinwobin.dev/robin/laufey

zeertzjqvim-patch:b422a33: runtime(gdb): Update syntax and ftplugin (#37783)6ad73421cb

master
1.7 KiB54 linesraw
1" Vim filetype plugin file
2" Language:	gdb
3" Maintainer:	Michaël Peeters <NOSPAMm.vim@noekeon.org>
4" Contributors: Riley Bruins
5" Last Changed:	2017 Oct 26
6"		2024 Apr 10: add Matchit support (by Vim Project)
7"		2024 Apr 23: add space to commentstring (by Riley Bruins) ('commentstring')
8"		2026 Feb 08: add browsefilter, comment formatting, and improve matchit support (by Vim Project)
9
10if exists("b:did_ftplugin")
11  finish
12endif
13let b:did_ftplugin = 1
14
15let s:cpo_save = &cpo
16set cpo&vim
17
18setlocal comments=:#
19setlocal commentstring=#\ %s
20setlocal formatoptions-=t
21setlocal formatoptions+=croql
22setlocal include=^\\s*source
23
24" Undo the stuff we changed.
25let b:undo_ftplugin = "setlocal com< cms< fo< inc<"
26
27if exists("loaded_matchit") && !exists("b:match_words")
28  let b:match_ignorecase = 0
29  let s:line_start = '\%(^\s*\)\@<='
30  let b:match_words =
31	\ s:line_start .. '\%(commands\|define\|document\|if\|while\|' ..
32	\     '\%(py\%[thon]\|gu\%[ile]\)\%(\s*$\)\@=\|' ..
33	\     '\%(compi\%[le]\|exp\%[ression]\)\s\+\%(c\%[ode]\|p\%[rint]\)\)\>:' ..
34	\   s:line_start .. '\%(else\|loop_continue\|loop_break\)\>:' ..
35	\ s:line_start .. 'end\>'
36  unlet s:line_start
37  let b:undo_ftplugin ..= " | unlet! b:match_ignorecase b:match_words"
38endif
39
40if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
41  let b:browsefilter =
42	\ "GDB Init Files (.gdbinit gdbinit .gdbearlyinit gdbearlyinit)\t" ..
43	\   ".gdbinit;gdbinit;.gdbearlyinit;gdbearlyinit\n" ..
44	\ "GDB Command Files (*.gdb)\t*.gdb\n"
45  if has("win32")
46    let b:browsefilter ..= "All Files (*.*)\t*\n"
47  else
48    let b:browsefilter ..= "All Files (*)\t*\n"
49  endif
50  let b:undo_ftplugin ..= " | unlet! b:browsefilter"
51endif
52
53let &cpo = s:cpo_save
54unlet s:cpo_save