Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/matlab/13.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
强制vim检查\newcommand参数中文本的拼写_Vim_Spell Checking_Tex - Fatal编程技术网

强制vim检查\newcommand参数中文本的拼写

强制vim检查\newcommand参数中文本的拼写,vim,spell-checking,tex,Vim,Spell Checking,Tex,我想定制vim本机拼写机制,以便强制它检查\newcommand 具体地说,我的问题是,在使用英语词典时,当在\newcommand的参数中使用坏词“wellcome”和“fiendly”时,语法规则不会突出显示,例如: \newcommand{\Greetings}[0]{ wellcome, this is your fiendly receptionist. } 运行命令echo synIDattr(synID(line(“.”,col(“.”,1),“name”)可以看出我的坏单词所

我想定制vim本机拼写机制,以便强制它检查
\newcommand

具体地说,我的问题是,在使用英语词典时,当在
\newcommand
的参数中使用坏词“wellcome”和“fiendly”时,语法规则不会突出显示,例如:

\newcommand{\Greetings}[0]{ 
wellcome, this is your fiendly receptionist.
}
运行命令
echo synIDattr(synID(line(“.”,col(“.”,1),“name”)
可以看出我的坏单词所在的环境或区域是
texCmdBody
,因此原则上应该可以使用以下命令,特别是与
语法拼写toplevel
一起使用时:

syn region texMyCmdSpell matchgroup=texStatement
\ start='\\newcommand{.*{' end='}$'
\ contains=@Spell
\ containedin=texCmdBody
此修复程序可以工作,但很容易出现故障。它在简单的情况下确实有效,但一般来说它过早停止工作。这就好像
texCmdBody区域
末端的上述定义不够可靠。我这样说是因为它在最后一个大括号表示
\newcommand

对vim语法有更多了解的人会建议改进此修复程序吗?我试图修改它,但没有成功

或者,所有这些都可能是我错误使用
\newcommand
的结果。通常,我会将beamer幻灯片的全部内容放在
\newcommand
中,以便以后可以将其插入任何我想要的地方,或者有时我会使用
\newcommand
来定义考试的问题。但这可能是不好的做法。有没有更好的TeX技术来制作可移动的文本块