aboutsummaryrefslogtreecommitdiff
path: root/lua/vis-std.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/vis-std.lua')
-rw-r--r--lua/vis-std.lua23
1 files changed, 22 insertions, 1 deletions
diff --git a/lua/vis-std.lua b/lua/vis-std.lua
index 470872f..af2b196 100644
--- a/lua/vis-std.lua
+++ b/lua/vis-std.lua
@@ -14,7 +14,28 @@ vis:option_register("theme", "string", function(name)
require(theme)
end
- vis.lexers.lexers = {}
+ local lexers = vis.lexers
+ lexers.lexers = {}
+
+ if not lexers.property then lexers.load("text") end
+ local colors = lexers.colors
+ local default_colors = { "black", "red", "green", "yellow", "blue", "magenta", "cyan", "white" }
+ for _, c in ipairs(default_colors) do
+ if not colors[c] or colors[c] == '' then
+ colors[c] = c
+ end
+ end
+
+ local styles = lexers.styles
+ local default_styles = {
+ 'nothing', 'whitespace', 'comment', 'string', 'number', 'keyword',
+ 'identifier', 'operator', 'error', 'preprocessor', 'constant', 'variable',
+ 'function', 'class', 'type', 'label', 'regex', 'embedded'
+ }
+
+ for _, s in ipairs(default_styles) do
+ styles[s] = lexers['STYLE_' .. s:upper()]
+ end
for win in vis:windows() do
win:set_syntax(win.syntax)