82 lines
3.6 KiB
Lua
82 lines
3.6 KiB
Lua
-- wryan.lua
|
|
|
|
local lexers = vis.lexers
|
|
local colors = {
|
|
['bg'] = '#00000000',
|
|
['fg'] = '#aaaaaa',
|
|
--['bg'] = '#eeeeee',
|
|
--['fg'] = '#010101',
|
|
['blk'] = '#333333',
|
|
['bblk'] = '#4f4f4f',
|
|
['red'] = '#8c4665',
|
|
['bred'] = '#bf4d80',
|
|
['grn'] = '#287373',
|
|
['bgrn'] = '#53a6a6',
|
|
['ylw'] = '#7c7c99',
|
|
['bylw'] = '#9e9ecb',
|
|
['blu'] = '#395573',
|
|
['bblu'] = '#477ab3',
|
|
['mag'] = '#5e468c',
|
|
['bmag'] = '#7e62b3',
|
|
['cyn'] = '#31658c',
|
|
['bcyn'] = '#6096bf',
|
|
['wht'] = '#899ca1',
|
|
['bwht'] = '#c0c0c0',
|
|
|
|
-- special colors
|
|
['dim1'] = '#555555',
|
|
['dim2'] = '#010101'
|
|
}
|
|
|
|
-- general styles
|
|
lexers.STYLE_DEFAULT = 'fore:'..colors.fg..',back:'..colors.bg -- default fg / bg
|
|
lexers.STYLE_NOTHING = lexers.STYLE_DEFAULT
|
|
lexers.STYLE_ATTRIBUTE = 'fore:'..colors.bmag -- attribute names, `<img _src_="foo">`
|
|
lexers.STYLE_CLASS = 'fore:'..colors.mag -- classes, `class _MyClass_`
|
|
lexers.STYLE_COMMENT = 'fore:'..colors.bblk -- comments, `_/* foo */_`
|
|
lexers.STYLE_CONSTANT = lexers.STYLE_DEFAULT -- compiler constants &c, `#define _FOO_ 5`
|
|
lexers.STYLE_DEFINITION = 'fore:'..colors.bblu -- definitions, overlaps with other tokens
|
|
lexers.STYLE_ERROR = 'fore:'..colors.bg..',back:'..colors.red -- syntax errors
|
|
lexers.STYLE_FUNCTION = 'fore:'..colors.bblu -- functions, `void _doBar_()`
|
|
lexers.STYLE_HEADING = 'fore:'..colors.bmag..',bold' -- headings, like in markdown
|
|
lexers.STYLE_KEYWORD = 'fore:'..colors.bmag -- keywords, `_for_ (;;)`
|
|
lexers.STYLE_LABEL = 'fore:'..colors.red -- goto &c, `_target_:`
|
|
lexers.STYLE_NUMBER = 'fore:'..colors.bcyn -- number constants
|
|
lexers.STYLE_OPERATOR = lexers.STYLE_DEFAULT -- operators, `int foo _=_ 0`
|
|
lexers.STYLE_REGEX = 'fore:'..colors.red -- regular expressions, `"_^\w*$_"`
|
|
lexers.STYLE_STRING = 'fore:'..colors.bgrn -- strings, `char* baz = _"hello!"_`
|
|
lexers.STYLE_PREPROCESSOR = 'fore:'..colors.cyn -- preprocessor rules, `_#define_ FOO 5`
|
|
lexers.STYLE_TAG = 'fore:'..colors.bblk -- tag names, `<_div_ class="foo">`
|
|
lexers.STYLE_TYPE = 'fore:'..colors.bgrn -- types, `_int_ foo = 0`
|
|
lexers.STYLE_VARIABLE = lexers.STYLE_DEFAULT -- variable names, `int _foo_ = 0`
|
|
lexers.STYLE_WHITESPACE = 'fore:'..colors.blk -- whitespaces
|
|
lexers.STYLE_EMBEDDED = 'back:'..colors.dim2 -- embedded code
|
|
lexers.STYLE_IDENTIFIER = lexers.STYLE_DEFAULT -- unclassified names
|
|
|
|
-- UI styles
|
|
lexers.STYLE_LINENUMBER = 'fore:'..colors.blk -- inactive line numbers
|
|
lexers.STYLE_LINENUMBER_CURSOR = 'fore:'..colors.bcyn -- active line numbers
|
|
lexers.STYLE_CURSOR = 'fore:'..colors.fg..',reverse' -- cursor color
|
|
lexers.STYLE_CURSOR_PRIMARY = lexers.STYLE_CURSOR
|
|
lexers.STYLE_CURSOR_LINE = 'back:'..colors.dim1 -- cursor line
|
|
lexers.STYLE_COLOR_COLUMN = lexers.STYLE_CURSOR_LINE -- color column
|
|
lexers.STYLE_SELECTION = 'back:'..colors.ylw -- visual selection
|
|
lexers.STYLE_STATUS = 'fore:'..colors.bblk..',back:'..colors.dim2 -- inactive statusline
|
|
lexers.STYLE_STATUS_FOCUSED = 'fore:'..colors.fg..',back:'..colors.bg -- active statusline
|
|
lexers.STYLE_SEPARATOR = lexers.STYLE_COMMENT -- vertical split color
|
|
lexers.STYLE_BRACKETS = 'fore:'..colors.red..',bold' -- matched brackets, e.g [__]__
|
|
lexers.STYLE_INFO = 'bold' -- messages from `vis:info()`
|
|
lexers.STYLE_EOF = 'fore:'..colors.dim2 -- the tildes at the end of the buffer
|
|
|
|
-- lexer-specific
|
|
-- TODO add more...
|
|
|
|
-- markdown
|
|
lexers.STYLE_HR = lexers.STYLE_COMMENT
|
|
for i = 1,6 do lexers['STYLE_HEADING_H'..i] = lexers.STYLE_HEADING end
|
|
lexers.STYLE_BOLD = 'bold'
|
|
lexers.STYLE_ITALIC = 'italics'
|
|
lexers.STYLE_LIST = lexers.STYLE_KEYWORD
|
|
lexers.STYLE_LINK = lexers.STYLE_KEYWORD
|
|
lexers.STYLE_REFERENCE = lexers.STYLE_KEYWORD
|
|
lexers.STYLE_CODE = lexers.STYLE_EMBEDDED
|