codekingpro/portable-devtools
114k
1" Vim filetype plugin file2" Language: gdb3" Maintainer: Michaël Peeters <NOSPAMm.vim@noekeon.org>4" Contributors: Riley Bruins5" Last Changed: 2017 Oct 266" 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 finish12endif13let b:did_ftplugin = 114 15let s:cpo_save = &cpo16set cpo&vim17 18setlocal comments=:#19setlocal commentstring=#\ %s20setlocal formatoptions-=t21setlocal formatoptions+=croql22setlocal include=^\\s*source23 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 = 029 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_start37 let b:undo_ftplugin ..= " | unlet! b:match_ignorecase b:match_words"38endif39 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 else48 let b:browsefilter ..= "All Files (*)\t*\n"49 endif50 let b:undo_ftplugin ..= " | unlet! b:browsefilter"51endif52 53let &cpo = s:cpo_save54unlet s:cpo_save55 