From 65592d98c4159c51ac527f2f16267902841d1098 Mon Sep 17 00:00:00 2001 From: carson fire Date: Sat, 14 Jan 2012 01:00:00 +0100 Subject: Corrections and changes (new specs released on 1/13/2012) * Because of potential conflict, no longer link to Markdown syntax for italics and bold--this is now implemented independently, and only in action lines and any other non-formatted sections * Included all the possible scene headers from the SPMD appendix, uppercase and lower * Spaces and tabs allowed before character name, parenthetical, and dialogue * Spaces at end "corrects" non-character name uppercase line * EOL double-space highlighting * Parentheticals allowed on character name line (must be in caps) * Cut line allows colon at end, or greater-than symbol at beginning * Forced scene headings * Revised dual dialogue syntax (previous syntax commented out in case of future revisions) * Page breaks Not yet supported: * Title page formatting (specs say this will change substantially anyway) * Italics, bold, and underline within dialogue and other contained areas * Sections --- spmd.vim | 47 ++++++++++++++++++++++++++++++----------------- 1 file changed, 30 insertions(+), 17 deletions(-) diff --git a/spmd.vim b/spmd.vim index 0067cdc..99bcb7c 100644 --- a/spmd.vim +++ b/spmd.vim @@ -2,33 +2,46 @@ " Language: Screenplay Markdown (provisional) " Maintainer: Carson Fire " Filenames: *.spmd -" Last Change: 2012 January 13 +" Last Change: 2012 January 14 +" Version: 1.1 if exists("b:current_syntax") finish endif -runtime! syntax/markdown.vim -unlet! b:current_syntax - syn case match -syn region spmdSetting start="^\(INT\.\|EXT\.\)" end="$" -syn region spmdDialogue start="^[' A-ZÅÄÖ]*$" end="^$" -syn region spmdDialogue matchgroup=spmdCharacter start="^[' A-ZÅÄÖ]*$" end="^$" contains=spmdParenthetical, spmdJoint -syn match spmdParenthetical "^\((.*)\)$" contained -syn match spmdJoint "||\n[' A-ZÅÄÖ]*$" contained -syn match spmdCentered "^>[^$]*<" -syn match spmdTransition ".*CUT TO:" -syn match spmdSetting ".*POV$" -syn match spmdSetting "OPENING TITLES" +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 spmdJoint spmdCharacter -hi def link spmdSetting boolean +hi def link spmdSceneheading title hi def link spmdTransition conditional -hi def link spmdDirection comment -hi def link spmdCentered title +hi def link spmdCentered statement +" hi def link spmdJoint spmdCharacter + -- cgit