robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
7945732ed7
master
1" Vim filetype plugin file 2" Language: occam 3" Copyright: Christian Jacobsen <clj3@kent.ac.uk>, Mario Schweigler <ms44@kent.ac.uk> 4" Maintainer: Mario Schweigler <ms44@kent.ac.uk> 5" Last Change: 23 April 2003 6" 2024 Jan 14 by Vim Project (browsefilter) 7" 2025 Jun 08 by Riley Bruins <ribru17@gmail.com> ('commentstring') 8" 2026 Jun 27 by Vim Project (add recommended style guard) 9 10" Only do this when not done yet for this buffer 11if exists ( "b:did_ftplugin" ) 12finish 13endif 14let b: did_ftplugin = 1 15let s: keepcpo = & cpo 16set cpo & vim 17 18"{{{ Indent settings 19if get ( g:, 'occam_recommended_style' , 20 \get ( g:, 'filetype_recommended_style' , 1 )) 21" Set shift width for indent 22setlocal shiftwidth = 2 23" Set the tab key size to two spaces 24setlocal softtabstop = 2 25" Let tab keys always be expanded to spaces 26setlocal expandtab 27endif 28"}}} 29 30"{{{ Formatting 31" Break comment lines and insert comment leader in this case 32setlocal formatoptions -= tformatoptions += cql 33setlocal comments += :-- 34setlocal commentstring = --\ %s 35if get ( g:, 'occam_recommended_style' , 36 \get ( g:, 'filetype_recommended_style' , 1 )) 37" Maximum length of comments is 78 38setlocal textwidth = 78 39endif 40"}}} 41 42"{{{ File browsing filters 43" Win32 and GTK can filter files in the browse dialog 44if ( has ( "gui_win32" ) || has ( "gui_gtk" )) && ! exists ( "b:browsefilter" ) 45let b: browsefilter = "All Occam Files (*.occ, *.inc)\t*.occ;*.inc\n" . 46 \"Occam Include Files (*.inc)\t*.inc\n" . 47 \"Occam Source Files (*.occ)\t*.occ\n" 48if has ( "win32" ) 49let b: browsefilter .= "All Files (*.*)\t*\n" 50else 51let b: browsefilter .= "All Files (*)\t*\n" 52endif 53endif 54"}}} 55 56"{{{ Undo settings 57let b: undo_ftplugin = "setlocal shiftwidth< softtabstop< expandtab<" 58 \. " formatoptions< comments< commentstring< textwidth<" 59 \. "| unlet! b:browsefilter" 60"}}} 61 62let & cpo = s: keepcpo 63unlet s: keepcpo