On 6/19/06, Bram Moolenaar <[EMAIL PROTECTED]> wrote:

Yakov Lerner wrote:

> This is syntax file for /var/log/messages.
> Here is patch for filetype.vim:
>
> --- filetype.vim.000    2006-06-12 18:47:26.000000000 +0000
> +++ filetype.vim        2006-06-12 18:48:29.000000000 +0000
> @@ -888,6 +888,9 @@
>  " Makefile
>  au BufNewFile,BufRead *[mM]akefile,*.mk,*.mak,*.dsp setf make
>
> +" /var/log/messages
> +au BufNewFile,BufRead /var/log/messages*,messages setf messages
> +
>  " MakeIndex
>  au BufNewFile,BufRead *.ist,*.mst              setf ist

Thanks.  The syntax file looks OK.

For detecting the filetype, "messages" is very generic, it might be
detected wrongly.  Also, ending a pattern in * is dangerous, it can
match messages.readme, for example.

How about using this instead:

" Messages
au BufNewFile,BufRead /var/log/messages,/var/log/messages.*[0-9]  setf messages

It works for me, since I have this in /var/log:

        /var/log/messages
        /var/log/messages.0.bz2
        /var/log/messages.1.bz2
        /var/log/messages.2.bz2
        /var/log/messages.3.bz2
        /var/log/messages.4.bz2
        /var/log/messages.5.bz2

Yes I agree , it's better.

Yakov

Reply via email to