I have VIM 8.2 with multi-byte support. I'm new to Vim and currently going through "Practical Vim" by Drew Neil. Tip 17 and Tip 18 talk about inserting special characters with character codes and by digraphs, so I decided to practice using this chart. However, I am having trouble having some of the characters to show up properly.
Here is a section of the chart that I decided to try.
^? DT 0x7f 127 DELETE (DEL)
~@ PA 0x80 128 PADDING CHARACTER (PAD)
~A HO 0x81 129 HIGH OCTET PRESET (HOP)
~B BH 0x82 130 BREAK PERMITTED HERE (BPH)
~C NH 0x83 131 NO BREAK HERE (NBH)
~D IN 0x84 132 INDEX (IND)
~E NL 0x85 133 NEXT LINE (NEL)
~F SA 0x86 134 START OF SELECTED AREA (SSA)
~G ES 0x87 135 END OF SELECTED AREA (ESA)
~H HS 0x88 136 CHARACTER TABULATION SET (HTS)
~I HJ 0x89 137 CHARACTER TABULATION WITH JUSTIFICATION (HTJ)
~J VS 0x8a 138 LINE TABULATION SET (VTS)
~K PD 0x8b 139 PARTIAL LINE FORWARD (PLD)
~L PU 0x8c 140 PARTIAL LINE BACKWARD (PLU)
~M RI 0x8d 141 REVERSE LINE FEED (RI)
~N S2 0x8e 142 SINGLE-SHIFT TWO (SS2)
~O S3 0x8f 143 SINGLE-SHIFT THREE (SS3)
~P DC 0x90 144 DEVICE CONTROL STRING (DCS)
~Q P1 0x91 145 PRIVATE USE ONE (PU1)
~R P2 0x92 146 PRIVATE USE TWO (PU2)
~S TS 0x93 147 SET TRANSMIT STATE (STS)
~T CC 0x94 148 CANCEL CHARACTER (CCH)
~U MW 0x95 149 MESSAGE WAITING (MW)
~V SG 0x96 150 START OF GUARDED AREA (SPA)
~W EG 0x97 151 END OF GUARDED AREA (EPA)
~X SS 0x98 152 START OF STRING (SOS)
~Y GC 0x99 153 SINGLE GRAPHIC CHARACTER INTRODUCER (SGCI)
~Z SC 0x9a 154 SINGLE CHARACTER INTRODUCER (SCI)
If I press Ctrl-kDT, I get ^?
, which is correct. The same thing happens if I press Ctrl-vx7f or Ctrl-v127.
However, if I go down the list, I run into problems. If I press Ctrl-kPA or Ctrl-vx80 or Ctrl-v128, I will get <80>
instead of ~@
The same thing happens if I try to insert any of the other characters after ~@
such as ~A
, ~B
, etc.
Why can't I get these characters to show up properly with character codes or by digraphs?
Also, I have to use vanilla Vim with no .vimrc. When I load Vim with my custom .vimrc, the problem gets even worse, as either Ctrl-k or Ctrl-v appears to insert a Tab. When I type :map
, none of the custom mappings appear to override these two key bindings. When I load vim with my .vimrc and type :verbose imap <C-k>
, I get "No Mappings Found". Same thing with :verbose imap <C-v>
.
Why does this happen if I use my own .vimrc?
EDIT
It turns out that I had previously had UltiSnips installed and had deleted the line installing it in my .vimrc, but I had forgotten to run :PlugClean
to have vim-plug properly uninstall it. UltiSnips remaps Ctrl-k. When I uninstalled UltiSnips and sourced my .vimrc, the characters showed up properly with the character codes and with the digraphs.
Also, this chart is a much better representation of what gets printed out in vim although it still does not show that Ctrl-kPA will actually print out <80>
<80>
at various times, such as binary files not opened correctly, certain keystrokes in macros (eg the F-keys, other oddities). – D. Ben Knoble♦ Sep 9 '20 at 13:34:imap
table though, since they're used in Insert mode. Try:verbose imap <C-v>
and:verbose imap <C-k>
– filbranden♦ Sep 9 '20 at 14:38