« Return to Thread: highlighting "weird" characters...

Re: highlighting "weird" characters...[solved]

by Mitch Wiedemann-2 :: Rate this Message:

Reply to Author | View in Thread

Tobia wrote:

> Mitch Wiedemann wrote:
>  
>> " maps to quickly find Unicode characters within the document
>> map ,uni :match Error /[\x7f-\xff]/<CR>
>> map ,uni2 /[^ -~]<CR>
>>    
>
> FYI [\x7f-\xff] doesn't find non-ASCII characters that are also outside
> Latin-1, such as em-dash —, typographic quotes “”, ellipsis …, and the
> hundred thousand others defined by Unicode :-)  At least on my system.
>
> [^ -~] on the other hand finds all non-ASCII characters.
>
> You can use either one in both :match Error and /
>  

Ah! Good to know.  The characters you mention are some of the most
frequent offenders.

~/.vimrc updated...

" maps to quickly find unicode characters within the document
map ,uni :match Error /[^ -~]/<CR>
map ,uni2 /[^ -~]<CR>

 « Return to Thread: highlighting "weird" characters...