On 24/12/08 15:45, Richard Hartmann wrote:
> On Wed, Dec 24, 2008 at 05:12, Tony Mechelynck
> <[email protected]>  wrote:
>
>> Don't. I use ":set list lcs=tab:\|_,eol:¶,nbsp:~" (and, in the light of
>> another thread, I don't forget to set 'encoding' to UTF-8 first, not
>> afterwards, if the locale is something else).
>
> if&encoding == "utf-8"
>      set listchars=eol:$,trail:·,tab:»·,extends:>,precedes:<
> else
>      set listchars=eol:$,trail:-,tab:>-,extends:>,precedes:<
> endif
>
> That way, I can work on legacy/broken systems, as well.
>
>
> Richard

The characters I use are all below 0xFF, but the Pilcrow mark (0xB6) is 
represented differently in Latin1 and in UTF-8, so I mustn't change 
encodings after setting the value. My encoding-handling snippet is near 
the top of my vimrc, framed within "if has('multi_byte')" so on 
trimmed-down versions (such as my tiny "vi" build) I may remain in 
Latin1 and use the same 'listchars'. What I don't understand though, is 
that vi displays a hollow box in konsole, a reverse-video question mark 
on /dev/tty, while Vim displays the Pilcrow mark in both -- and yet, my 
.vimrc has "scriptencoding latin1"... Maybe the terminals don't 
understand a Pilcrow mark in Latin1...

OK, let's do it slightly differently -- and remember that vi has no 
expression evaluation, so every :if counts as a comment there: it's no 
use trying to set values for it in an else-clause.

set list listchars=eol:$
if has('multi_byte')
        set listchars=eol:¶
endif
set listchars+=tab:\|_
silent! set listchars+=nbsp:~

...it works: vi now displays a dollar sign, and vim a Pilcrow mark.


Best regards,
Tony.
-- 
No good deed goes unpunished.
                -- Clare Boothe Luce

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to