VIM符号^ A在日志文件中

mrb*_*ela 5 vim control-characters

当我在GVIM2中打开一个特殊的日志文件(http://www.quickfixj.org/)时,我得到:

GVIM2

什么^A特别意味着什么,我如何搜索它(打字/patternXY)?

谢谢你的帮助!

亲切的问候

PS:我在OS Windows 7上使用VIM 7.4版.

You*_*ous 13

试试:help digraph-tableVim,你可以看到

char  digraph   hex     dec     official name
^@      NU      0x00      0     NULL (NUL)
^A      SH      0x01      1     START OF HEADING (SOH)
...
Run Code Online (Sandbox Code Playgroud)

所以^A是ASCII字符0×01.如果你想看^A十六进制代码的东西,试试吧set display+=uhex.它将<01>以灰色显示.

您也可以使用搜索此字符/Ctrl-VCtrl-AEnter.见:help i_CTRL-V:

CTRL-V          Insert next non-digit literally.  For special keys, the
                terminal code is inserted.  It's also possible to enter the
                decimal, octal or hexadecimal value of a character
                i_CTRL-V_digit.
                The characters typed right after CTRL-V are not considered for
                mapping.  {Vi: no decimal byte entry}
                Note: When CTRL-V is mapped (e.g., to paste text) you can
                often use CTRL-Q instead i_CTRL-Q.
Run Code Online (Sandbox Code Playgroud)

您可以输入具有十六进制值,<C-V>Xnn或其<C-V>xnn十进制值<C-V>nnn或其八进制值的字符,<C-V>Onnn<C-V>onnn.在这种情况下,这将是<C-V>x01,<C-V>001<C-V>o001.

如果您在Windows上使用Vim,Ctrl-V可能会用于粘贴.然后尝试Ctrl-Q而不是Ctrl-V.见:help CTRL-V-alternative:

Since CTRL-V is used to paste, you can't use it to start a blockwise Visual
selection.  You can use CTRL-Q instead.  You can also use CTRL-Q in Insert
mode and Command-line mode to get the old meaning of CTRL-V.  But CTRL-Q
doesn't work for terminals when it's used for control flow.
Run Code Online (Sandbox Code Playgroud)