3 ms·
Mind sharing the relevant config line? I thought this was default but just realised it only does the <FFFF> thing when there is no printable glyph available.
by tomxor 5y ago
Mind sharing the relevant config line?
I thought this was default but just realised it only does the <FFFF> thing when there is no printable glyph available.
Allowing printable unicode in strings seems like a nice balance if it can be done reliably.
- fatheart 5y agoAfter seeing this thread I added the following to my vimrc: highlight link NonASCII Error autocmd Syntax * :syntax match NonASCII "[^\d0-\d127]" Obviously haven't been using it long, and I'm not confident enough in my vim knowledge to vouch for its correctness, but it works in the limited amount of scenarios I tested so far.
- kuon 5y agoSure: fun! HighlightNonAscii() if &ft =~ 'markdown\|text' return endif syntax match nonascii "[^\x00-\x7F]" highlight nonascii guibg=#ff2232 guifg=#000000 endfun autocmd BufEnter * call HighlightNonAscii() Your version might depend on your frontend (gui, terminal...). And you might want to filter more file types.