From 8edcb401cff117318011ce3d2a746d1fd9341f70 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 31 Aug 2026 10:46:26 +0800 Subject: [PATCH] vim-patch:5c9c5a4: runtime(c): syntax depends on the 'iskeyword' option Problem: C keywords are matched using the characters from 'iskeyword', so changing that option highlights part of an identifier as a keyword and leaves keywords containing an underscore unhighlighted. Solution: Set the keyword characters with ":syn iskeyword". fixes: vim/vim#21173 closes: vim/vim#21176 https://github.com/vim/vim/commit/5c9c5a43c183e8d1e4156b468343d0aa0f3b081c Co-authored-by: Hirohito Higashi Co-Authored-By: Maxim Kim --- runtime/syntax/c.vim | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/runtime/syntax/c.vim b/runtime/syntax/c.vim index 9b18c2b8a18..38d65cdc137 100644 --- a/runtime/syntax/c.vim +++ b/runtime/syntax/c.vim @@ -1,7 +1,7 @@ " Vim syntax file " Language: C " Maintainer: The Vim Project -" Last Change: 2026 Jul 25 +" Last Change: 2026 Aug 30 " Former Maintainer: Bram Moolenaar " Quit when a (custom) syntax file was already loaded @@ -25,6 +25,13 @@ if exists("c_autodoc") unlet b:current_syntax endif +" In VMS C keywords contain '$' characters. +if has("vms") + syn iskeyword @,48-57,_,192-255,$ +else + syn iskeyword @,48-57,_,192-255 +endif + " A bunch of useful C keywords syn keyword cStatement goto break return continue asm syn keyword cLabel case default