Tuesday, September 7, 2010

Re: convenient settings for /etc/motd etc. that has multi-character color codes

On Tue, Sep 07, 2010 at 01:26:32PM -0700, Rahul wrote:
> Is there a convenient way to edit /etc/motd (or for that matter any
> other file that has color codes / multibyte characters in it)? The
> usual problem is that many if the file has a color code (say,
> ^[[33m^[[1m ) then this occupies multiple characters in the editor but
> zero characters when finally displayed. Hence it is hard to get the
> alignment right without lots of trial and error. For an example see
> below.
>
> I was wondering if vim had a smart way of dealing with this?!

You could use the new conceal support in Vim 7.3.

I've not yet updated so I can't give you any examples. Maybe [1]
helps.

[1]: http://b4winckler.wordpress.com/2010/08/07/using-the-conceal-vim-feature-with-latex/

Hope this helps,
Simon
--
+ privacy is necessary
+ using gnupg http://gnupg.org
+ public key id: 0x92FEFDB7E44C32F9

No comments:

Post a Comment