Change text appearance in vim

Suppose I have a file whose entire contents are:

\u1234 

and let 1234 be the code for \ alpha

Is there a way, in vim, "\ 1234" is displayed as a single \ alpha character (and be considered a \ alpha character)?

Thanks!

[This problem occurs because I want to use unicode names in g ++]

+4
source share
3 answers

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

I think you can do the same, just check the source of the plugin.

+2
source

I really don't think this is possible, since vim is designed to represent and edit the actual contents of the file (it is not a WYSIWIG editor). I would not recommend it for the same reasons, even if you find a way to do this, it will lead to confusion in the future (as soon as you forget this function or if it is launched in a document that you did not expect, or the script contains an error and so .d.)

+3
source

One thing you can do is define a custom highlight so that you know that this symbol matches something else. It may not be exactly what you want, but as the soul indicates, something else can be dangerous / obscure.

0
source

Source: https://habr.com/ru/post/1307535/


All Articles