如果我有这个二合字母:ň 在文件中,将光标放在它上面并输入ga
I see the message
<ň> 328, Hex 0148, Octal 510
但是,如果我搜索/\%o510
或/%x0148
我得到E486: Pattern not found
在我的 vimrc 中:
set encoding=utf-8
set fileencoding=utf-8
如何使用八进制或十六进制代码搜索这些字符?
来自: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