2016-01-22 68 views
1

當我打開GVIM2一個特殊的日誌文件(http://www.quickfixj.org/),我得到:VIM符號^ A

GVIM2

什麼^A特別是指和我如何可以搜索它(打字/patternXY) ?

感謝您的幫助!

親切的問候

P.S:我使用VIM 7.4版的操作系統Windows 7

+3

它是一個字面的「ctrl-a」字符,ascii 0x01 –

+2

用vim你可以在正常模式下按ga來顯示關於光標下字符的信息。在這種情況下,vim顯示'<^A> 1,HEX 01,Octal 001'。 – Lynch

回答

5

嘗試在Vim的:help digraph-table,你可以看到

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

所以^A是ASCII字符0×01。如果您想查看^A十六進制代碼,請嘗試set display+=uhex。它將顯示爲<01>,顏色爲灰色。你

還可以搜索這個角色與/按Ctrl-V按Ctrl-A輸入。見: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. 

您可以用其十六進制值,<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. 
1

您可以Ctrl-V然後Ctrl-A輸入。更一般地說,打字Ctrl-V可以讓你逐字輸入下一個鍵(不需要解釋);嘗試Ctrl-V,然後Return。因此,您可以使用/,然後Ctrl-V,然後Ctrl-A進行搜索。