Vim 拼写检查 Latex 的新命令定义 [英] Vim spell checking latex's newcommand definition

查看:27
本文介绍了Vim 拼写检查 Latex 的新命令定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题很简单,我也希望解决方案:vim-spell 插件不会为 LaTeX 文件中 \newcommand 的定义中的错误单词着色:

My problem is simple and I hope the solution too: vim-spell plugin doesn't colorize the incorrect words in \newcommand's definition in LaTeX files:

 \newcommand{\mycommand}{Helllo World}

Hello 不会是红色的.当我删除 Hello world 周围的括号时,它被标记为一个坏词.

The Helllo will not be red. When I delete the parentheses around Helllo world it's marked as a bad word.

推荐答案

我试图解决与 latex 文件中的拼写相关的问题,但我在 vim_use 组中得到了帮助.请阅读留言谷歌群组界面获取完整详情.

I was trying to solve a problem related with spelling in latex files and I got help in the vim_use group. Please read the messages in google groups interface to get the full details.

尝试将以下内容添加到您的 ~/.vim/after/ftplugin/tex.vim 文件中:

Try adding the following to your ~/.vim/after/ftplugin/tex.vim file:

syn region texMyCmdSpell matchgroup=texStatement
      \ start='\\newcommand{.*{' end='}$'
      \ contains=@Spell
      \ containedin=texCmdBody

这似乎对我有用.开始模式只是由一个新命令定义,结束模式由 } 跟随一个换行符.

This seems to work for me. The start pattern is just defined by a new command, the end pattern by } followed a a newline.

这篇关于Vim 拼写检查 Latex 的新命令定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆