mirror of
https://github.com/LunarVim/LunarVim.git
synced 2024-09-21 02:55:09 +02:00
181 lines
4.4 KiB
Lua
181 lines
4.4 KiB
Lua
local gl = require('galaxyline')
|
||
-- get my theme in galaxyline repo
|
||
-- local colors = require('galaxyline.theme').default
|
||
local colors = {
|
||
bg = '#282c34',
|
||
yellow = '#fabd2f',
|
||
cyan = '#008080',
|
||
green = '#608B4E',
|
||
orange = '#FF8800',
|
||
purple = '#C586C0',
|
||
magenta = '#d16d9e',
|
||
grey = '#abb2bf',
|
||
blue = '#569CD6',
|
||
red = '#D16969'
|
||
}
|
||
local condition = require('galaxyline.condition')
|
||
local gls = gl.section
|
||
gl.short_line_list = {'NvimTree', 'vista', 'dbui', 'packer'}
|
||
|
||
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'}
|
||
}
|
||
}
|
||
|
||
gls.left[2] = {
|
||
GitIcon = {
|
||
provider = function()
|
||
return ' '
|
||
end,
|
||
condition = condition.check_git_workspace,
|
||
separator = ' ',
|
||
separator_highlight = {'NONE', colors.bg},
|
||
highlight = {colors.orange, colors.bg, 'bold'}
|
||
}
|
||
}
|
||
|
||
gls.left[3] = {
|
||
GitBranch = {
|
||
provider = 'GitBranch',
|
||
condition = condition.check_git_workspace,
|
||
separator = '',
|
||
separator_highlight = {'NONE', colors.bg},
|
||
highlight = {colors.grey, colors.bg, 'bold'}
|
||
}
|
||
}
|
||
|
||
gls.left[4] = {
|
||
DiffAdd = {
|
||
provider = 'DiffAdd',
|
||
condition = condition.hide_in_width,
|
||
icon = ' ',
|
||
highlight = {colors.green, colors.bg}
|
||
}
|
||
}
|
||
gls.left[5] = {
|
||
DiffModified = {
|
||
provider = 'DiffModified',
|
||
condition = condition.hide_in_width,
|
||
icon = ' 柳',
|
||
highlight = {colors.orange, colors.bg}
|
||
}
|
||
}
|
||
gls.left[6] = {
|
||
DiffRemove = {
|
||
provider = 'DiffRemove',
|
||
condition = condition.hide_in_width,
|
||
icon = ' ',
|
||
highlight = {colors.red, colors.bg}
|
||
}
|
||
}
|
||
|
||
gls.right[1] = {
|
||
DiagnosticError = {
|
||
provider = 'DiagnosticError',
|
||
icon = ' ',
|
||
highlight = {colors.red, colors.bg}
|
||
}
|
||
}
|
||
gls.right[2] = {
|
||
DiagnosticWarn = {
|
||
provider = 'DiagnosticWarn',
|
||
icon = ' ',
|
||
highlight = {colors.yellow, colors.bg}
|
||
}
|
||
}
|
||
|
||
gls.right[3] = {
|
||
DiagnosticHint = {
|
||
provider = 'DiagnosticHint',
|
||
icon = ' ',
|
||
highlight = {colors.blue, colors.bg}
|
||
}
|
||
}
|
||
|
||
gls.right[4] = {
|
||
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}
|
||
}
|
||
}
|
||
|
||
gls.right[7] = {
|
||
PerCent = {
|
||
provider = 'LinePercent',
|
||
separator = ' ',
|
||
separator_highlight = {'NONE', colors.bg},
|
||
highlight = {colors.grey, colors.bg, 'bold'}
|
||
}
|
||
}
|
||
|
||
gls.short_line_left[1] = {
|
||
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}}
|
||
}
|