加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

Vim语法文件:向iskeyword添加某些字符无效

发布时间:2020-12-15 21:14:15 所属栏目:安全 来源:网络整理
导读:我正在制作一个Vim语法文件,我需要在iskeyword选项中添加一些字符.我无法从Vim帮助文件中找出它是如何工作的,但这是我目前所写的: set iskeyword+=_,.,-,64,133,!,?,@,172,8743,8744,8853,8592,8593,8594,8595,8596 #64和#133是at符号和省略号.最后几个字符
我正在制作一个Vim语法文件,我需要在iskeyword选项中添加一些字符.我无法从Vim帮助文件中找出它是如何工作的,但这是我目前所写的:

set iskeyword+=_,.,-,64,133,!,?,@,172,8743,8744,8853,8592,8593,8594,8595,8596

#64和#133是at符号和省略号.最后几个字符是?,∧,∨,⊕,→,←,↓,↑和?.

在所有这些字符中,只有_,– 和?(#172)似乎被识别为关键字字符.

我还有别的办法吗?或者Vim根本不支持超出Unicode特定点的关键字字符(但是at符号也没有被识别,并且这肯定在ASCII中)?

谢谢你的帮助!

解决方法

iskeyword的帮助指向isfname的帮助,它可以回答您的所有问题:

[…]
Multi-byte characters 256 and above are always included,only the
characters up to 255 are specified with this option.
For UTF-8 the characters 0xa0 to 0xff are included as well.
[…]
The format of this option is a list of parts,separated with commas.
Each part can be a single character number or a range.  A range is two
character numbers with '-' in between.  A character number can be a
decimal number between 0 and 255 or the ASCII character itself (does
not work for digits).  Example:
[…]
If the character is '@',all characters where isalpha() returns TRUE
are included.  Normally these are the characters a to z and A to Z,plus accented characters.  To include '@' itself use "@-@".  Examples:
    "@,^a-z"    All alphabetic characters,excluding lower
            case ASCII letters.
    "a-z,A-Z,@-@"   All letters plus the '@' character.
[…]

>“此选项仅指定最多255个字符.”
>“字符数可以是0到255之间的十进制数”
>“包含’@’本身使用”@ – @“”

在iskeyword中包含多字节字符已在许多列表中讨论过,如this one.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读