Yakov Lerner wrote:
I have 'set listchars=tab:»·,trail:·' in my vimrc
(or equivalent set listchars=tab:\xbb\xb7,trail:\xb7). I also have
scriptencoding latin1. When I have enc=utf8, this works
in gvim. But in console vim, when I set encoding to utf8
in konsole, these »· characters are not see, and columns are
screwed when 'set list' on on. How do I fix it so that 'set list'
worked both in utf8 console and latin1 konsole ?

Thanks
Yakov



When switching over to UTF-8, if 'listchars' contains invalid bytes (such as bytes > 0x7F which are not part of a valid multi-byte UTF-8 sequence), the option becomes disabled. If you set 'encoding' yourself, try setting 'listchars' again immediately afterwards. Don't use the \xnn notation, which refers to _bytes_ not _characters_. You might try the following:

    exe "set list listchars=tab:\<Char-0xBB>\<Char-0xB7>,trail:\<Char-0xB7>"

(with double quotes), which ought to be interpreted correctly regardless of whether the current encoding is UTF-8 or Latin-1, and encode the characters properly for each (but differently).

If it still doesn't work, you could fall back on lower-ASCII characters, such as

        :set list listchars=tab:|_,trail:_


Best regards,
Tony.

Reply via email to