diff options
author | Matěj Cepl <mcepl@cepl.eu> | 2022-01-04 23:29:39 +0100 |
---|---|---|
committer | Matěj Cepl <mcepl@cepl.eu> | 2024-01-18 09:45:54 +0100 |
commit | ad0436dce205a646d63aff21a1fbb774e90a7497 (patch) | |
tree | b37a550008d6385634458a52bbbd88999b260d09 /syntax | |
parent | c3b70e96636fe223766cdd1b3b8ff21df1e0c302 (diff) | |
download | fountain.vim-ad0436dce205a646d63aff21a1fbb774e90a7497.tar.gz |
Add filetype.lua with the detection of fountain file.
Diffstat (limited to 'syntax')
-rw-r--r-- | syntax/fountain.vim | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/syntax/fountain.vim b/syntax/fountain.vim new file mode 100644 index 0000000..fc08043 --- /dev/null +++ b/syntax/fountain.vim @@ -0,0 +1,67 @@ +" Vim syntax file +" Language: Fountain screenplay +" File: .fountain, .spmd, .txt +" Reference: http://fountain.io/ +" Maintainer: Carson Fire <carsonfire@gmail.com> +" Last Change: February 20, 2012 +" Version: 2.02 + +if exists("b:current_syntax") + finish +endif +syn sync minlines=200 + +syn match fountainSection1 "^\s*# \(\_[^#]\)" fold transparent contains=ALL +syn region fountainTitlePage start="\%^\(.*\):" end="^$" contains=fountainBoneyard,fountainNotes +syn match fountainCharacter "^\(\L\)*$" +syn region fountainDialogue matchgroup=fountainCharacter start="^\(\L\)*$" end="^\s*$" contains=fountainCharacter,fountainParenthetical,fountainBoneyard,fountainNotes,fountainEmphasis +syn match fountainParenthetical "^\s*\((.*)\)$" contained contains=fountainBoneyard,fountainNotes +syn match fountainTransition "^\(\L\)* TO:$" contains=fountainBoneyard,fountainNotes +syn match fountainTransitionForced "^\s*>\(.*\)" contains=fountainBoneyard,fountainNotes +syn match fountainCentered "^\s*>\(.*\)<" contains=fountainBoneyard,fountainNotes +syn match fountainUnderlined "_[^_]*_" +syn match fountainItalic "\*[^\*]*\*" +syn match fountainBold "\*\*[^\*]*\*\*" +syn match fountainBoldItalic "\*\*\*[^\*]*\*\*\*" +syn match fountainPagebreak "^===[=]*$" +syn region fountainNotes start="\[\[" end="\]\]" contains=xLineContinue,fountainTodo +syn region fountainHeader1 start="^\s*# " end="$" contains=fountainBoneyard,fountainNotes +syn region fountainHeader2 start="^\s*## " end="$" contains=fountainBoneyard,fountainNotes +syn region fountainHeader3 start="^\s*### " end="$" contains=fountainBoneyard,fountainNotes +syn region fountainHeader4 start="^\s*#### " end="$" contains=fountainBoneyard,fountainNotes +syn region fountainHeader5 start="^\s*##### " end="$" contains=fountainBoneyard,fountainNotes +syn region fountainHeader6 start="^\s*###### " end="$" contains=fountainBoneyard,fountainNotes +syn region fountainSynopses start="^\s*= " end="$" contains=fountainBoneyard,fountainNotes +syn region fountainSceneHeading start="^\s*\(\.[^\.]\|INT\. \|EXT\. \|INT\./EXT\. \|INT/EXT\. \|INT \|EXT \|INT/EXT \|I/E \|EST\. \|int\. \|ext\. \|int\./ext\. \|int/ext\. \|int \|ext \|int/ext \|i/e \|est\. \)" end="$" contains=fountainSceneNumber,fountainBoneyard,fountainNotes +syn region fountainBoneyard start="/\*" end="\*\/" contains=xLineContinue +syn match xLineContinue "\\$" contained +syn region fountainSceneNumber start="#" end="#" contained +syn keyword fountainTodo contained FIXME TODO XXX NOTE + +hi def link fountainTodo Todo +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 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 fountainHeader1 htmlH1 +hi def link fountainHeader2 htmlH2 +hi def link fountainHeader3 htmlH3 +hi def link fountainHeader4 htmlH4 +hi def link fountainHeader5 htmlH5 +hi def link fountainHeader6 htmlH6 +hi def link fountainSynopses number +hi def link fountainSceneNumber number + +let b:current_syntax = "fountain" |