You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Adam Katz <an...@khopis.com> on 2009/04/07 01:52:39 UTC

spamassassin.cf Vim syntax file

Here's a syntax file I created for Vim to highlight SpamAssassin
config files (see attached).  To enable it, add this to your
~/.vim/filetype.vim (which you may have to create):


augroup filetypedetect
    au BufRead,BufNewFile *.cf setfiletype spamassassin
augroup END


(If you already have augroup filetypedetect, just add it to that
nesting.)  Save the attached file as ~/.vim/syntax/spamassassin.vim

To install it system-wide, save the attached file as
/usr/share/vim/vim[0-9]*/syntax/spamassassin.vim and edit
/usr/share/vim/vim[0-9]*/filetype.vim in a manner similar to the local
filetype.vim edit noted above (in my /usr/share/vim/vim71/fileytpe.vim
for vim 7.1.314-3+lenny2, it would be added at line 2254, right above
'" Vim script').

Feedback would be appreciated.  Once some time goes by without further
tweaks/discussion, I'll try submitting it to Vim proper.

Cheers!
-Adam
http://khopesh.com/Anti-spam

Re: spamassassin.cf Vim syntax file

Posted by Stefan Luetje <st...@t-online.de>.
Am 24. Apr 2009 um 00:39 CEST schrieb Adam Katz:
> I wrote:
> >> Here's a syntax file I created for Vim to highlight SpamAssassin
> >> config files ...
> 
> I've since done some major editing, including spell-check on the bits
> that should have it and better support for languages and other things,
> plus some bug-fixing of various elements imported from the perl
> highlighting that I started with as a base.

Thanks

> Stefan Luetje wrote:
> >   au BufRead,BufNewFile *.cf,user_prefs setfiletype spamassassin
> 
> Thanks, Stefan.  I'm glad you find the script useful enough to tweak.
> That line should now look like this:
> 
> au BufRead,BufNewFile user_prefs,*.cf,*.pre setfiletype spamassassin

Nice when I can help, spamassassin.vim is very useful for me. 

I added 'uricountry' for URICountry.cf:

,----[ spamassassin.vim ]
| < syn keyword saType header describe score meta body rawbody full lang contained
| ---
| > syn keyword saType header describe score meta body rawbody full lang uricountry contained
`----

> The updated syntax file is now published at
> http://www.vim.org/scripts/script.php?script_id=2617
 

Greets
Stefan

-- 
Stefan Lütje <st...@t-online.de>                Skelli@jabber.ccc.de
    Key fingerprint = BCB2 48E4 9211 C975 5A3F  B192 9B6E CCCF 99CC 44FA

Re: spamassassin.cf Vim syntax file

Posted by Adam Katz <an...@khopis.com>.
I wrote:
>> Here's a syntax file I created for Vim to highlight SpamAssassin
>> config files ...

I've since done some major editing, including spell-check on the bits
that should have it and better support for languages and other things,
plus some bug-fixing of various elements imported from the perl
highlighting that I started with as a base.

Stefan Luetje wrote:
>   au BufRead,BufNewFile *.cf,user_prefs setfiletype spamassassin

Thanks, Stefan.  I'm glad you find the script useful enough to tweak.
That line should now look like this:

au BufRead,BufNewFile user_prefs,*.cf,*.pre setfiletype spamassassin

The updated syntax file is now published at
http://www.vim.org/scripts/script.php?script_id=2617

-- 
Adam Katz
khopesh on irc://irc.freenode.net/#spamassassin
http://khopesh.com/Anti-spam

Re: spamassassin.cf Vim syntax file

Posted by Stefan Luetje <st...@t-online.de>.
Am 07. Apr 2009 um 01:52 CEST schrieb Adam Katz:
> Here's a syntax file I created for Vim to highlight SpamAssassin
> config files (see attached).  

Thanks
 
> augroup filetypedetect
>     au BufRead,BufNewFile *.cf setfiletype spamassassin
> augroup END

I change this to:
,----
| ugroup filetypedetect
|     au BufRead,BufNewFile *.cf,user_prefs setfiletype spamassassin
| augroup END
`----

Sorry, my English is very bad


Greets
Stefan

-- 
Stefan Lütje <st...@t-online.de>                Skelli@jabber.ccc.de
    Key fingerprint = BCB2 48E4 9211 C975 5A3F  B192 9B6E CCCF 99CC 44FA