2020-10-29 02:59:10 +01:00
|
|
|
|
-- require'nvim-web-devicons'.setup()
|
|
|
|
|
|
|
|
|
|
local gl = require('galaxyline')
|
|
|
|
|
local gls = gl.section
|
|
|
|
|
gl.short_line_list = {'LuaTree','vista','dbui'}
|
|
|
|
|
|
|
|
|
|
local colors = {
|
|
|
|
|
bg = '#282c34',
|
|
|
|
|
yellow = '#fabd2f',
|
|
|
|
|
cyan = '#008080',
|
|
|
|
|
darkblue = '#081633',
|
2020-10-31 21:41:14 +01:00
|
|
|
|
green = '#608B4E',
|
2020-10-29 02:59:10 +01:00
|
|
|
|
orange = '#FF8800',
|
|
|
|
|
purple = '#5d4d7a',
|
|
|
|
|
magenta = '#d16d9e',
|
|
|
|
|
grey = '#c0c0c0',
|
2020-10-31 21:41:14 +01:00
|
|
|
|
blue = '#569CD6',
|
|
|
|
|
red = '#D16969'
|
2020-10-29 02:59:10 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
local buffer_not_empty = function()
|
|
|
|
|
if vim.fn.empty(vim.fn.expand('%:t')) ~= 1 then
|
|
|
|
|
return true
|
|
|
|
|
end
|
|
|
|
|
return false
|
|
|
|
|
end
|
|
|
|
|
|
2020-10-31 21:41:14 +01:00
|
|
|
|
-- gls.left[1] = {
|
|
|
|
|
-- FirstElement = {
|
|
|
|
|
-- -- provider = function() return '▋' end,
|
|
|
|
|
-- provider = function() return ' ' end,
|
|
|
|
|
-- highlight = {colors.bg,colors.bg}
|
|
|
|
|
-- },
|
|
|
|
|
-- }
|
|
|
|
|
-- gls.left[2] = {
|
|
|
|
|
-- ViMode = {
|
|
|
|
|
-- provider = function()
|
|
|
|
|
-- local alias = {n = 'NORMAL',i = 'INSERT',c= 'COMMAND',V= 'VISUAL', [''] = 'VISUAL'}
|
|
|
|
|
-- return alias[vim.fn.mode()]
|
|
|
|
|
-- end,
|
|
|
|
|
-- separator = ' ',
|
|
|
|
|
-- separator_highlight = {colors.yellow,function()
|
|
|
|
|
-- if not buffer_not_empty() then
|
|
|
|
|
-- return colors.purple
|
|
|
|
|
-- end
|
|
|
|
|
-- return colors.purple
|
|
|
|
|
-- end},
|
|
|
|
|
-- highlight = {colors.grey,colors.purple,'bold'},
|
|
|
|
|
-- },
|
|
|
|
|
-- }
|
2020-10-29 02:59:10 +01:00
|
|
|
|
gls.left[2] = {
|
|
|
|
|
ViMode = {
|
|
|
|
|
provider = function()
|
2020-10-31 21:41:14 +01:00
|
|
|
|
-- auto change color according the vim mode
|
|
|
|
|
local mode_color = {n = colors.purple,
|
|
|
|
|
i = colors.green,
|
2020-10-31 23:53:03 +01:00
|
|
|
|
v = colors.blue,
|
2020-10-31 21:41:14 +01:00
|
|
|
|
[''] = colors.blue,
|
2020-10-31 23:53:03 +01:00
|
|
|
|
V = colors.blue,
|
2020-10-31 21:41:14 +01:00
|
|
|
|
c = colors.purple,
|
|
|
|
|
no = colors.magenta,
|
|
|
|
|
s = colors.orange,
|
2020-10-31 23:53:03 +01:00
|
|
|
|
S = colors.orange,
|
2020-10-31 21:41:14 +01:00
|
|
|
|
[''] = colors.orange,
|
|
|
|
|
ic = colors.yellow,
|
|
|
|
|
R = colors.red,
|
|
|
|
|
Rv = colors.red,
|
|
|
|
|
cv = colors.red,
|
|
|
|
|
ce=colors.red,
|
|
|
|
|
r = colors.cyan,
|
|
|
|
|
rm = colors.cyan,
|
|
|
|
|
['r?'] = colors.cyan,
|
|
|
|
|
['!'] = colors.red,
|
|
|
|
|
t = colors.red}
|
|
|
|
|
vim.api.nvim_command('hi GalaxyViMode guibg='..mode_color[vim.fn.mode()])
|
2020-10-31 21:45:57 +01:00
|
|
|
|
return ' NVCode '
|
2020-10-29 02:59:10 +01:00
|
|
|
|
end,
|
|
|
|
|
separator = ' ',
|
|
|
|
|
separator_highlight = {colors.yellow,function()
|
|
|
|
|
if not buffer_not_empty() then
|
2020-10-31 21:41:14 +01:00
|
|
|
|
return colors.bg
|
2020-10-29 02:59:10 +01:00
|
|
|
|
end
|
2020-10-31 21:41:14 +01:00
|
|
|
|
return colors.bg
|
2020-10-29 02:59:10 +01:00
|
|
|
|
end},
|
2020-10-31 21:41:14 +01:00
|
|
|
|
highlight = {colors.grey,colors.bg,'bold'},
|
2020-10-29 02:59:10 +01:00
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
-- gls.left[3] ={
|
|
|
|
|
-- FileIcon = {
|
|
|
|
|
-- separator = ' ',
|
|
|
|
|
-- provider = 'FileIcon',
|
|
|
|
|
-- condition = buffer_not_empty,
|
|
|
|
|
-- highlight = {require('galaxyline.provider_fileinfo').get_file_icon_color,colors.bg},
|
|
|
|
|
-- },
|
|
|
|
|
-- }
|
|
|
|
|
-- gls.left[4] = {
|
|
|
|
|
-- FileName = {
|
|
|
|
|
-- provider = {'FileSize'},
|
|
|
|
|
-- condition = buffer_not_empty,
|
|
|
|
|
-- separator = ' ',
|
|
|
|
|
-- separator_highlight = {colors.purple,colors.bg},
|
|
|
|
|
-- highlight = {colors.magenta,colors.bg}
|
|
|
|
|
-- }
|
|
|
|
|
-- }
|
|
|
|
|
|
2020-10-31 02:21:41 +01:00
|
|
|
|
gls.left[3] = {
|
2020-10-29 02:59:10 +01:00
|
|
|
|
GitIcon = {
|
2020-10-31 21:41:14 +01:00
|
|
|
|
provider = function() return ' ' end,
|
2020-10-29 02:59:10 +01:00
|
|
|
|
condition = buffer_not_empty,
|
|
|
|
|
highlight = {colors.orange,colors.bg},
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-10-31 02:21:41 +01:00
|
|
|
|
gls.left[4] = {
|
2020-10-29 02:59:10 +01:00
|
|
|
|
GitBranch = {
|
|
|
|
|
provider = 'GitBranch',
|
2020-10-31 22:03:37 +01:00
|
|
|
|
separator = ' ',
|
|
|
|
|
separator_highlight = {colors.purple,colors.bg},
|
2020-10-29 02:59:10 +01:00
|
|
|
|
condition = buffer_not_empty,
|
|
|
|
|
highlight = {colors.grey,colors.bg},
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
local checkwidth = function()
|
|
|
|
|
local squeeze_width = vim.fn.winwidth(0) / 2
|
|
|
|
|
if squeeze_width > 40 then
|
|
|
|
|
return true
|
|
|
|
|
end
|
|
|
|
|
return false
|
|
|
|
|
end
|
|
|
|
|
|
2020-10-31 02:21:41 +01:00
|
|
|
|
gls.left[5] = {
|
|
|
|
|
DiffAdd = {
|
|
|
|
|
provider = 'DiffAdd',
|
|
|
|
|
condition = checkwidth,
|
2020-10-31 22:03:37 +01:00
|
|
|
|
-- separator = ' ',
|
|
|
|
|
-- separator_highlight = {colors.purple,colors.bg},
|
|
|
|
|
icon = ' ',
|
2020-10-31 02:21:41 +01:00
|
|
|
|
highlight = {colors.green,colors.bg},
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
gls.left[6] = {
|
|
|
|
|
DiffModified = {
|
|
|
|
|
provider = 'DiffModified',
|
|
|
|
|
condition = checkwidth,
|
2020-10-31 22:03:37 +01:00
|
|
|
|
-- separator = ' ',
|
|
|
|
|
-- separator_highlight = {colors.purple,colors.bg},
|
2020-10-31 02:21:41 +01:00
|
|
|
|
icon = ' ',
|
|
|
|
|
highlight = {colors.blue,colors.bg},
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
gls.left[7] = {
|
|
|
|
|
DiffRemove = {
|
|
|
|
|
provider = 'DiffRemove',
|
|
|
|
|
condition = checkwidth,
|
2020-10-31 22:03:37 +01:00
|
|
|
|
-- separator = ' ',
|
|
|
|
|
-- separator_highlight = {colors.purple,colors.bg},
|
2020-10-31 02:21:41 +01:00
|
|
|
|
icon = ' ',
|
|
|
|
|
highlight = {colors.red,colors.bg},
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
gls.left[8] = {
|
2020-10-29 02:59:10 +01:00
|
|
|
|
LeftEnd = {
|
|
|
|
|
provider = function() return ' ' end,
|
|
|
|
|
separator = ' ',
|
|
|
|
|
separator_highlight = {colors.purple,colors.bg},
|
|
|
|
|
highlight = {colors.purple,colors.bg}
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-10-31 02:21:41 +01:00
|
|
|
|
gls.left[9] = {
|
2020-10-29 02:59:10 +01:00
|
|
|
|
DiagnosticError = {
|
|
|
|
|
provider = 'DiagnosticError',
|
|
|
|
|
icon = ' ',
|
|
|
|
|
highlight = {colors.red,colors.bg}
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-10-31 02:21:41 +01:00
|
|
|
|
gls.left[10] = {
|
2020-10-29 02:59:10 +01:00
|
|
|
|
Space = {
|
|
|
|
|
provider = function () return '' end
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-10-31 02:21:41 +01:00
|
|
|
|
gls.left[11] = {
|
2020-10-29 02:59:10 +01:00
|
|
|
|
DiagnosticWarn = {
|
|
|
|
|
provider = 'DiagnosticWarn',
|
|
|
|
|
icon = ' ',
|
2020-10-31 21:04:20 +01:00
|
|
|
|
highlight = {colors.yellow,colors.bg},
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
gls.left[12] = {
|
|
|
|
|
DiagnosticHint = {
|
|
|
|
|
provider = 'DiagnosticHint',
|
|
|
|
|
icon = ' ',
|
2020-10-29 02:59:10 +01:00
|
|
|
|
highlight = {colors.blue,colors.bg},
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-11-01 17:46:03 +01:00
|
|
|
|
gls.left[13] = {
|
|
|
|
|
DiagnosticInfo = {
|
|
|
|
|
provider = 'DiagnosticInfo',
|
|
|
|
|
icon = ' ',
|
|
|
|
|
highlight = {colors.orange,colors.bg},
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-10-29 02:59:10 +01:00
|
|
|
|
gls.right[1]= {
|
|
|
|
|
FileFormat = {
|
|
|
|
|
provider = 'FileFormat',
|
|
|
|
|
separator = ' ',
|
2020-10-31 21:41:14 +01:00
|
|
|
|
separator_highlight = {colors.bg,colors.bg},
|
|
|
|
|
highlight = {colors.grey,colors.bg},
|
2020-10-29 02:59:10 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
gls.right[2] = {
|
|
|
|
|
LineInfo = {
|
|
|
|
|
provider = 'LineColumn',
|
|
|
|
|
separator = ' | ',
|
2020-10-31 21:41:14 +01:00
|
|
|
|
separator_highlight = {colors.darkblue,colors.bg},
|
|
|
|
|
highlight = {colors.grey,colors.bg},
|
2020-10-29 02:59:10 +01:00
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
gls.right[3] = {
|
|
|
|
|
PerCent = {
|
|
|
|
|
provider = 'LinePercent',
|
2020-10-31 21:41:14 +01:00
|
|
|
|
separator = ' |',
|
|
|
|
|
separator_highlight = {colors.darkblue,colors.bg},
|
|
|
|
|
highlight = {colors.grey,colors.bg},
|
2020-10-29 02:59:10 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
gls.right[4] = {
|
|
|
|
|
ScrollBar = {
|
|
|
|
|
provider = 'ScrollBar',
|
|
|
|
|
highlight = {colors.yellow,colors.purple},
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
-- gls.short_line_left[1] = {
|
|
|
|
|
-- BufferType = {
|
|
|
|
|
-- provider = 'FileTypeName',
|
|
|
|
|
-- separator = ' ',
|
|
|
|
|
-- separator_highlight = {colors.purple,colors.bg},
|
|
|
|
|
-- highlight = {colors.grey,colors.purple}
|
|
|
|
|
-- }
|
|
|
|
|
-- }
|
|
|
|
|
|
2020-10-29 05:14:19 +01:00
|
|
|
|
gls.short_line_left[1] = {
|
|
|
|
|
LeftEnd = {
|
|
|
|
|
provider = function() return ' ' end,
|
|
|
|
|
separator = ' ',
|
|
|
|
|
separator_highlight = {colors.purple,colors.bg},
|
|
|
|
|
highlight = {colors.purple,colors.bg}
|
|
|
|
|
}
|
|
|
|
|
}
|