First, my problem description:

I have a mapping that sets binary mode, calls xxd, and then sets the
xxd filetype (among other things...it's based off
http://vim.wikia.com/wiki/Improved_Hex_editing).

Since I'm on Windows, the xxd program I have terminates all line
endings with \r. But since binary is set, Vim is forced into using the
unix fileformat. Therefore, all these \r characters show up at the end
of every line.

I know I can use :match Ignore /\r$/ to hide all of them (I tried it
and it works), but it takes a lot of trouble to get window-local
options applied correctly for every window this buffer can be in. So,
I tried this instead, in ~/vimfiles/after/syntax/xxd.vim:

syntax match xxdLineFeed "\r$" containedin=xxdDot
hi link xxdLineFeed Ignore

This does NOT work, and I can't figure out why.

Viewing the syntax stack on the \r character shows:

<Ignore> from:
<xxdAscii>
 <xxdDot>
  <xxdLineFeed>

So the highlight group seems to be correct, but something is
overwriting it. Match still takes precedence though.

Is :syntax not usable for this? What's preventing it from being usable if not?

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

Reply via email to