In Vim (or in a terminal?), control characters and their caret notation cannot be distinguished, like Enter vs. C-M. However, there is an only exception; BS vs. C-H.
Why are they only privileged?
For example, if you map Enter to NOP, also C-M will be mapped. Other many control characters have the same behavior. On the other hand, BS and C-H can be mapped to different keys respectively.
:map <Enter> <NOP> // also <C-M> will be mapped
:map <BS> <NOP> // only <BS> will be mapped, <C-H> won't
You can insert a backspace into a file by pressing controlV before the backspace. In that case, vim (and most editors) will display it as ^H. But normally backspace is treated as a command (telling vim to do something, depending on the mode).
When moving the cursor in a file containing control characters, you can readily distinguish between a control character versus caret next to another character: as you move the cursor left/right, vim will move two columns for the control character, but one column for each of the caret and other character.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With