codekingpro/portable-devtools
114k
1" Vim filetype plugin file2" Language: BASIC (QuickBASIC 4.5)3" Maintainer: Doug Kearns <dougkearns@gmail.com>4" Last Change: 2024 Jan 145 6if exists("b:did_ftplugin")7 finish8endif9let b:did_ftplugin = 110 11let s:cpo_save = &cpo12set cpo&vim13 14setlocal comments=:REM\ ,:Rem\ ,:rem\ ,:'15setlocal commentstring='\ %s16setlocal formatoptions-=t formatoptions+=croql17 18let b:undo_ftplugin = "setl fo< com< cms<"19 20" TODO: support exit ... as middle matches?21if exists("loaded_matchit") && !exists("b:match_words")22 let s:line_start = '\%(^\s*\)\@<='23 let s:not_end = '\%(end\s\+\)\@<!'24 let s:not_end_or_exit = '\%(\%(end\|exit\)\s\+\)\@<!'25 26 let b:match_ignorecase = 127 let b:match_words =28 \ s:not_end_or_exit .. '\<def\s\+fn:\<end\s\+def\>,' ..29 \ s:not_end_or_exit .. '\<function\>:\<end\s\+function\>,' ..30 \ s:not_end_or_exit .. '\<sub\>:\<end\s\+sub\>,' ..31 \ s:not_end .. '\<type\>:\<end\s\+type\>,' ..32 \ s:not_end .. '\<select\>:\%(select\s\+\)\@<!\<case\%(\s\+\%(else\|is\)\)\=\>:\<end\s\+select\>,' ..33 \ '\<do\>:\<loop\>,' ..34 \ '\<for\>\%(\s\+\%(input\|output\|random\|append\|binary\)\)\@!:\<next\>,' ..35 \ '\<while\>:\<wend\>,' ..36 \ s:line_start .. 'if\%(.*\<then\s*\%($\|''\)\)\@=:\<\%(' .. s:line_start .. 'else\|elseif\)\>:\<end\s\+if\>,' ..37 \ '\<lock\>:\<unlock\>'38 let b:match_skip = 'synIDattr(synID(line("."),col("."),1),"name") =~? "comment\\|string" || ' ..39 \ 'strpart(getline("."), 0, col(".") ) =~? "\\<exit\\s\\+"'40 41 let b:undo_ftplugin ..= " | unlet! b:match_ignorecase b:match_skip b:match_words"42 43 unlet s:line_start s:not_end s:not_end_or_exit44endif45 46if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")47 let b:browsefilter = "BASIC Source Files (*.bas)\t*.bas\n" ..48 \ "BASIC Include Files (*.bi, *.bm)\t*.bi;*.bm\n"49 if has("win32")50 let b:browsefilter ..= "All Files (*.*)\t*\n"51 else52 let b:browsefilter ..= "All Files (*)\t*\n"53 endif54 let b:basic_set_browsefilter = 155 let b:undo_ftplugin ..= " | unlet! b:browsefilter b:basic_set_browsefilter"56endif57 58let &cpo = s:cpo_save59unlet s:cpo_save60 61" vim: nowrap sw=2 sts=2 ts=8 noet fdm=marker:62 