LunarVim/lua/nv-galaxyline/init.lua

188 lines
4.6 KiB
Lua
Raw Normal View History

2020-10-29 02:59:10 +01:00
local gl = require('galaxyline')
2021-03-18 07:08:38 +01:00
-- get my theme in galaxyline repo
-- local colors = require('galaxyline.theme').default
local colors = {
2021-03-18 19:01:09 +01:00
bg = '#2E2E2E',
yellow = '#DCDCAA',
dark_yellow = '#D7BA7D',
cyan = '#4EC9B0',
2021-03-18 07:08:38 +01:00
green = '#608B4E',
2021-03-18 19:01:09 +01:00
light_green = '#B5CEA8',
string_orange = '#CE9178',
2021-03-18 07:08:38 +01:00
orange = '#FF8800',
purple = '#C586C0',
2021-03-18 19:01:09 +01:00
magenta = '#D16D9E',
grey = '#858585',
2021-03-18 07:08:38 +01:00
blue = '#569CD6',
2021-03-18 19:01:09 +01:00
vivid_blue = '#4FC1FF',
light_blue = '#9CDCFE',
red = '#D16969',
error_red = '#F44747'
2021-03-18 07:08:38 +01:00
}
local condition = require('galaxyline.condition')
2020-10-29 02:59:10 +01:00
local gls = gl.section
2021-03-18 07:08:38 +01:00
gl.short_line_list = {'NvimTree', 'vista', 'dbui', 'packer'}
2020-10-29 02:59:10 +01:00
2021-03-18 07:08:38 +01:00
gls.left[1] = {
ViMode = {
provider = function()
-- auto change color according the vim mode
local mode_color = {
n = colors.blue,
i = colors.green,
v = colors.purple,
[''] = colors.purple,
V = colors.purple,
c = colors.magenta,
no = colors.blue,
s = colors.orange,
S = colors.orange,
[''] = colors.orange,
ic = colors.yellow,
R = colors.red,
Rv = colors.red,
cv = colors.blue,
ce = colors.blue,
r = colors.cyan,
rm = colors.cyan,
['r?'] = colors.cyan,
['!'] = colors.blue,
t = colors.blue
}
vim.api.nvim_command('hi GalaxyViMode guifg=' .. mode_color[vim.fn.mode()])
return ''
end,
highlight = {colors.red, colors.bg, 'bold'}
}
2020-10-29 02:59:10 +01:00
}
gls.left[2] = {
2021-03-18 07:08:38 +01:00
GitIcon = {
provider = function()
return ''
end,
condition = condition.check_git_workspace,
separator = ' ',
separator_highlight = {'NONE', colors.bg},
highlight = {colors.orange, colors.bg, 'bold'}
}
}
2020-10-29 02:59:10 +01:00
2020-10-31 02:21:41 +01:00
gls.left[3] = {
2021-03-18 07:08:38 +01:00
GitBranch = {
provider = 'GitBranch',
condition = condition.check_git_workspace,
2021-03-18 07:42:20 +01:00
separator = ' ',
2021-03-18 07:08:38 +01:00
separator_highlight = {'NONE', colors.bg},
highlight = {colors.grey, colors.bg, 'bold'}
}
2020-10-29 02:59:10 +01:00
}
2021-03-18 07:08:38 +01:00
2020-10-31 02:21:41 +01:00
gls.left[4] = {
2021-03-18 07:08:38 +01:00
DiffAdd = {
provider = 'DiffAdd',
condition = condition.hide_in_width,
icon = '',
highlight = {colors.green, colors.bg}
}
2020-10-29 02:59:10 +01:00
}
2020-10-31 02:21:41 +01:00
gls.left[5] = {
2021-03-18 07:08:38 +01:00
DiffModified = {
provider = 'DiffModified',
condition = condition.hide_in_width,
icon = '',
2021-03-18 19:01:09 +01:00
highlight = {colors.blue, colors.bg}
2021-03-18 07:08:38 +01:00
}
2020-10-31 02:21:41 +01:00
}
gls.left[6] = {
2021-03-18 07:08:38 +01:00
DiffRemove = {
provider = 'DiffRemove',
condition = condition.hide_in_width,
icon = '',
highlight = {colors.red, colors.bg}
}
}
gls.right[1] = {
DiagnosticError = {
provider = 'DiagnosticError',
icon = '',
2021-03-18 19:01:09 +01:00
highlight = {colors.error_red, colors.bg}
2021-03-18 07:08:38 +01:00
}
2020-10-29 02:59:10 +01:00
}
gls.right[2] = {
2021-03-18 07:08:38 +01:00
DiagnosticWarn = {
provider = 'DiagnosticWarn',
icon = '',
2021-03-18 19:01:09 +01:00
highlight = {colors.orange, colors.bg}
2021-03-18 07:08:38 +01:00
}
2020-10-29 02:59:10 +01:00
}
2021-03-18 07:08:38 +01:00
2020-10-29 02:59:10 +01:00
gls.right[3] = {
2021-03-18 07:08:38 +01:00
DiagnosticHint = {
provider = 'DiagnosticHint',
icon = '',
highlight = {colors.blue, colors.bg}
}
2020-10-29 02:59:10 +01:00
}
2021-03-18 07:08:38 +01:00
2020-10-29 02:59:10 +01:00
gls.right[4] = {
2021-03-18 07:08:38 +01:00
DiagnosticInfo = {
provider = 'DiagnosticInfo',
icon = '',
highlight = {colors.blue, colors.bg}
}
}
gls.right[5] = {
ShowLspClient = {
provider = 'GetLspClient',
condition = function()
local tbl = {['dashboard'] = true, [' '] = true}
if tbl[vim.bo.filetype] then return false end
return true
end,
icon = '',
highlight = {colors.grey, colors.bg, 'bold'}
}
}
gls.right[6] = {
LineInfo = {
provider = 'LineColumn',
separator = ' ',
separator_highlight = {'NONE', colors.bg},
highlight = {colors.grey, colors.bg}
}
2020-10-29 02:59:10 +01:00
}
2021-03-18 07:08:38 +01:00
gls.right[7] = {
PerCent = {
provider = 'LinePercent',
separator = ' ',
separator_highlight = {'NONE', colors.bg},
highlight = {colors.grey, colors.bg, 'bold'}
}
}
2020-10-29 02:59:10 +01:00
2020-10-29 05:14:19 +01:00
gls.short_line_left[1] = {
2021-03-18 07:08:38 +01:00
BufferType = {
provider = 'FileTypeName',
separator = ' ',
separator_highlight = {'NONE', colors.bg},
highlight = {colors.grey, colors.bg, 'bold'}
}
}
gls.short_line_left[2] = {
SFileName = {
provider = 'SFileName',
condition = condition.buffer_not_empty,
highlight = {colors.grey, colors.bg, 'bold'}
}
}
gls.short_line_right[1] = {
BufferIcon = {provider = 'BufferIcon', highlight = {colors.grey, colors.bg}}
2020-10-29 05:14:19 +01:00
}