Vim的标点符号为⸮


Answers:


5

解决此问题的一种方法是将字符直接添加到vim作为定义的标点符号。为此,您需要修改vim源文件,mbyte.c然后重新编译vim。该文件位于/ src主干中(请参阅https://code.google.com/p/vim/source/browse/src/mbyte.c)。您要修改的功能如下所示:

/*
* Get class of a Unicode character.
* 0: white space
* 1: punctuation
* 2 or bigger: some class of word character.
*/
int
utf_class(c)
int c;
{
   /* sorted list of non-overlapping intervals */
   static struct clinterval
   {
      unsigned int first;
      unsigned int last;
      unsigned int class;
   } classes[] =
      {
         {0x037e, 0x037e, 1}, /* Greek question mark */
         {0x0387, 0x0387, 1}, /* Greek ano teleia */
         {0x055a, 0x055f, 1}, /* Armenian punctuation */
         {0x0589, 0x0589, 1}, /* Armenian full stop */
         ... etc and so on

您将字符添加到此列表中,并且在重新编译后将其视为标点符号。


2
在这种情况下,你应该报告的功能要求vim与建议代码变化,否则你的改变将无法生存下次升级...
umläute

这为我提供了打开bug的信息,因此修复很简单。谢谢。
Sardathrion-反对SE滥用

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.