robin/laufey

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

Christian Clasonvim-patch:93197fde0f1d7ed6966023

master
2.1 KiB61 linesraw
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")
7  finish
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-=t formatoptions+=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")
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 = 1
27  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_exit
44endif
45
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  else
52    let b:browsefilter ..= "All Files (*)\t*\n"
53  endif
54  let b:basic_set_browsefilter = 1
55  let 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: