0

如果我有这个二合字母:ň 在文件中,将光标放在它上面并输入gaI see the message

<&#328;> 328, Hex 0148, Octal 510

但是,如果我搜索/\%o510/%x0148我得到E486: Pattern not found

在我的 vimrc 中:

set encoding=utf-8 set fileencoding=utf-8

如何使用八进制或十六进制代码搜索这些字符?

4

1 回答 1

3

来自:help %o

%o   Matches the character specified with an octal number up to 0377.
%x   Matches the character specified with up to two hexadecimal characters.

因为 0510 八进制大于 0377,所以八进制搜索将不匹配。同样,%x最多允许两个十六进制字符,但您需要三个 (148)。

而是使用四字符十六进制搜索:

%u   Matches the character specified with up to four hexadecimal characters

所以模式是\%u148

于 2018-05-28T22:40:11.107 回答