Trent Gamblin wrote:
I'm editing binary files with Vim using "set display=uhex" and I was
wondering if there's a way to insert characters given their scancode.
Something like what I used to do in DOS by holding Alt then typing the
number of the character to enter?




In Vim it's not the keyboard "geographical" scan code (e.g. 1 for Escape) but the character value in alpha, hex, decimal or octal. Example for hex: Assuming 'fileencoding' (or, if the latter is empty, 'encoding') is set to Latin1, not UTF-8:

        ^Vxhh

in Insert/Replace mode, or after hitting r (replace) in Normal mode, where:

^V means "hit Ctrl-V", unless mswin.vim maps Ctrl-V to the paste operation, in which case it means "hit Ctrl-Q".
  x   is the lowercase letter iks.
  hh  is the hex value

You'll see the partial sequence near the bottom right of the Vim screen if 'showcmd' is on, and the character will appear in your file after you hit the 2nd hex digit.

See
        :help i_CTRL-V_digit
        :help i_CTRL-V


Best regards,
Tony.

Reply via email to