aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcarson fire <carsonfire@gmail.com>2012-02-09 00:00:00 +0100
committerMatěj Cepl <mcepl@cepl.eu>2024-01-18 09:37:46 +0100
commit3a2754aa37dc30d597064ba990c50d83019ea674 (patch)
tree6939d9898ed492fecb350fb1224c835d985c07df
parent65592d98c4159c51ac527f2f16267902841d1098 (diff)
downloadfountain.vim-3a2754aa37dc30d597064ba990c50d83019ea674.tar.gz
SPMD is now Fountain!2.0
Although much is the same, this version reflects some important changes in the official syntax, and this version simply works better in Vim than the previous one. Please do not use the old spmd.vim, use fountain.vim instead!
-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
-
-