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