occam.vim (1846B)
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 11 if exists("b:did_ftplugin") 12 finish 13 endif 14 let b:did_ftplugin = 1 15 let s:keepcpo= &cpo 16 set cpo&vim 17 18 "{{{ Indent settings 19 if get(g:, 'occam_recommended_style', 20 \ get(g:, 'filetype_recommended_style', 1)) 21 " Set shift width for indent 22 setlocal shiftwidth=2 23 " Set the tab key size to two spaces 24 setlocal softtabstop=2 25 " Let tab keys always be expanded to spaces 26 setlocal expandtab 27 endif 28 "}}} 29 30 "{{{ Formatting 31 " Break comment lines and insert comment leader in this case 32 setlocal formatoptions-=t formatoptions+=cql 33 setlocal comments+=:-- 34 setlocal commentstring=--\ %s 35 if get(g:, 'occam_recommended_style', 36 \ get(g:, 'filetype_recommended_style', 1)) 37 " Maximum length of comments is 78 38 setlocal textwidth=78 39 endif 40 "}}} 41 42 "{{{ File browsing filters 43 " Win32 and GTK can filter files in the browse dialog 44 if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") 45 let 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" 48 if has("win32") 49 let b:browsefilter .= "All Files (*.*)\t*\n" 50 else 51 let b:browsefilter .= "All Files (*)\t*\n" 52 endif 53 endif 54 "}}} 55 56 "{{{ Undo settings 57 let b:undo_ftplugin = "setlocal shiftwidth< softtabstop< expandtab<" 58 \ . " formatoptions< comments< commentstring< textwidth<" 59 \ . "| unlet! b:browsefilter" 60 "}}} 61 62 let &cpo = s:keepcpo 63 unlet s:keepcpo