Sunday, February 23, 2014

Re: Change a character's representation in VIM

On 2014-02-23 19:26, neolus wrote:
> Hello !
> Would anyone have any idea how to go about changing what vim
> displays for certain characters ?
> All I'm asking for is, that vim prints to the screen a different
> character than the one that's there.
> EXAMPLE:
>
> FILE.txt: (normal vim)
> hello world :) abcdefghijklmnopqrstuvwxyz
> FILE.txt: (custom vim)
> he110 w0r1d :) @bcdefghijk1mn0pqrstuvwxyz

From your description, I'm unsure whether (1) vim doesn't behave this
way (remapping the display of characters) and you want it to, or (2)
vim does behave this way (remaps the display) and you *don't* want it
to.

If it's case #1 (I think this is what you're intending), you might
consider using gvim (or more drastically, your terminal emulator for
[non-g]vim) with a font that has the remapped display for the
characters you want. Alternatively, if the mapping is bidirectionally
uniform, you could pipe it through "tr" when reading the file in,
then pipe it through the reverse transformation when writing it back
out. For your example, you might pipe through

tr "[ao@0]" "[@0ao]"

when reading and then pipe the file back through the same
transformation when writing out.

If it's case #2, it would help to know what differs between the two.
Compare the output of ":version" as well as the scripts that are
being loaded (":scriptnames"). It would also help to know whether
you're running gvim or in a terminal (and if so, which terminal).

-tim



--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments: