ulf wrote:
I was very surprised to see that there is actually a syntax highlighting mode especially built for abc files. What a nice view - the lines with "campi di informazioni" all green, the chords blue, the notes red, how beautiful! But some newer features like !coda! don't seem to be interpreted correctly.

For your viewing pleasure, a simple patch that highlights !symbols! in the same way as guitar chords...


--
Bert Van Vreckem

If Bill Gates had a penny for each time Windows crashed...
Wait a minute! He does!
--- /home/bert/tmp/abc.vim      Sat Mar 15 15:51:55 2003
+++ /usr/share/vim/vim60/syntax/abc.vim Sat Mar 15 15:50:37 2003
@@ -4,8 +4,6 @@
 " URL:         http://perun.hscs.wmin.ac.uk/~jra/vim/syntax/abc.vim
 " Last Change: 27th April 2001
 
-" Remove any old syntax stuff hanging around
-
 " For version 5.x: Clear all syntax items
 " For version 6.x: Quit when a syntax file was already loaded
 if version < 600
@@ -33,9 +31,9 @@
 syn match abcHeadField "^[A-EGHIK-TVWXZ]:.*$" contained
 syn match abcBodyField "^[KLMPQWVw]:.*$" contained
 syn region abcHeader start="^X:" end="^K:.*$" contained 
contains=abcHeadField,abcComment keepend
-syn region abcTune start="^X:" end="^ *$" 
contains=abcHeader,abcComment,abcBar,abcNote,abcBodyField,abcGuitarChord,abcTuple,abcBroken,abcTie
+syn region abcTune start="^X:" end="^ *$" 
contains=abcHeader,abcComment,abcBar,abcNote,abcBodyField,abcGuitarChord,abcTuple,abcBroken,abcTie,abcSymbol
 syn match abcComment "%.*$"
-
+syn region abcSymbol start=+![^!]+ end=+!+ contained
 
 " Define the default highlighting.
 " For version 5.7 and earlier: only when not done already
@@ -57,6 +55,7 @@
   HiLink abcTie                        Statement
   HiLink abcGuitarChord        Identifier
   HiLink abcNote                       Constant
+  HiLink abcSymbol             Identifier
 
   delcommand HiLink
 endif

Reply via email to