robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
2f5b8a0092
master
1" Vim filetype plugin file 2" Language: Modula-2 3" Maintainer: Doug Kearns <dougkearns@gmail.com> 4" Last Change: 2024 Jan 14 5" 2024 May 23 by Riley Bruins <ribru17@gmail.com> ('commentstring') 6 7if exists ( "b:did_ftplugin" ) 8finish 9endif 10let b: did_ftplugin = 1 11 12let s: cpo_save = & cpo 13set cpo & vim 14 15let s: dialect = modula2#GetDialect () 16 17if s: dialect ==# "r10" 18setlocal comments = s:(*,m:\ ,e:*),:! 19setlocal commentstring = !\ %s 20else 21setlocal commentstring = (*\ %s\ *) 22setlocal comments = s:(*,m:\ ,e:*) 23endif 24setlocal formatoptions -= tformatoptions += croql 25 26let b: undo_ftplugin = "setl com< cms< fo<" 27 28if exists ( "loaded_matchit" ) && ! exists ( "b:match_words" ) 29let b: match_ignorecase = 0 30" the second branch of the middle pattern is intended to match CASE labels 31let b: match_words = '\<REPEAT\>:\<UNTIL\>,' .. 32 \'\<\%(BEGIN\|CASE\|FOR\|IF\|LOOP\|WHILE\|WITH\|RECORD\)\>' .. 33 \':' .. 34 \'\<\%(ELSIF\|ELSE\)\>\|\%(^\s*\)\@<=\w\+\%(\s*\,\s*\w\+\)\=\s*\:=\@!' .. 35 \':' .. 36 \'\<END\>,' .. 37 \'(\*:\*),<\*:\*>' 38let b: match_skip = 's:Comment\|Pragma' 39let b: undo_ftplugin ..= " | unlet! b:match_ignorecase b:match_skip b:match_words" 40endif 41 42if ( has ( "gui_win32" ) || has ( "gui_gtk" )) && ! exists ( "b:browsefilter" ) 43let b: browsefilter = "Modula-2 Source Files (*.def, *.mod)\t*.def;*.mod\n" 44if has ( "win32" ) 45let b: browsefilter ..= "All Files (*.*)\t*\n" 46else 47let b: browsefilter ..= "All Files (*)\t*\n" 48endif 49let b: undo_ftplugin ..= " | unlet! b:browsefilter" 50endif 51 52let & cpo = s: cpo_save 53unlet s: cpo_save 54 55" vim: nowrap sw=2 sts=2 ts=8 noet: