Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add BSD extension functions to the C function list #79

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
Create user-controllable variable for POSIX functions
When the option cpp_posix_standard is enabled, POSIX
functions are highlighted
  • Loading branch information
Cataldo authored and octol committed Nov 14, 2019
commit ae7a8517fd913001a7ea8999ad83262bd1c33774
19 changes: 13 additions & 6 deletions after/syntax/c.vim
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,19 @@ if exists('g:cpp_member_variable_highlight') && g:cpp_member_variable_highlight
hi def link cCustomMemVar Function
endif

" -----------------------------------------------------------------------------
" Highlight POSIX functions.
" -----------------------------------------------------------------------------
if exists('g:cpp_posix_standard') && g:cpp_posix_standard
syn keyword cPOSIXFunction socket accept bind connect getsockname
syn keyword cPOSIXFunction listen recv recvfrom recvmsg
syn keyword cPOSIXFunction send sendto sendmsg setsockopt socketpair
syn keyword cPOSIXFunction htonl htons ntohl ntohs
syn keyword cPOSIXFunction inet_ntop inet_pton getaddrinfo
syn keyword cPOSIXFunction poll select pselect
hi def link cPOSIXFunction Function
endif

" -----------------------------------------------------------------------------
" Source: aftersyntaxc.vim
" -----------------------------------------------------------------------------
Expand Down Expand Up @@ -204,12 +217,6 @@ syn keyword cAnsiFunction ccosf ccos catanl
syn keyword cAnsiFunction catanf catan casinl
syn keyword cAnsiFunction casinf casin cacosl
syn keyword cAnsiFunction cacosf cacos assert
syn keyword cAnsiFunction socket accept bind connect getsockname
syn keyword cAnsiFunction listen recv recvfrom recvmsg
syn keyword cAnsiFunction send sendto sendmsg setsockopt socketpair
syn keyword cAnsiFunction htonl htons ntohl ntohs
syn keyword cAnsiFunction inet_ntop inet_pton getaddrinfo
syn keyword cAnsiFunction poll select pselect
syn keyword cAnsiFunction UINTMAX_C INTMAX_C UINT64_C
syn keyword cAnsiFunction UINT32_C UINT16_C UINT8_C
syn keyword cAnsiFunction INT64_C INT32_C INT16_C INT8_C
Expand Down