per filetype error match

2009-04-17 Thread fREW Schmidt
Hello all! I develop perl and javascript. I set up an error match (match Error /,\_s*[)}\]]) so that trailing commas will get highlighted for js as they crash IE. I put that in after/ftplugin/javascript.vim. The problem is that if I open a js file and then a perl file that error match is still a

Re: per filetype error match

2009-04-17 Thread Ben Schmidt
fREW Schmidt wrote: > Hello all! > > I develop perl and javascript. I set up an error match (match Error > /,\_s*[)}\]]) so that trailing commas will get highlighted for js as > they crash IE. I put that in after/ftplugin/javascript.vim. The > problem is that if I open a js file and then a

Re: per filetype error match

2009-04-18 Thread Ben Fritz
On Apr 17, 8:51 pm, Ben Schmidt wrote: > :augroup ClearMatches > :au! > :au FileType * match > :augroup END > > It's probably important for that to be before you turn on filetype detection > or > syntax highlighting in your .vimrc, because otherwise the autocommand will run > after the filety

Re: per filetype error match

2009-04-18 Thread StarWing
> Actually, to make this work properly, you'll probably just need to use > autocmds for the whole thing, rather than after/ftplugin. > > Something like this is a start: > > augroup CommaError > au! > " clear matches on most file types > autocmd Filetype * match > " match commas on end of line for

Re: per filetype error match

2009-04-19 Thread Ben Fritz
> no, I think what fREW need is this :h undo_ftplugin I could be wrong, but I really don't think undo_ftplugin is useful in this case. I'm not sure when undo_ftplugin gets executed, but the help you point out seems to imply it gets called when the user sets the file type on an existing buffer th