diff options
author | Max Christian Pohle | 2018-01-31 00:39:09 +0100 |
---|---|---|
committer | Max Christian Pohle | 2018-01-31 00:39:09 +0100 |
commit | 449c7d316d7176c0fe44bf570d18d013fe3f3272 (patch) | |
tree | 2ec21421dbc510af0a3cee533711821f887483b8 /after | |
parent | 7eea1b6c9c6f807fe53ff896a88a14171334c690 (diff) | |
download | vim-449c7d316d7176c0fe44bf570d18d013fe3f3272.tar.bz2 vim-449c7d316d7176c0fe44bf570d18d013fe3f3272.zip |
Added comment folding to C filetype
this works by overruling some of the default settings, see :help mysyntaxfile-add*
Diffstat (limited to 'after')
-rw-r--r-- | after/syntax/c.vim | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/after/syntax/c.vim b/after/syntax/c.vim new file mode 100644 index 0000000..ca694a2 --- /dev/null +++ b/after/syntax/c.vim | |||
@@ -0,0 +1,25 @@ | |||
1 | set number | ||
2 | set foldenable | ||
3 | set foldmethod=syntax | ||
4 | |||
5 | " syntax match cType "struct\s+[A-Za-z0-9_]+\>" | ||
6 | " syn clear cStructure | ||
7 | " highlight! link defines Special | ||
8 | syntax match Define "\<[A-Z][A-Z0-9_]*\>" | ||
9 | syntax match Todo "\/\/ @[A-Z]*\:.*$" | ||
10 | |||
11 | " clear default group for a cBlock so we can redefine it without the fold option | ||
12 | syn clear cBlock | ||
13 | syn region cBlock start=/{/ end=/}/ transparent | ||
14 | |||
15 | " multiple single line comments in a row | ||
16 | syn match cComment /\v\/\/.*(\_.\/\/.*)+/ fold | ||
17 | |||
18 | |||
19 | |||
20 | |||
21 | " let b:current_syntax = "c" | ||
22 | " let g:polyglot_disabled = ['c/c++'] | ||
23 | " unlet s:ft | ||
24 | " let &cpo = s:cpo_save | ||
25 | " unlet s:cpo_save | ||