Answers:
您可以使用%b或%B在statusline或rulerformat。来自:help statusline:
b N Value of character under cursor.
B N As above, in hexadecimal.
例如:
set statusline=%b\ %B
给你:
8984 2318
另一种方法是使用ga或:ascii命令。来自:help ga:
:as[cii] or ga :as :ascii
ga Print the ascii value of the character under the
cursor in decimal, hexadecimal and octal.
这会给你:
<⌘> 8984, Hex 2318, Octal 21430
另一个有用的映射是g8:
e2 8c 98
它将打印存储在文件中的实际字节的十六进制值(此命令假定为UTF-8)。
另外,您可以使用两个有用的插件:
unicode.vim添加了各种有用的与unicode相关的命令。使用:UnicodeName得到光标下字符的细节。
特征。vim ; 这将ga使用unicode名称扩展命令,类似于unicode.vim。
encoding将if 设置为非utf8多字节编码(例如cp932),g8则只会打印第一个字节,但ga会显示完整的字符数。
encoding(但不尊重fileencoding)。