Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 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 |
Riley Bruins | de535cf | 2025-06-09 21:06:23 +0200 | [diff] [blame] | 6 | " 2024 Jan 14 by Vim Project (browsefilter) |
| 7 | " 2025 Jun 08 by Riley Bruins <ribru17@gmail.com> ('commentstring') |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8 | |
| 9 | " Only do this when not done yet for this buffer |
| 10 | if exists("b:did_ftplugin") |
| 11 | finish |
| 12 | endif |
| 13 | let b:did_ftplugin = 1 |
Bram Moolenaar | 8e52a59 | 2012-05-18 21:49:28 +0200 | [diff] [blame] | 14 | let s:keepcpo= &cpo |
| 15 | set cpo&vim |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 16 | |
| 17 | "{{{ Indent settings |
| 18 | " Set shift width for indent |
| 19 | setlocal shiftwidth=2 |
| 20 | " Set the tab key size to two spaces |
| 21 | setlocal softtabstop=2 |
| 22 | " Let tab keys always be expanded to spaces |
| 23 | setlocal expandtab |
| 24 | "}}} |
| 25 | |
| 26 | "{{{ Formatting |
| 27 | " Break comment lines and insert comment leader in this case |
| 28 | setlocal formatoptions-=t formatoptions+=cql |
| 29 | setlocal comments+=:-- |
Riley Bruins | de535cf | 2025-06-09 21:06:23 +0200 | [diff] [blame] | 30 | setlocal commentstring=--\ %s |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 31 | " Maximum length of comments is 78 |
| 32 | setlocal textwidth=78 |
| 33 | "}}} |
| 34 | |
| 35 | "{{{ File browsing filters |
Doug Kearns | 93197fd | 2024-01-14 20:59:02 +0100 | [diff] [blame] | 36 | " Win32 and GTK can filter files in the browse dialog |
| 37 | if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") |
| 38 | let b:browsefilter = "All Occam Files (*.occ, *.inc)\t*.occ;*.inc\n" . |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 39 | \ "Occam Include Files (*.inc)\t*.inc\n" . |
Doug Kearns | 93197fd | 2024-01-14 20:59:02 +0100 | [diff] [blame] | 40 | \ "Occam Source Files (*.occ)\t*.occ\n" |
| 41 | if has("win32") |
| 42 | let b:browsefilter .= "All Files (*.*)\t*\n" |
| 43 | else |
| 44 | let b:browsefilter .= "All Files (*)\t*\n" |
| 45 | endif |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 46 | endif |
| 47 | "}}} |
| 48 | |
Bram Moolenaar | 84f7235 | 2012-03-11 15:57:40 +0100 | [diff] [blame] | 49 | "{{{ Undo settings |
| 50 | let b:undo_ftplugin = "setlocal shiftwidth< softtabstop< expandtab<" |
Riley Bruins | de535cf | 2025-06-09 21:06:23 +0200 | [diff] [blame] | 51 | \ . " formatoptions< comments< commentstring< textwidth<" |
Doug Kearns | 93197fd | 2024-01-14 20:59:02 +0100 | [diff] [blame] | 52 | \ . "| unlet! b:browsefilter" |
Bram Moolenaar | 84f7235 | 2012-03-11 15:57:40 +0100 | [diff] [blame] | 53 | "}}} |
Bram Moolenaar | 8e52a59 | 2012-05-18 21:49:28 +0200 | [diff] [blame] | 54 | |
| 55 | let &cpo = s:keepcpo |
| 56 | unlet s:keepcpo |