Inputting Unicode characters in Vim · Thinker's Tech Tips

Thinker's Tech Tips

A web developer blog

March 4, 2015

Inputting Unicode characters in Vim

vimunicodeencoding

Setup

We need to make sure that Vim encoding is set to UTF-8.

To check what encoding you are currently using, run this command

set encoding?

If it outputs something like this

encoding=utf-8

Then you are good to go.

Otherwise, set this option in your .vimrc file

set encoding=utf-8

Inserting unicode characters

After doing the setup above, you are now ready to enter unicode characters.

  1. Enter Insert or Replace Mode
  2. Press Control + v
  3. Press u
  4. Enter the unicode number of the character

I learned about this tip while I was customizing my Syntastic linter options. My goal was to use unicode characters for the error and warning markers in the gutter.