2

I have an XML file with some invalid characters. Vim show them for example as

^C

I know that this is some special character and how to replace them. Yet what is its meaning?

And ^C is just one example, I would like to know all the possible non-printable chars meaning, including ^M or whatever there may be.

2
  • 1
    Have you tried ga in normal mode with the cursor over the character?
    – Endre Both
    Jun 29, 2017 at 12:46
  • @EndreBoth No, I didn't. This is very helpful, thanks for pointing it out. Even though it doesn't explain its meaning, it makes finding the definition a lot easier. Feel free to also add this as an answer.
    – k0pernikus
    Jun 29, 2017 at 12:55

2 Answers 2

4

I was looking for the digraph table, also available in the help at:

:h digraph-table

Here's the relevant part in terms of this questions, there are a lot more available chars:

char  digraph   hex dec official name 
^@  NU  0x00      0 NULL (NUL)
^A  SH  0x01      1 START OF HEADING (SOH)
^B  SX  0x02      2 START OF TEXT (STX)
^C  EX  0x03      3 END OF TEXT (ETX)
^D  ET  0x04      4 END OF TRANSMISSION (EOT)
^E  EQ  0x05      5 ENQUIRY (ENQ)
^F  AK  0x06      6 ACKNOWLEDGE (ACK)
^G  BL  0x07      7 BELL (BEL)
^H  BS  0x08      8 BACKSPACE (BS)
^I  HT  0x09      9 CHARACTER TABULATION (HT)
^@  LF  0x0a     10 LINE FEED (LF)
^K  VT  0x0b     11 LINE TABULATION (VT)
^L  FF  0x0c     12 FORM FEED (FF)
^M  CR  0x0d     13 CARRIAGE RETURN (CR)
^N  SO  0x0e     14 SHIFT OUT (SO)
^O  SI  0x0f     15 SHIFT IN (SI)
^P  DL  0x10     16 DATALINK ESCAPE (DLE)
^Q  D1  0x11     17 DEVICE CONTROL ONE (DC1)
^R  D2  0x12     18 DEVICE CONTROL TWO (DC2)
^S  D3  0x13     19 DEVICE CONTROL THREE (DC3)
^T  D4  0x14     20 DEVICE CONTROL FOUR (DC4)
^U  NK  0x15     21 NEGATIVE ACKNOWLEDGE (NAK)
^V  SY  0x16     22 SYNCHRONOUS IDLE (SYN)
^W  EB  0x17     23 END OF TRANSMISSION BLOCK (ETB)
^X  CN  0x18     24 CANCEL (CAN)
^Y  EM  0x19     25 END OF MEDIUM (EM)
^Z  SB  0x1a     26 SUBSTITUTE (SUB)
^[  EC  0x1b     27 ESCAPE (ESC)
^\  FS  0x1c     28 FILE SEPARATOR (IS4)
^]  GS  0x1d     29 GROUP SEPARATOR (IS3)
^^  RS  0x1e     30 RECORD SEPARATOR (IS2)
^_  US  0x1f     31 UNIT SEPARATOR (IS1)
    SP  0x20     32 SPACE
1
  • 1
    man ascii also has this information on most Unix-y systems. Jun 29, 2017 at 11:14
2

You can use my plugin unicode.vim. Put the cursor on top of the character and enter :UnicodeName. It will return the name of the character, together with some additional information such as the html entity code, digraph to create that char if it exists in paranthesis, decimal and hex code of the character and the code you need to search for that char. You can even directly copy that into the search register.

It provides some other possibilities like creating a unicode table, or omnicompletion of digraphs and unicode characters, so check it out.

1
  • Not directly related to this question, but I find :UnicodeSearch also a very useful feature of your plugin. Jun 29, 2017 at 11:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.