specky/syntax/rdoc.vim
author mahlon
Fri, 03 Apr 2009 23:34:00 +0000
branchvim-stuff
changeset 5 3346aa8d5364
parent 2 6b33188f1694
permissions -rw-r--r--
Add snippets and rspec syntax highlights.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
     1
"
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
     2
" specky: syntax highlighting for 'rdoc' output
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
     3
" $Id$
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
     4
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
     5
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
     6
" Separator lines
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
     7
"
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
     8
syntax match rdocSpeckyLines /^------\+\s\?/ contains=rdocSpeckyTarget,rdocSpeckyMultiples
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
     9
highlight link rdocSpeckyLines Comment
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    10
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    11
" The class/method that we're reading
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    12
"
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    13
syntax match rdocSpeckyTarget / .\+/hs=s+1 contained
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    14
highlight link rdocSpeckyTarget Underlined
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    15
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    16
" When there are multiple matches to choose from.
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    17
" This is only output by fri.
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    18
"
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    19
syntax match rdocSpeckyMultiples / Multiple choices/hs=s+1 contained
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    20
highlight link rdocSpeckyMultiples WarningMsg
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    21
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    22
" Secondary headers
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    23
"
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    24
syntax region rdocSpeckyHeader start="^\S\+.\+:$\n-\+" end="-$" keepend contains=rdocSpeckyHeaderLine
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    25
highlight link rdocSpeckyHeader Question
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    26
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    27
" Secondary header lines
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    28
"
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    29
syntax match rdocSpeckyHeaderLine /^-\+$/ contained 
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    30
highlight link rdocSpeckyHeaderLine NonText
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    31
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    32
" Remove the formatting characters from the display
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    33
"
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    34
highlight link rdocSpeckySpecials NonText
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    35
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    36
" _word_ --> italic
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    37
"
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    38
syntax region rdocSpeckyItalic matchgroup=rdocSpeckySpecials start=" _" end="_"
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    39
highlight link rdocSpeckyItalic Special
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    40
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    41
" *word* --> bold
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    42
"
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    43
syntax region rdocSpeckBold matchgroup=rdocSpeckySpecials start=" \*" end="\*"
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    44
highlight link rdocSpeckyBold Constant
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    45
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    46
" +word+ --> typewriter
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    47
"
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    48
syntax region rdocSpeckyType matchgroup=rdocSpeckySpecials start=" +" end="+"
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    49
highlight link rdocSpeckyType Identifier
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    50
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    51
let b:current_syntax = "rdoc"
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    52