cabinfilm

git clone https://git.tarina.org/cabinfilm
Log | Files | Refs | README

fountain.vim (3477B)


      1 " Vim syntax file
      2 " Language:	Fountain screenplay
      3 " File: .fountain, .spmd, .txt
      4 " Reference: http://fountain.io/
      5 " Maintainer:	Carson Fire <carsonfire@gmail.com>
      6 " Last Change:	February 20, 2012
      7 " Version: 2.02	
      8 
      9 if exists("b:current_syntax")
     10   finish
     11 endif
     12 syn sync minlines=200
     13 
     14 syn match fountainSection1 "^\s*# \(\_[^#]\)" fold transparent contains=ALL
     15 syn region fountainTitlePage start="\%^\(.*\):" end="^$" contains=fountainBoneyard,fountainNotes
     16 syn match fountainCharacter "^\(\L\)*$" 
     17 syn region fountainDialogue matchgroup=fountainCharacter start="^\(\L\)*$" end="^\s*$" contains=fountainCharacter,fountainParenthetical,fountainBoneyard,fountainNotes,fountainEmphasis
     18 syn match fountainParenthetical "^\s*\((.*)\)$" contained contains=fountainBoneyard,fountainNotes
     19 syn match fountainTransition "^\(\L\)* TO:$" contains=fountainBoneyard,fountainNotes
     20 syn match fountainTransitionForced "^\s*>\(.*\)" contains=fountainBoneyard,fountainNotes
     21 syn match fountainCentered "^\s*>\(.*\)<" contains=fountainBoneyard,fountainNotes
     22 syn match fountainUnderlined "_[^_]*_" 
     23 syn match fountainItalic "\*[^\*]*\*"
     24 syn match fountainBold "\*\*[^\*]*\*\*"
     25 syn match fountainBoldItalic "\*\*\*[^\*]*\*\*\*" 
     26 syn match fountainPagebreak "^===[=]*$"
     27 syn region fountainNotes start="\[\[" end="\]\]" contains=xLineContinue
     28 syn region fountainHeader1 start="^\s*# " end="$" contains=fountainBoneyard,fountainNotes
     29 syn region fountainHeader2 start="^\s*## " end="$" contains=fountainBoneyard,fountainNotes
     30 syn region fountainHeader3 start="^\s*### " end="$" contains=fountainBoneyard,fountainNotes
     31 syn region fountainHeader4 start="^\s*#### " end="$" contains=fountainBoneyard,fountainNotes
     32 syn region fountainHeader5 start="^\s*##### " end="$" contains=fountainBoneyard,fountainNotes
     33 syn region fountainHeader6 start="^\s*###### " end="$" contains=fountainBoneyard,fountainNotes
     34 syn region fountainSynopses start="^\s*= " end="$" contains=fountainBoneyard,fountainNotes
     35 syn region fountainSceneHeading start="^\s*\(\.\|INT\. \|EXT\. \|INT\./EXT\. \|INT/EXT\. \|INT \|EXT \|INT/EXT \|I/E \|int\. \|ext\. \|int\./ext\. \|int/ext\. \|int \|ext \|int/ext \|i/e \)" end="$" contains=fountainSceneNumber,fountainBoneyard,fountainNotes 
     36 syn region fountainBoneyard start="/\*" end="\*\/" contains=xLineContinue
     37 syn match xLineContinue "\\$" contained
     38 syn region fountainSceneNumber start="#" end="#" contained
     39 
     40 hi def link fountainTitlePage		    title
     41 hi def link fountainSceneHeading	    title
     42 hi def link fountainCharacter			identifier 
     43 hi def link fountainDialogue			statement
     44 hi def link fountainParenthetical		function
     45 hi def link fountainTransition			todo
     46 hi def link fountainTransitionForced	todo
     47 hi def link fountainCentered			character
     48 hi fountainUnderlined					gui=underline
     49 hi fountainItalic						gui=italic cterm=italic	
     50 hi fountainBold							gui=bold cterm=bold	
     51 hi fountainBoldItalic					gui=bold,italic cterm=bold,italic	
     52 hi def link fountainPagebreak			conditional
     53 hi def link fountainActionForced		normal
     54 hi def link fountainNotes				comment
     55 hi def link fountainBoneyard			nontext	
     56 hi def link fountainHeader1				htmlH1	
     57 hi def link fountainHeader2				htmlH2	
     58 hi def link fountainHeader3				htmlH3	
     59 hi def link fountainHeader4				htmlH4	
     60 hi def link fountainHeader5				htmlH5	
     61 hi def link fountainHeader6				htmlH6	
     62 hi def link fountainSynopses			number
     63 hi def link fountainSceneNumber			number	
     64 let b:current_syntax = "fountain"
     65 highlight LineNr ctermfg=black
     66 set columns=80