Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/c/65.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在GVim中禁用亮显括号 我试图通过GVim在C++中突出我自己的类名和函数名。 我阅读并遵循stackoverflow的说明。请同时查看结果_C++_C_Vim_Syntax_Highlight - Fatal编程技术网

如何在GVim中禁用亮显括号 我试图通过GVim在C++中突出我自己的类名和函数名。 我阅读并遵循stackoverflow的说明。请同时查看结果

如何在GVim中禁用亮显括号 我试图通过GVim在C++中突出我自己的类名和函数名。 我阅读并遵循stackoverflow的说明。请同时查看结果,c++,c,vim,syntax,highlight,C++,C,Vim,Syntax,Highlight,我在syntax目录下的cpp.vim中复制了以下设置 " Highlight Class and Function names syn match cCustomParen "(" contains=cParen,cCppParen syn match cCustomFunc "\w\+\s*(" contains=cCustomParen syn match cCustomScope "::" syn match cCustomClass

我在syntax目录下的cpp.vim中复制了以下设置

" Highlight Class and Function names 
syn match    cCustomParen    "(" contains=cParen,cCppParen 
syn match    cCustomFunc     "\w\+\s*(" contains=cCustomParen
syn match    cCustomScope    "::"
syn match    cCustomClass    "\w\+\s*::" contains=cCustomScope
hi def link cCustomFunc  Function
hi def link cCustomClass Function 
它起作用了,但用红色突出了我的括号。如何禁用括号的高亮显示? 我删除了.vimrc文件并再次打开我的cpp文件,它仍然是一样的。所以我认为这是上面的代码问题

--------------------已解决[解决方案]--------------------

syn match   customFunc "\<[a-zA-Z_][a-zA-Z_0-9]*\>[^()]*)("me=e-2
syn match   customFunc "\<[a-zA-Z_][a-zA-Z_0-9]*\>\s*("me=e-1
hi def customFunc   gui=NONE guifg=#E54023   
syn match    cCustomScope    "::"
syn match    cCustomClass    "\w\+\s*::" contains=cCustomScope
hi def link cCustomClass Function 
syn match customFunc“\[^()]*)(“me=e-2
同步匹配自定义函数“\\s*(“me=e-1
高清customFunc gui=无gui=#E54023
同步匹配cCustomScope::
syn match cCustomClass“\w\+\s*::”包含=cCustomScope
高清链接cCustomClass功能
---------------------------EOF------------------------------

syn match   customFunc "\<[a-zA-Z_][a-zA-Z_0-9]*\>[^()]*)("me=e-2
syn match   customFunc "\<[a-zA-Z_][a-zA-Z_0-9]*\>\s*("me=e-1
hi def customFunc   gui=NONE guifg=#E54023   
syn match    cCustomScope    "::"
syn match    cCustomClass    "\w\+\s*::" contains=cCustomScope
hi def link cCustomClass Function 

您应该编辑
.vimrc
文件。只需将此行添加到文件中:

let g:loaded_matchparen= 1

您的更改没有引入Matching brakcets。这是vim的默认行为。 所以,只需添加

let g:loaded_matchparen= 1 

到你的.vimrc文件。

@sav,它仍然是一样的。我认为这是代码的问题,因为在我删除代码后,它没有问题。是:在这里输入代码`syn match cCustomFunc'\w\+\s*(“contains=cCustomParen,只是stackoverflow中的一个复制粘贴问题?或者这真的存在于您的vimrc中?这不是导致问题吗?@sav,是的,我只是复制代码并保存到我的cpp.vim文件中,而不是.vimrc文件中。在添加代码之前,我没有遇到问题。请确保第二行:“在此处输入代码”在你上面的例子中,而不是在原始帖子中,这只是一个复制粘贴问题,而不是在你的vimrc文件中:-)@sav,;-)对,不是在我的代码中,我在帖子中更改了。我确信我的代码是正确的。