Skip to content

Commit 19aad49

Browse files
authored
Merge pull request #7 from dtor/new-syntax-highlights
New syntax highlights
2 parents 2892b86 + 267754a commit 19aad49

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

plugin/linuxsty.vim

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ function s:LinuxFormatting()
8282
endfunction
8383

8484
function s:LinuxKeywords()
85-
syn keyword cStatement fallthrough
85+
syn keyword cStatement fallthrough return_ptr
8686
syn keyword cStorageClass noinline __always_inline __must_check
8787
syn keyword cStorageClass __pure __weak __noclone
8888
syn keyword cStorageClass __free __cleanup
@@ -91,10 +91,12 @@ function s:LinuxKeywords()
9191
syn keyword cType u8 u16 u32 u64 s8 s16 s32 s64
9292
syn keyword cType __u8 __u16 __u32 __u64 __s8 __s16 __s32 __s64
9393
syn keyword cType __le16 __le32 __le64 __be16 __be32 __be64
94+
syn keyword LinuxGuard guard scoped_guard scoped_cond_guard
9495
endfunction
9596

9697
function s:LinuxHighlighting()
9798
highlight default link LinuxError ErrorMsg
99+
highlight default link LinuxGuard cConditional
98100

99101
syn match LinuxError / \+\ze\t/ " spaces before tab
100102
syn match LinuxError /\%>100v[^()\{\}\[\]<>]\+/ " virtual column 101 and more
@@ -103,6 +105,9 @@ function s:LinuxHighlighting()
103105
" include/linux/compiler_attributes.h for why.
104106
syn match LinuxError /\<__deprecated\>/
105107

108+
" highlight various for_each() variants
109+
syn match cRepeat /\v^\s*\zs((h)?list_|device_)?for_each(_\w+)?(\()@=/
110+
106111
" Highlight trailing whitespace, unless we're in insert mode and the
107112
" cursor's placed right after the whitespace. This prevents us from having
108113
" to put up with whitespace being highlighted in the middle of typing

0 commit comments

Comments
 (0)