" Vim filetype plugin file " Language: FreeBASIC " Maintainer: Doug Kearns " Last Change: 2023 Aug 22 " Setup {{{1 if exists("b:did_ftplugin") finish endif let s:cpo_save = &cpo set cpo&vim runtime! ftplugin/basic.vim let s:dialect = freebasic#GetDialect() " Comments {{{1 " add ''comments before 'comments let &l:comments = "sO:*\ -,mO:*\ \ ,exO:*/,s1:/',mb:',ex:'/,:''," .. &l:comments " Match words {{{1 if exists("loaded_matchit") let s:line_start = '\%(^\s*\)\@<=' let s:not_end = '\%(end\s\+\)\@:\,' .. \ s:not_end .. '\:\,' .. \ s:not_end .. '\:\,' .. \ s:not_end .. '\:\,' .. \ s:not_end .. '\,' endif if s:dialect == 'fb' || s:dialect == 'deprecated' let b:match_words ..= s:not_end .. '\:\,' endif if s:dialect == 'qb' let b:match_words ..= s:not_end .. '\<__asm\>:\,' .. \ s:not_end .. '\<__union\>:\,' .. \ s:not_end .. '\<__with\>:\,' else let b:match_words ..= s:not_end .. '\:\,' .. \ s:not_end .. '\:\,' .. \ s:not_end .. '\:\,' .. \ s:not_end .. '\:\,' endif let b:match_words ..= s:not_end .. '\:\,' .. \ s:line_start .. '#\s*\%(if\|ifdef\|ifndef\)\>:' .. \ s:line_start .. '#\s*\%(else\|elseif\)\>:' .. \ s:line_start .. '#\s*endif\>,' .. \ s:line_start .. '#\s*macro\>:' .. s:line_start .. '#\s*endmacro\>,' .. \ "/':'/" " skip "function = " and "continue { do | for | while }" if s:dialect == "qb" let s:continue = "__continue" else let s:continue = "continue" endif let b:match_skip ..= ' || strpart(getline("."), col(".") - 1) =~? "^\\