blob: 47b2ec6d2a078cce1e2a62affe60adf7163b89cf [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" Vim filetype plugin file
2" Language: C
3" Maintainer: Bram Moolenaar <Bram@vim.org>
Bram Moolenaar30abd282005-06-22 22:35:10 +00004" Last Change: 2005 Jun 22
Bram Moolenaar071d4272004-06-13 20:20:40 +00005
6" Only do this when not done yet for this buffer
7if exists("b:did_ftplugin")
8 finish
9endif
10
11" Don't load another plugin for this buffer
12let b:did_ftplugin = 1
13
Bram Moolenaar582fd852005-03-28 20:58:01 +000014" Using line continuation here.
Bram Moolenaar30abd282005-06-22 22:35:10 +000015let s:cpo_save = &cpo
Bram Moolenaar071d4272004-06-13 20:20:40 +000016set cpo-=C
17
Bram Moolenaar582fd852005-03-28 20:58:01 +000018let b:undo_ftplugin = "setl fo< com< | if has('vms') | setl isk< | endif"
Bram Moolenaar071d4272004-06-13 20:20:40 +000019
20" Set 'formatoptions' to break comment lines but not other lines,
21" and insert the comment leader when hitting <CR> or using "o".
22setlocal fo-=t fo+=croql
23
24" Set 'comments' to format dashed lists in comments.
25setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,://
26
27" In VMS C keywords contain '$' characters.
28if has("vms")
29 setlocal iskeyword+=$
30endif
31
32" Win32 can filter files in the browse dialog
33if has("gui_win32") && !exists("b:browsefilter")
34 if &ft == "cpp"
35 let b:browsefilter = "C++ Source Files (*.cpp *.c++)\t*.cpp;*.c++\n" .
36 \ "C Header Files (*.h)\t*.h\n" .
37 \ "C Source Files (*.c)\t*.c\n" .
38 \ "All Files (*.*)\t*.*\n"
Bram Moolenaard4755bb2004-09-02 19:12:26 +000039 elseif &ft == "ch"
Bram Moolenaar071d4272004-06-13 20:20:40 +000040 let b:browsefilter = "Ch Source Files (*.ch *.chf)\t*.ch;*.chf\n" .
41 \ "C Header Files (*.h)\t*.h\n" .
42 \ "C Source Files (*.c)\t*.c\n" .
43 \ "All Files (*.*)\t*.*\n"
44 else
45 let b:browsefilter = "C Source Files (*.c)\t*.c\n" .
46 \ "C Header Files (*.h)\t*.h\n" .
47 \ "Ch Source Files (*.ch *.chf)\t*.ch;*.chf\n" .
48 \ "C++ Source Files (*.cpp *.c++)\t*.cpp;*.c++\n" .
49 \ "All Files (*.*)\t*.*\n"
50 endif
51endif
Bram Moolenaar30abd282005-06-22 22:35:10 +000052
53let &cpo = s:cpo_save
54unlet s:cpo_save