aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fountain.vim64
-rw-r--r--spmd.vim47
2 files changed, 64 insertions, 47 deletions
diff --git a/fountain.vim b/fountain.vim
new file mode 100644
index 0000000..c73c3d7
--- /dev/null
+++ b/fountain.vim
@@ -0,0 +1,64 @@
+" Vim syntax file
+" Language: Fountain screenplay
+" File: .fountain, .spmd, .txt
+" Reference: http://fountain.io/
+" Maintainer: Carson Fire <carsonfire@gmail.com>
+" Last Change: February 9, 2012
+" Version: 2.0
+
+if exists("b:current_syntax")
+ finish
+endif
+syn sync minlines=200
+
+syn region fountainTitlePage start="\%^\(.*\):" end="^$"
+syn match fountainCharacter "^\(\d\|\u\|\s\|\W\)*$" contains=fountainDualDialogue
+syn region fountainDialogue matchgroup=fountainCharacter start="^\(\d\|\u\|\s\|\W\)*$" end="^\s*$" contains=fountainCharacter,fountainParenthetical,fountainBoneyard
+syn match fountainParenthetical "^\s*\((.*)\)$" contained
+syn match fountainDualDialogue "\^$" contained
+syn match fountainTransition "^\(\d\|\u\|\s\|\W\)* TO:$"
+syn match fountainTransitionForced "^\s*>\(.*\)"
+syn match fountainCentered "^\s*>\(.*\)<"
+syn match fountainUnderlined "_[^_]*_"
+syn match fountainItalic "\*[^\*]*\*"
+syn match fountainBold "\*\*[^\*]*\*\*"
+syn match fountainBoldItalic "\*\*\*[^\*]*\*\*\*"
+syn match fountainPagebreak "^===[=]*$"
+"syn region fountainActionForced start="^\(\d\|\u\|\s\|\W\)*" end="[ ]$"
+syn region fountainNotes start="\[\[" end="\]\]"
+syn region fountainSection1 start="^\s*# " end="$"
+syn region fountainSection2 start="^\s*## " end="$"
+syn region fountainSection3 start="^\s*### " end="$"
+syn region fountainSection4 start="^\s*#### " end="$"
+syn region fountainSection5 start="^\s*##### " end="$"
+syn region fountainSection6 start="^\s*###### " end="$"
+syn region fountainSynopses start="^\s*= " end="$"
+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="$"
+syn match fountainBoneyard "/\*\(\_[^\*]\)*\*/"
+
+hi def link fountainTitlePage title
+hi def link fountainSceneHeading title
+hi def link fountainCharacter identifier
+hi def link fountainDialogue statement
+hi def link fountainParenthetical function
+hi def link fountainDualDialogue conditional
+hi def link fountainTransition todo
+hi def link fountainTransitionForced todo
+hi def link fountainCentered character
+hi fountainUnderlined gui=underline
+hi fountainItalic gui=italic cterm=italic
+hi fountainBold gui=bold cterm=bold
+hi fountainBoldItalic gui=bold,italic cterm=bold,italic
+hi def link fountainPagebreak conditional
+hi def link fountainActionForced normal
+hi def link fountainNotes comment
+hi def link fountainBoneyard nontext
+hi def link fountainSection1 htmlH1
+hi def link fountainSection2 htmlH2
+hi def link fountainSection3 htmlH3
+hi def link fountainSection4 htmlH4
+hi def link fountainSection5 htmlH5
+hi def link fountainSection6 htmlH6
+hi def link fountainSynopses number
+
+let b:current_syntax = "fountain"
diff --git a/spmd.vim b/spmd.vim
deleted file mode 100644
index 99bcb7c..0000000
--- a/spmd.vim
+++ /dev/null
@@ -1,47 +0,0 @@
-" Vim syntax file
-" Language: Screenplay Markdown (provisional)
-" Maintainer: Carson Fire
-" Filenames: *.spmd
-" Last Change: 2012 January 14
-" Version: 1.1
-
-if exists("b:current_syntax")
- finish
-endif
-
-syn case match
-
-syn region spmdSceneheading start="^\(\.\|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="$"
-syn region spmdDialogue matchgroup=spmdCharacter start="\n^\t*\s*[ A-ZÅÄÖ][.\ A-ZÅÄÖ(]*[.\A-ZÅÄÖ)^]$" end="^$" contains=spmdParenthetical, spmdJoint
-syn region spmdComment start="\[\[" end="\]\]"
-syn region spmdSynopses start="{{" end="}}"
-
-syn match spmdPagebreak "^===[=]*$"
-syn match spmdUnderline "_[^_]*_"
-syn match spmdItalic "\*[^\*]*\*"
-syn match spmdBold "\*\*[^\*]*\*\*"
-syn match spmdBolditalic "\*\*\*[^\*]*\*\*\*"
-syn match spmdParenthetical "^\t*\s*\((.*)\)$" contained
-syn match spmdTransition ">\t*\s*[/. A-ZÅÄÖ]*$"
-syn match spmdTransition "\t*\s*[/. A-ZÅÄÖ]*:$"
-syn match spmdCentered "^\t*\s*>[^$]*<"
-syn match spmdDoublespace " $"
-" syn match spmdJoint "||\n[' A-ZÅÄÖ()]*$" contained
-
-hi def spmdUnderline gui=underline
-hi def spmdItalic gui=italic cterm=italic
-hi def spmdBold gui=bold cterm=bold
-hi def spmdBolditalic gui=bold,italic cterm=bold,italic
-hi def link spmdSynopses special
-hi def link spmdComment comment
-hi def link spmdPagebreak constant
-hi def link spmdDoublespace statusline
-hi def link spmdCharacter tag
-hi def link spmdDialogue string
-hi def link spmdParenthetical function
-hi def link spmdSceneheading title
-hi def link spmdTransition conditional
-hi def link spmdCentered statement
-" hi def link spmdJoint spmdCharacter
-
-