blob: 1404c0ea338ec0f625a5b61e3cc49f2eba228a6e [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" 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 Bruinsde535cf2025-06-09 21:06:23 +02006" 2024 Jan 14 by Vim Project (browsefilter)
7" 2025 Jun 08 by Riley Bruins <ribru17@gmail.com> ('commentstring')
Bram Moolenaar071d4272004-06-13 20:20:40 +00008
9" Only do this when not done yet for this buffer
10if exists("b:did_ftplugin")
11 finish
12endif
13let b:did_ftplugin = 1
Bram Moolenaar8e52a592012-05-18 21:49:28 +020014let s:keepcpo= &cpo
15set cpo&vim
Bram Moolenaar071d4272004-06-13 20:20:40 +000016
17"{{{ Indent settings
18" Set shift width for indent
19setlocal shiftwidth=2
20" Set the tab key size to two spaces
21setlocal softtabstop=2
22" Let tab keys always be expanded to spaces
23setlocal expandtab
24"}}}
25
26"{{{ Formatting
27" Break comment lines and insert comment leader in this case
28setlocal formatoptions-=t formatoptions+=cql
29setlocal comments+=:--
Riley Bruinsde535cf2025-06-09 21:06:23 +020030setlocal commentstring=--\ %s
Bram Moolenaar071d4272004-06-13 20:20:40 +000031" Maximum length of comments is 78
32setlocal textwidth=78
33"}}}
34
35"{{{ File browsing filters
Doug Kearns93197fd2024-01-14 20:59:02 +010036" Win32 and GTK can filter files in the browse dialog
37if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
38 let b:browsefilter = "All Occam Files (*.occ, *.inc)\t*.occ;*.inc\n" .
Bram Moolenaar071d4272004-06-13 20:20:40 +000039 \ "Occam Include Files (*.inc)\t*.inc\n" .
Doug Kearns93197fd2024-01-14 20:59:02 +010040 \ "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 Moolenaar071d4272004-06-13 20:20:40 +000046endif
47"}}}
48
Bram Moolenaar84f72352012-03-11 15:57:40 +010049"{{{ Undo settings
50let b:undo_ftplugin = "setlocal shiftwidth< softtabstop< expandtab<"
Riley Bruinsde535cf2025-06-09 21:06:23 +020051 \ . " formatoptions< comments< commentstring< textwidth<"
Doug Kearns93197fd2024-01-14 20:59:02 +010052 \ . "| unlet! b:browsefilter"
Bram Moolenaar84f72352012-03-11 15:57:40 +010053"}}}
Bram Moolenaar8e52a592012-05-18 21:49:28 +020054
55let &cpo = s:keepcpo
56unlet s:keepcpo