Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding rudimentary Fountain support #150

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Plugin | Description
[`language_elm`](plugins/language_elm.lua?raw=1) | Syntax for the [Elm](https://elm-lang.org) programming language
[`language_fe`](plugins/language_fe.lua?raw=1) | Syntax for the [fe](https://github.com/rxi/fe) programming language
[`language_fennel`](plugins/language_fennel.lua?raw=1) | Syntax for the [fennel](https://fennel-lang.org) programming language
[`language_fountain`](plugins/language_fountain.lua?raw=1) | Syntax for the [Fountain](https://fountain.io) screenplay Markdown syntax
[`language_gdscript`](plugins/language_gdscript.lua?raw=1) | Syntax for the [Godot Engine](https://godotengine.org/)'s GDScript scripting language
[`language_glsl`](plugins/language_glsl.lua?raw=1) | Syntax for the [GLSL](https://www.khronos.org/registry/OpenGL/specs/gl/) programming language
[`language_go`](plugins/language_go.lua?raw=1) | Syntax for the [Go](https://golang.org/) programming language
Expand Down
29 changes: 29 additions & 0 deletions plugins/language_fountain.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
local syntax = require "core.syntax"
local common = require "core.common"
local style = require "core.style"

style.syntax["header"] = { common.color "#66FF66" }
style.syntax["property"] = { common.color "#888888" }
style.syntax["paren"] = { common.color "#AAAAAA" }
style.syntax["caps"] = { common.color "#6666FF" }

syntax.add {
files = { "%.fountain$" },
patterns = {
{ pattern = { "/%*", "%*/" }, type = "comment" },
{ pattern = { "%[%[", "%]%]" }, type = "string" },
{ pattern = { "%(", "%)", "\\" }, type = "paren" },
{ pattern = "#.*\n", type = "header" },
{ pattern = "[a-zA-Z ]+%: .*\n", type = "property" },
{ pattern = "[^a-zA-Z ]+.*%: .*\n", type = "normal" },
{ pattern = "INT[%. ].*\n", type = "function" },
{ pattern = "EXT[%. ].*\n", type = "function" },
{ pattern = "EST[%. ].*\n", type = "function" },
{ pattern = "INT%.?/EXT[%. ].*\n", type = "function" },
{ pattern = "I/E[%. ].*\n", type = "function" },
{ pattern = "[A-Z][^a-z]+\n", type = "caps" },

},
symbols = {
},
}