aboutsummaryrefslogtreecommitdiff
path: root/after
diff options
context:
space:
mode:
authorMax Christian Pohle2018-01-31 00:39:09 +0100
committerMax Christian Pohle2018-01-31 00:39:09 +0100
commit449c7d316d7176c0fe44bf570d18d013fe3f3272 (patch)
tree2ec21421dbc510af0a3cee533711821f887483b8 /after
parent7eea1b6c9c6f807fe53ff896a88a14171334c690 (diff)
downloadvim-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.vim25
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 @@
1set number
2set foldenable
3set foldmethod=syntax
4
5" syntax match cType "struct\s+[A-Za-z0-9_]+\>"
6" syn clear cStructure
7" highlight! link defines Special
8syntax match Define "\<[A-Z][A-Z0-9_]*\>"
9syntax match Todo "\/\/ @[A-Z]*\:.*$"
10
11" clear default group for a cBlock so we can redefine it without the fold option
12syn clear cBlock
13syn region cBlock start=/{/ end=/}/ transparent
14
15" multiple single line comments in a row
16syn 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
..