1
0

Custom syntax highlighting

For c and quickfix
Function to format the quickfix and location jump lists
Fixed issue with "help" window layouts accessing incorrect variable
This commit is contained in:
2025-09-25 00:04:21 +01:00
parent ce611a0e14
commit da251e7223
3 changed files with 136 additions and 7 deletions

View File

@@ -0,0 +1,32 @@
syn clear cTodo
syn clear cType
" Custom keywords
"
syn keyword cStorageClass function export internal global_var thread_var local_persist
syn keyword cOperator cast
" Type highlighting
"
" There are inconsistencies around this due to the horrific declaration syntax of C/C++ and
" trying to capture that inside a regexp statement is near impossible. These are made to mostly
" match the way I format my code.
"
syn match cType "\I\i*\ze\s\+\**\I\i*\s*[=;,\)\[]" " Regular declarations
syn match cType "\I\i*\ze\s\+\**\I\i*(" " Function return types
" Todo notes
"
syn match cTodo "@\I\i*\((\I\i*)\)\=:\?" contained
syn match cNote "\s:\I\i*" contained
" Functions
"
syn match cFunction "\I\i*\ze("
" Contain clusters
"
syn cluster cCommentGroup add=cNote
syn cluster cPreProcGroup add=cFunc,cType
hi def link cFunction Function