diff options
-rw-r--r-- | README.md | 3 | ||||
-rw-r--r-- | plugins/language_odin.lua | 56 | ||||
-rw-r--r-- | plugins/language_teal.lua | 55 | ||||
-rw-r--r-- | plugins/tabnumbers.lua | 27 |
4 files changed, 103 insertions, 38 deletions
@@ -62,6 +62,7 @@ Plugin | Description [`language_psql`](plugins/language_psql.lua?raw=1) | Syntax for the postgresql database access language [`language_rust`](plugins/language_rust.lua?raw=1) | Syntax for the [Rust](https://rust-lang.org/) programming language [`language_sh`](plugins/language_sh.lua?raw=1) | Syntax for shell scripting language +[`language_teal`](plugins/language_teal.lua?raw=1) | Syntax for the [Teal](https://github.com/teal-language/tl) programming language, a typed dialect of Lua. [`language_tex`](plugins/language_tex.lua?raw=1) | Syntax for the [LaTeX](https://www.latex-project.org/) typesetting language [`language_wren`](plugins/language_wren.lua?raw=1) | Syntax for the [Wren](http://wren.io/) programming language [`lastproject`](plugins/lastproject.lua?raw=1) | Loads the last loaded project if lite is launched without any arguments @@ -69,6 +70,7 @@ Plugin | Description [`linecopypaste`](plugins/linecopypaste.lua?raw=1) | Copy, cut and paste the current line when nothing is selected [`lineguide`](plugins/lineguide.lua?raw=1) | Displays a line-guide at the line limit offset *([screenshot](https://user-images.githubusercontent.com/3920290/81476159-2cf70000-9208-11ea-928b-9dae3884c477.png))* [`linter`](https://github.com/drmargarido/linters)* | Linters for multiple languages +[`lint+`](https://github.com/liquid600pgm/lintplus)* | Advanced linter with ErrorLens-like error reporting. Compatible with linters made for `linter` *([screenshot](https://raw.githubusercontent.com/liquid600pgm/lintplus/master/screenshots/1.png))* [`macmodkeys`](plugins/macmodkeys.lua?raw=1) | Remaps mac modkeys `command/option` to `ctrl/alt` [`markers`](plugins/markers.lua?raw=1) | Add markers to docs and jump between them quickly *([screenshot](https://user-images.githubusercontent.com/3920290/82252149-5faaa200-9946-11ea-9199-bea2efb7ee23.png))* [`motiontrail`](plugins/motiontrail.lua?raw=1) | Adds a motion-trail to the caret *([screenshot](https://user-images.githubusercontent.com/3920290/83256814-085ccb00-a1ab-11ea-9e35-e6633cbed1a9.gif))* @@ -81,6 +83,7 @@ Plugin | Description [`selectionhighlight`](plugins/selectionhighlight.lua?raw=1) | Highlights regions of code that match the current selection *([screenshot](https://user-images.githubusercontent.com/3920290/80710883-5f597c80-8ae7-11ea-97f0-76dfacc08439.png))* [`sort`](plugins/sort.lua?raw=1) | Sorts selected lines alphabetically [`spellcheck`](plugins/spellcheck.lua?raw=1) | Underlines misspelt words *([screenshot](https://user-images.githubusercontent.com/3920290/79923973-9caa7400-842e-11ea-85d4-7a196a91ca50.png))* *— note: on Windows a [`words.txt`](https://github.com/dwyl/english-words/blob/master/words.txt) dictionary file must be placed beside the exe* +[`tabnumbers`](plugins/tabnumbers.lua?raw=1) | Displays tab numbers from 1–9 next to their names *([screenshot](https://user-images.githubusercontent.com/16415678/101285362-007a8500-37e5-11eb-869b-c10eb9d9d902.png)) [`theme16`](https://github.com/monolifed/theme16)* | Theme manager with base16 themes [`titleize`](plugins/titleize.lua?raw=1) | Titleizes selected string (`hello world` => `Hello World`) [`todotreeview`](https://github.com/drmargarido/TodoTreeView)* | Todo tree viewer for annotations in code like `TODO`, `BUG`, `FIX`, `IMPROVEMENT` diff --git a/plugins/language_odin.lua b/plugins/language_odin.lua index fb60a6c..c3413f2 100644 --- a/plugins/language_odin.lua +++ b/plugins/language_odin.lua @@ -4,23 +4,23 @@ syntax.add { files = "%.odin$", comment = "//", patterns = { - { pattern = "//.-\n", type = "comment" }, - { pattern = { "/%*", "%*/" }, type = "comment" }, - { pattern = { '"', '"', '\\' }, type = "string" }, - { pattern = { "'", "'", '\\' }, type = "string" }, - { pattern = { "`", "`" }, type = "string" }, - { pattern = "0b[01_]+", type = "number" }, - { pattern = "0o[0-7_]+", type = "number" }, - { pattern = "0[dz][%d_]+", type = "number" }, - { pattern = "0x[%da-fA-F_]+", type = "number" }, - { pattern = "-?%d+[%d%._e]*i?", type = "number" }, - { pattern = "-?%.?[%d_]+i?", type = "number" }, - { pattern = "[<>~=+-*/]=", type = "operator" }, - { pattern = "[::][:=]", type = "operator" }, - { pattern = "[%+%-=/%*%^%%<>!~|&:]", type = "operator" }, - { pattern = "%$[%a_][%w_]*", type = "operator" }, - { pattern = "[%a_][%w_]*%f[(]", type = "function" }, - { pattern = "[#@]?[%a_][%w_]*", type = "symbol" }, + { pattern = "//.-\n", type = "comment" }, + { pattern = { "/%*", "%*/" }, type = "comment" }, + { pattern = { '"', '"', '\\' }, type = "string" }, + { pattern = { "'", "'", '\\' }, type = "string" }, + { pattern = { "`", "`" }, type = "string" }, + { pattern = "0b[01_]+", type = "number" }, + { pattern = "0o[0-7_]+", type = "number" }, + { pattern = "0[dz][%d_]+", type = "number" }, + { pattern = "0x[%da-fA-F_]+", type = "number" }, + { pattern = "-?%d+[%d%._e]*i?", type = "number" }, + { pattern = "[<>~=+-*/]=", type = "operator" }, + { pattern = "[%+%-=/%*%^%%<>!~|&:]", type = "operator" }, + { pattern = "%$[%a_][%w_]*", type = "operator" }, + { pattern = "[%a_][%w_]*%f[(]", type = "function" }, + { pattern = "[#@][%a_][%w_]*", type = "keyword2" }, + { pattern = "[#@]%b()", type = "keyword2" }, + { pattern = "[%a_][%w_]*", type = "symbol" }, }, symbols = { -- Keywords @@ -36,7 +36,7 @@ syntax.add { ["switch"] = "keyword", ["case"] = "keyword", ["in"] = "keyword", - ["notin"] = "keyword", + ["not_in"] = "keyword", ["do"] = "keyword", ["break"] = "keyword", ["continue"] = "keyword", @@ -79,26 +79,6 @@ syntax.add { ["abs"] = "keyword2", ["clamp"] = "keyword2", ["assert"] = "keyword2", - ["#assert"] = "keyword2", - ["#location"] = "keyword2", - ["#caller_location"] = "keyword2", - ["#packed"] = "keyword2", - ["#raw_union"] = "keyword2", - ["#align"] = "keyword2", - ["#no_nil"] = "keyword2", - ["#complete"] = "keyword2", - ["#no_alias"] = "keyword2", - ["#align"] = "keyword2", - ["#load"] = "keyword2", - ["#location"] = "keyword2", - ["#file"] = "keyword2", - ["#line"] = "keyword2", - ["#procedure"] = "keyword2", - ["#defined"] = "keyword2", - ["#no_bounds_check"] = "keyword2", - ["#bounds_check"] = "keyword2", - ["#type"] = "keyword2", - ["@private"] = "keyword2", -- Types ["rawptr"] = "keyword2", ["typeid"] = "keyword2", diff --git a/plugins/language_teal.lua b/plugins/language_teal.lua new file mode 100644 index 0000000..8ab4c33 --- /dev/null +++ b/plugins/language_teal.lua @@ -0,0 +1,55 @@ +local syntax = require "core.syntax" + +syntax.add { + files = {"%.tl$","%.d.tl$"}, + comment = "--", + patterns = { + { pattern = { '"', '"', '\\' }, type = "string" }, + { pattern = { "'", "'", '\\' }, type = "string" }, + { pattern = { "%[%[", "%]%]" }, type = "string" }, + { pattern = { "%-%-%[%[", "%]%]"}, type = "comment" }, + { pattern = "%-%-.-\n", type = "comment" }, + { pattern = "-?0x%x+", type = "number" }, + { pattern = "-?%d+[%d%.eE]*", type = "number" }, + { pattern = "-?%.?%d+", type = "number" }, + { pattern = "<%a+>", type = "keyword2" }, + { pattern = "%.%.%.?", type = "operator" }, + { pattern = "[<>~=]=", type = "operator" }, + { pattern = "[%+%-=/%*%^%%#<>]", type = "operator" }, + { pattern = "[%a_][%w_]*%s*%f[(\"{]", type = "function" }, + { pattern = "[%a_][%w_]*", type = "symbol" }, + { pattern = "::[%a_][%w_]*::", type = "function" }, + }, + symbols = { + ["if"] = "keyword", + ["then"] = "keyword", + ["else"] = "keyword", + ["elseif"] = "keyword", + ["end"] = "keyword", + ["do"] = "keyword", + ["function"] = "keyword", + ["repeat"] = "keyword", + ["until"] = "keyword", + ["while"] = "keyword", + ["for"] = "keyword", + ["break"] = "keyword", + ["return"] = "keyword", + ["local"] = "keyword", + ["global"] = "keyword", + ["in"] = "keyword", + ["not"] = "keyword", + ["and"] = "keyword", + ["or"] = "keyword", + ["goto"] = "keyword", + ["enum"] = "keyword", + ["record"] = "keyword", + ["any"] = "keyword2", + ["boolean"] = "keyword2", + ["number"] = "keyword2", + ["string"] = "keyword2", + ["thread"] = "keyword2", + ["true"] = "literal", + ["false"] = "literal", + ["nil"] = "literal", + }, +} diff --git a/plugins/tabnumbers.lua b/plugins/tabnumbers.lua new file mode 100644 index 0000000..deabbcd --- /dev/null +++ b/plugins/tabnumbers.lua @@ -0,0 +1,27 @@ +local common = require "core.common" +local core = require "core" +local style = require "core.style" + +-- quite hackish, but Node isn't normally public +local Node = getmetatable(core.root_view.root_node) +local draw_tabs = Node.draw_tabs + +function Node:draw_tabs(...) + draw_tabs(self, ...) + + for i, view in ipairs(self.views) do + if i > 9 then break end + + local x, y, w, h = self:get_tab_rect(i) + local number = tostring(i) + local color = style.dim + local title_width = style.font:get_width(view:get_name()) + local free_real_estate = + math.min(math.max((w - title_width) / 2, style.padding.x), h) + if view == self.active_view then + color = style.accent + end + -- renderer.draw_rect(x, y + h - 1, free_real_estate, 1, color) + common.draw_text(style.font, color, tostring(i), "center", x, y, free_real_estate, h) + end +end |