背景
如果您同时使用Vim和snipMate,并最近升级了snipMate到最新版本,您可能会遇到一个警告:
The legacy SnipMate parser is deprecated. Please see :h SnipMate-deprecate
旧SnipMate解析器已弃用。请参阅::h SnipMate-deprecate
原因分析
如果您按照说明运行:h SnipMate-deprecate
,您将在帮助窗口中看到以下内容:
- The legacy parser, version 0, is deprecated.
旧解析器,版本0,已弃用。- It is currently still the default parser, but that will be changing.
它目前仍然是默认解析器,但这将会发生改变。- NOTE that switching which parser you use could require changes to your snippets–see the previous section.
请注意,切换使用哪个解析器可能需要更改您的代码片段 - 请参阅前一节。- To continue using the old parser, set g:snipMate.snippet_version (see |SnipMate-options|) to 0 in your |vimrc|.
要继续使用旧解析器,请在您的|vimrc|中将g:snipMate.snippet_version(参见|SnipMate-options|)设置为0。- Setting g:snipMate.snippet_version to either 0 or 1 will remove the start up message. One way this can be done–to use the new parser–is as follows:
将g:snipMate.snippet_version设置为0或1都将删除启动消息。要使用新解析器的一种方法如下:
let g:snipMate = { ‘snippet_version’ : 1 }
实际上,snipMate中有一个新的解析器,但已弃用的旧解析器仍然是默认值,这会导致出现警告。将解析器版本明确设置为0(表示使用旧解析器)或1(表示使用新解析器)将消除这个启动警告消息。
似乎没有理由不使用新解析器,所以我只需在我的.vimrc
中添加以下内容:
let g:snipMate = { 'snippet_version' : 1 }
现在,在启动Vim时,令人讨厌的警告已经消失!🎉
总结
以上就是本文所有内容了,希望能对你有所帮助,能够解决 snipMate 的旧解析器警告问题。
如果你喜欢本文,也请务必点赞、收藏、评论、转发,这会对我有非常大的帮助。请我喝杯冰可乐也是极好的!
已完结,欢迎持续关注。下次见~