Ok, I had to put it in ~/.vimrc because ~/.vim/after/syntax/c.vim gets
sourced too late.
Thank you.
On Fri Nov 28, 2025 at 8:13 AM CET, Ben Yip wrote:
> g:c_gnu = 1
>
> On 2025-11-28, 'Björn Försterling' via vim_use wrote:
>>Hello,
>>
>>In a .c file in the following line, the character is categorized as
>>"cSpecialError".
>>```
>>char my_char = '\e';
>>```
>>(This is a valid character (27) on my machine.)
>>
>>It seems to be this section in runtime/syntax/c.vim:
>>```
>>83 if exists("c_gnu")
>>84 syn match cSpecialError "L\='\\[^'\"?\\abefnrtv]'"
>>85 syn match cSpecialCharacter "L\='\\['\"?\\abefnrtv]'"
>>86 else
>>87 syn match cSpecialError "L\='\\[^'\"?\\abfnrtv]'"
>>88 syn match cSpecialCharacter "L\='\\['\"?\\abfnrtv]'"
>>89 endif
>>```
>>
>>And "c_gnu" is not set.
>>
>>I tried setting "c_gnu" in "~/.vim/after/syntax/c.vim" (which is
>>currently vim9script).
>>
>>This would not work because the scope is local to the vim script:
>>```
>>var c_gnu = 1
>>```
>>
>>Can someone please help me how to set this variable?
>>And shouldn't the variable be set by default on GNU/Linux machines?
>>
>>Regards
>>Bjoern
>>
>>--
>>--
>>You received this message from the "vim_use" maillist.
>>Do not top-post! Type your reply below the text you are replying to.
>>For more information, visit http://www.vim.org/maillist.php
>>
>>---
>>You received this message because you are subscribed to the Google Groups "vim_use" group.
>>To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
>>To view this discussion visit https://groups.google.com/d/msgid/vim_use/DEK4ZLV11BG1.1RLBRTW3XDGNW%40web.de.
--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/vim_use/DEKGHUQOJAC6.2DA5ESAKG17TV%40web.de.
Friday, November 28, 2025
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment