tags:

views:

65

answers:

3

Suppose I have a file, whose entire contents is:

\u1234

and suppose 1234 is the code for \alpha

is there a way to, in vim, have the "\1234" show up as a single \alpha symbol (and be treated as an \alpha symbol) ?

Thanks!

[This problem arises since I want to to use unicode names in g++]

+3  A: 

I really don't think this is possible, since vim is designed to present and edit the actual contents of a file (it is not a WYSIWIG editor). I wouldn't recommend it for the exact same reasons, even if you find a way to do it - it will lead to confusion in the future (once you forget the feature, or if it is triggered in a document you weren't expecting, or the script contains a bug, etc.)

soulmerge
A: 

One thing you could do is define custom highlighting so that you know that that character maps to something else. May not be exactly what you want but as soulmerge points out anything else may be dangerous/unclear.

sixtyfootersdude
+2  A: 

There is a plugin for Vim to display certain characters in Haskell as the Unicode symbol: http://www.vim.org/scripts/script.php?script_id=2603. It even decodes the symbols to their text-representation before writing (and vice versa after reading a Haskell file).

I guess you can do the same, just inspect the plugin's source.

Duddle