robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
7ed6966023
master
1" Vim filetype plugin file 2" Language: BASIC (QuickBASIC 4.5) 3" Maintainer: Doug Kearns <dougkearns@gmail.com> 4" Last Change: 2024 Jan 14 5 6if exists ( "b:did_ftplugin" ) 7finish 8endif 9let b: did_ftplugin = 1 10 11let s: cpo_save = & cpo 12set cpo & vim 13 14setlocal comments = :REM\ ,:Rem\ ,:rem\ ,:' 15setlocal commentstring = '\ %s 16setlocal formatoptions -= tformatoptions += croql 17 18let b: undo_ftplugin = "setl fo< com< cms<" 19 20" TODO: support exit ... as middle matches? 21if exists ( "loaded_matchit" ) && ! exists ( "b:match_words" ) 22let s: line_start = '\%(^\s*\)\@<=' 23let s: not_end = '\%(end\s\+\)\@<!' 24let s: not_end_or_exit = '\%(\%(end\|exit\)\s\+\)\@<!' 25 26let b: match_ignorecase = 1 27let 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\>' 38let b: match_skip = 'synIDattr(synID(line("."),col("."),1),"name") =~? "comment\\|string" || ' .. 39 \'strpart(getline("."), 0, col(".") ) =~? "\\<exit\\s\\+"' 40 41let b: undo_ftplugin ..= " | unlet! b:match_ignorecase b:match_skip b:match_words" 42 43unlet s: line_start s: not_end s: not_end_or_exit 44endif 45 46if ( has ( "gui_win32" ) || has ( "gui_gtk" )) && ! exists ( "b:browsefilter" ) 47let b: browsefilter = "BASIC Source Files (*.bas)\t*.bas\n" .. 48 \"BASIC Include Files (*.bi, *.bm)\t*.bi;*.bm\n" 49if has ( "win32" ) 50let b: browsefilter ..= "All Files (*.*)\t*\n" 51else 52let b: browsefilter ..= "All Files (*)\t*\n" 53endif 54let b: basic_set_browsefilter = 1 55let b: undo_ftplugin ..= " | unlet! b:browsefilter b:basic_set_browsefilter" 56endif 57 58let & cpo = s: cpo_save 59unlet s: cpo_save 60 61" vim: nowrap sw=2 sts=2 ts=8 noet fdm=marker: