Meaning of Special Characters in Vim

You will often see characters like “^@” and “^M” in files opened by vim, but it’s not well documented how to find what they actually mean.

These are called “digraphs” and, fortunately, the full list of these are available in the vim documentation.

http://vimdoc.sourceforge.net/htmldoc/digraph.html#digraph-table

To insert digraphs, you can use CTRL+K in insert mode and the two-letter alias for the digraph. CTRL+I will let you insert a literal character (e.g. a tab if you have those turned off). CTRL+V will insert a character by numeric value for example CTRL+V x 41 will insert a capital ‘A’.

These commands can be particularly useful in substitutions for junk characters, but if you need to type foreign characters it can be easier to set digraph and use backspace to add the accent to a character you just typed.

Advertisements
Meaning of Special Characters in Vim

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s