[Slackbuilds-users] slack-desc syntax file for Vim

Audrius Kažukauskas audrius at neutrino.lt
Mon Dec 10 18:24:21 UTC 2012


I have been using this slack-desc Vim syntax file which I wrote a couple
of years ago.  I recall intending to share it with this mailing list,
but somehow forgot to do so (probably was busy with something at the
time).  So now I'm correcting my mistake and sending this file attached
in hope that other slackers will find it useful.  To use slackdesc.vim,
put it in ~/.vim/syntax/ (if that directory doesn't exist, create it)
and place the following somewhere inside your ~/.vimrc:

  " Highlight SlackBuild description files.
  au BufNewFile,BufRead slack-desc set ft=slackdesc

Feedback (especially in form of patches ;-) is welcome!

Audrius Kažukauskas
-------------- next part --------------
" Vim syntax file
" Language:     slack-desc
" Maintainer:   Audrius Kažukauskas <audrius at neutrino.lt>
" Last Change:  2010-08-21
" Version:      0.1

if exists('b:current_syntax')

if has('spell')
  syn spell toplevel

syn region  sdComment   start='^\s*#' end='$'
syn region  sdRuler     start='^\s*|' end='|'
syn region  sdName      start='^\w'   end=':' nextgroup=sdDesc
syn match   sdDesc      '.\{0,71}' contained nextgroup=sdOverflow contains=@Spell
syn match   sdOverflow  '.*' contained contains=@Spell

hi def link sdComment   Comment
hi def link sdRuler     Label
hi def link sdName      String
hi def link sdOverflow  Error

let b:current_syntax='slackdesc'
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.slackbuilds.org/pipermail/slackbuilds-users/attachments/20121210/eebf3333/attachment.asc>

More information about the SlackBuilds-users mailing list