From 4a63a682d4c3a2efb123fd939ccae928b9c6e1b9 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Thu, 10 Oct 2019 23:14:25 +0200 Subject: [vis] add light solarized theme and add ctags plugin theme can be switch by changing the symbolic link .config/vis/themes/theme.lua. --- config/vis/themes/solarized-dark.lua | 62 +++++++++++++++++++++++++++ config/vis/themes/solarized-light.lua | 62 +++++++++++++++++++++++++++ config/vis/themes/st-256.lua | 80 ----------------------------------- config/vis/themes/theme.lua | 1 + config/vis/visrc.lua | 8 ++-- 5 files changed, 128 insertions(+), 85 deletions(-) create mode 100644 config/vis/themes/solarized-dark.lua create mode 100644 config/vis/themes/solarized-light.lua delete mode 100644 config/vis/themes/st-256.lua create mode 120000 config/vis/themes/theme.lua diff --git a/config/vis/themes/solarized-dark.lua b/config/vis/themes/solarized-dark.lua new file mode 100644 index 0000000..a829845 --- /dev/null +++ b/config/vis/themes/solarized-dark.lua @@ -0,0 +1,62 @@ +-- Solarized color codes Copyright (c) 2011 Ethan Schoonover +local lexers = vis.lexers + +local colors = { + base03 = '#002b36', + base02 = '#073642', + base01 = '#586e75', + base00 = '#657b83', + base0 = '#839496', + base1 = '#93a1a1', + base2 = '#eee8d5', + base3 = '#fdf6e3', + yellow = '#b58900', + orange = '#cb4b16', + red = '#dc322f', + magenta = '#d33682', + violet = '#6c71c4', + blue = '#268bd2', + cyan = '#2aa198', + green = '#859900', +} + +lexers.colors = colors +-- dark +local fg = ',fore:'..colors.base0..',' +local bg = ',back:'..colors.base03..',' + +lexers.STYLE_DEFAULT = bg..fg +lexers.STYLE_NOTHING = bg +lexers.STYLE_CLASS = 'fore:yellow' +lexers.STYLE_COMMENT = 'fore:'..colors.base01 +lexers.STYLE_CONSTANT = 'fore:'..colors.cyan +lexers.STYLE_DEFINITION = 'fore:'..colors.blue +lexers.STYLE_ERROR = 'fore:'..colors.red..',italics' +lexers.STYLE_FUNCTION = 'fore:'..colors.blue +lexers.STYLE_KEYWORD = 'fore:'..colors.green +lexers.STYLE_LABEL = 'fore:'..colors.green +lexers.STYLE_NUMBER = 'fore:'..colors.cyan +lexers.STYLE_OPERATOR = 'fore:'..colors.green +lexers.STYLE_REGEX = 'fore:green' +lexers.STYLE_STRING = 'fore:'..colors.cyan +lexers.STYLE_PREPROCESSOR = 'fore:'..colors.orange +lexers.STYLE_TAG = 'fore:'..colors.red +lexers.STYLE_TYPE = 'fore:'..colors.yellow +lexers.STYLE_VARIABLE = 'fore:'..colors.blue +lexers.STYLE_WHITESPACE = 'fore:'..colors.base01 +lexers.STYLE_EMBEDDED = 'back:blue' +lexers.STYLE_IDENTIFIER = fg + +lexers.STYLE_LINENUMBER = 'fore:'..colors.base00..',back:'..colors.base02 +lexers.STYLE_LINENUMBER_CURSOR = 'back:'..colors.base00..',fore:'..colors.base02 +lexers.STYLE_CURSOR = 'fore:'..colors.base03..',back:'..colors.base0 +lexers.STYLE_CURSOR_PRIMARY = lexers.STYLE_CURSOR..',back:yellow' +lexers.STYLE_CURSOR_LINE = 'back:'..colors.base02 +lexers.STYLE_COLOR_COLUMN = 'back:'..colors.base02 +-- lexers.STYLE_SELECTION = 'back:'..colors.base02 +lexers.STYLE_SELECTION = 'back:white' +lexers.STYLE_STATUS = 'back:'..colors.base00..',fore:'..colors.base02 +lexers.STYLE_STATUS_FOCUSED = 'back:'..colors.base1..',fore:'..colors.base02 +lexers.STYLE_SEPARATOR = lexers.STYLE_DEFAULT +lexers.STYLE_INFO = 'fore:default,back:default,bold' +lexers.STYLE_EOF = 'fore:'..colors.base01 diff --git a/config/vis/themes/solarized-light.lua b/config/vis/themes/solarized-light.lua new file mode 100644 index 0000000..1f3f92c --- /dev/null +++ b/config/vis/themes/solarized-light.lua @@ -0,0 +1,62 @@ +-- Solarized color codes Copyright (c) 2011 Ethan Schoonover +local lexers = vis.lexers + +local colors = { + base3 = '#002b36', + base2 = '#073642', + base1 = '#586e75', + base0 = '#657b83', + base00 = '#839496', + base01 = '#93a1a1', + base02 = '#eee8d5', + base03 = '#fdf6e3', + yellow = '#b58900', + orange = '#cb4b16', + red = '#dc322f', + magenta = '#d33682', + violet = '#6c71c4', + blue = '#268bd2', + cyan = '#2aa198', + green = '#859900', +} + +lexers.colors = colors +-- dark +local fg = ',fore:'..colors.base0..',' +local bg = ',back:'..colors.base03..',' + +lexers.STYLE_DEFAULT = bg..fg +lexers.STYLE_NOTHING = bg +lexers.STYLE_CLASS = 'fore:yellow' +lexers.STYLE_COMMENT = 'fore:'..colors.base01 +lexers.STYLE_CONSTANT = 'fore:'..colors.cyan +lexers.STYLE_DEFINITION = 'fore:'..colors.blue +lexers.STYLE_ERROR = 'fore:'..colors.red..',italics' +lexers.STYLE_FUNCTION = 'fore:'..colors.blue +lexers.STYLE_KEYWORD = 'fore:'..colors.green +lexers.STYLE_LABEL = 'fore:'..colors.green +lexers.STYLE_NUMBER = 'fore:'..colors.cyan +lexers.STYLE_OPERATOR = 'fore:'..colors.green +lexers.STYLE_REGEX = 'fore:green' +lexers.STYLE_STRING = 'fore:'..colors.cyan +lexers.STYLE_PREPROCESSOR = 'fore:'..colors.orange +lexers.STYLE_TAG = 'fore:'..colors.red +lexers.STYLE_TYPE = 'fore:'..colors.yellow +lexers.STYLE_VARIABLE = 'fore:'..colors.blue +lexers.STYLE_WHITESPACE = 'fore:'..colors.base01 +lexers.STYLE_EMBEDDED = 'back:blue' +lexers.STYLE_IDENTIFIER = fg + +lexers.STYLE_LINENUMBER = 'fore:'..colors.base00..',back:'..colors.base02 +lexers.STYLE_LINENUMBER_CURSOR = 'back:'..colors.base00..',fore:'..colors.base02 +lexers.STYLE_CURSOR = 'fore:'..colors.base03..',back:'..colors.base0 +lexers.STYLE_CURSOR_PRIMARY = lexers.STYLE_CURSOR..',back:yellow' +lexers.STYLE_CURSOR_LINE = 'back:'..colors.base02 +lexers.STYLE_COLOR_COLUMN = 'back:'..colors.base02 +-- lexers.STYLE_SELECTION = 'back:'..colors.base02 +lexers.STYLE_SELECTION = 'back:white' +lexers.STYLE_STATUS = 'back:'..colors.base00..',fore:'..colors.base02 +lexers.STYLE_STATUS_FOCUSED = 'back:'..colors.base1..',fore:'..colors.base02 +lexers.STYLE_SEPARATOR = lexers.STYLE_DEFAULT +lexers.STYLE_INFO = 'fore:default,back:default,bold' +lexers.STYLE_EOF = 'fore:'..colors.base01 diff --git a/config/vis/themes/st-256.lua b/config/vis/themes/st-256.lua deleted file mode 100644 index b102133..0000000 --- a/config/vis/themes/st-256.lua +++ /dev/null @@ -1,80 +0,0 @@ --- Solarized color codes Copyright (c) 2011 Ethan Schoonover - -local lexers = vis.lexers - --- The colors used by the solarized scheme for st --- http://st.suckless.org/patches/solarized --- --- "#073642", /* 0: black */ -> base02 --- "#dc322f", /* 1: red */ -> red --- "#859900", /* 2: green */ -> green --- "#b58900", /* 3: yellow */ -> yellow --- "#268bd2", /* 4: blue */ -> blue --- "#d33682", /* 5: magenta */ -> magenta --- "#2aa198", /* 6: cyan */ -> cyan --- "#eee8d5", /* 7: white */ -> base2 --- "#002b36", /* 8: brblack */ -> base03 --- "#cb4b16", /* 9: brred */ -> orange --- "#586e75", /* 10: brgreen */ -> base01 --- "#657b83", /* 11: bryellow */ -> base00 --- "#839496", /* 12: brblue */ -> base0 --- "#6c71c4", /* 13: brmagenta*/ -> violet --- "#93a1a1", /* 14: brcyan */ -> base1 --- "#fdf6e3", /* 15: brwhite */ -> base3 - -local colors = { - ['base03'] = '8', -- '#002b36', - ['base02'] = '0', -- '#073642', - ['base01'] = '10', -- '#586e75', - ['base00'] = '11', -- '#657b83', - ['base0'] = '12', -- '#839496', - ['base1'] = '14', -- '#93a1a1', - ['base2'] = '7', -- '#eee8d5', - ['base3'] = '15', -- '#fdf6e3', - ['yellow'] = '3', -- '#b58900', - ['orange'] = '9', -- '#cb4b16', - ['red'] = '1', -- '#dc322f', - ['magenta'] = '5', -- '#d33682', - ['violet'] = '13', -- '#6c71c4', - ['blue'] = '4', -- '#268bd2', - ['cyan'] = '6', -- '#2aa198', - ['green'] = '2', -- '#859900', -} - -lexers.colors = colors --- dark -local fg = ',fore:'..colors.base0..',' -local bg = ',back:'..colors.base03..',' --- light --- local fg = ',fore:'..colors.base03..',' --- local bg = ',back:'..colors.base3..',' - -lexers.STYLE_DEFAULT = bg..fg -lexers.STYLE_NOTHING = bg -lexers.STYLE_CLASS = 'fore:yellow' -lexers.STYLE_COMMENT = 'fore:'..colors.base01 -lexers.STYLE_CONSTANT = 'fore:'..colors.cyan -lexers.STYLE_DEFINITION = 'fore:'..colors.blue -lexers.STYLE_ERROR = 'fore:'..colors.red..',italics' -lexers.STYLE_FUNCTION = 'fore:'..colors.blue -lexers.STYLE_KEYWORD = 'fore:'..colors.green -lexers.STYLE_LABEL = 'fore:'..colors.green -lexers.STYLE_NUMBER = 'fore:'..colors.cyan -lexers.STYLE_OPERATOR = 'fore:'..colors.green -lexers.STYLE_REGEX = 'fore:green' -lexers.STYLE_STRING = 'fore:'..colors.cyan -lexers.STYLE_PREPROCESSOR = 'fore:'..colors.orange -lexers.STYLE_TAG = 'fore:'..colors.red -lexers.STYLE_TYPE = 'fore:'..colors.yellow -lexers.STYLE_VARIABLE = 'fore:'..colors.blue -lexers.STYLE_WHITESPACE = '' -lexers.STYLE_EMBEDDED = 'back:blue' -lexers.STYLE_IDENTIFIER = fg - -lexers.STYLE_LINENUMBER = fg -lexers.STYLE_CURSOR = 'fore:'..colors.base03..',back:'..colors.base0 -lexers.STYLE_CURSOR_PRIMARY = lexers.STYLE_CURSOR..',back:yellow' -lexers.STYLE_CURSOR_LINE = 'back:'..colors.base00 -lexers.STYLE_COLOR_COLUMN = 'back:'..colors.base00 --- lexers.STYLE_SELECTION = 'back:'..colors.base02 -lexers.STYLE_SELECTION = 'back:white' diff --git a/config/vis/themes/theme.lua b/config/vis/themes/theme.lua new file mode 120000 index 0000000..a7d839a --- /dev/null +++ b/config/vis/themes/theme.lua @@ -0,0 +1 @@ +solarized-dark.lua \ No newline at end of file diff --git a/config/vis/visrc.lua b/config/vis/visrc.lua index 4bf1239..f3fa17d 100644 --- a/config/vis/visrc.lua +++ b/config/vis/visrc.lua @@ -5,6 +5,7 @@ require('plugins/textobject-lexer') require('plugins/vis-cursors/cursors').cursors_path = string.format('%s/vis/cursors', os.getenv('XDG_DATA_HOME') or os.getenv('HOME').."/.local/share") require('plugins/vis-spellcheck/spellcheck') require('plugins/vis-commentary/vis-commentary') +require('plugins/vis-ctags/ctags') -- This hooks vis.events.START so its fine to load it before the default settings require('plugins/vis-modelines/vis-modelines') @@ -12,11 +13,8 @@ require('plugins/suw') vis.events.subscribe(vis.events.INIT, function() -- Your global configuration options - local theme = "default" - if string.match(os.getenv('TERM'), '^st.*') then - theme = "st" - end - vis:command("set theme ".. theme .. (vis.ui.colors <= 16 and "-16" or "-256")) + local theme = "theme" + vis:command("set theme ".. theme) end) vis.events.subscribe(vis.events.WIN_OPEN, function(win) -- cgit v1.2.3