Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to write a golfing library for postscript. But it needs to be condensed itself. So I need a convenient way to type-in arbitrary bytes within mostly ascii text.

I know this can easily be done with absolutely any programming language, but can I do it in vi? (:help octal was no help).

share|improve this question
If Vim is available, this might help – sr_ Jan 13 '13 at 9:53
related: unix.stackexchange.com/questions/108020/… – luser droog Apr 4 '15 at 16:24
up vote 3 down vote accepted

I assume that you use vim, because :helpoctal is a vim's command. On some systems vi is just a symlink to vim which runs it in vi-compatible mode.

In vim:

  • You can enter unicode characters from basic multilingual plane you can use:
    Press ctrl+v and then enter four digit hex unicode code.
  • Another option is digraphs. You can read more about them in vim's help (help: dig).
    Press ctrl+k and then two-character sequence.
    You can list sequences supported in you vim usig command :digraph .

In nvi, vi and elsewhere:

  • Ctrl+Shift and hit U and then enter unicode hex code.
share|improve this answer
    :help i_CTRL-V_digit

In insert-mode, type control+V followed by

  • a decimal number
  • x then a hex number
  • u then a 4-hexchar unicode sequence
  • U then an 8-hexchar unicode sequence
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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