FollieHiyuki-dotfiles/home/.config/nvim/lua/modules/statusline.lua
2021-10-17 21:48:04 +07:00

235 lines
5.6 KiB
Lua
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

local gl = require('galaxyline')
local gls = gl.section
local condition = require('galaxyline.condition')
gl.short_line_list = {'NvimTree', 'packer', 'Outline'}
local colors = require('colors.' .. vim.g.global_theme).colors
gls.left[1] = {
LeftCorner = {
provider = function()
return ''
end,
highlight = {colors.blue, colors.grey1}
}
}
gls.left[2] = {
ViMode = {
provider = function()
local mode_color = {
n = colors.green, -- Normal
no = colors.green, -- N-Pending
i = colors.blue, -- Insert
ic = colors.blue, -- Insert
v = colors.yellow, -- Visual
[''] = colors.yellow, -- V-Block
V = colors.yellow, -- V-Line
c = colors.white2, -- Command
s = colors.purple, -- Select
S = colors.purple, -- S-Line
[''] = colors.purple, -- S-Block
R = colors.red, -- Replace
Rv = colors.red, -- V-Replace
cv = colors.white2, -- Vim-Ex
ce = colors.white2, -- Ex
r = colors.cyan, -- Prompt
rm = colors.cyan, -- More
['r?'] = colors.cyan, -- Confirm
['!'] = colors.orange, -- Shell
t = colors.orange -- Terminal
}
vim.api.nvim_command('hi GalaxyViMode guifg=' .. mode_color[vim.fn.mode()])
return ''
end,
highlight = {colors.green, colors.grey1}
}
}
gls.left[3] = {
FileSize = {
provider = 'FileSize',
condition = condition.buffer_not_empty,
highlight = {colors.fg, colors.grey1}
}
}
gls.left[4] ={
FileIcon = {
provider = 'FileIcon',
condition = condition.buffer_not_empty,
highlight = {
require('galaxyline.provider_fileinfo').get_file_icon_color,
colors.grey1
}
}
}
gls.left[5] = {
FileName = {
provider = 'FileName',
condition = condition.buffer_not_empty,
highlight = {colors.fg, colors.grey1, 'bold'}
}
}
gls.left[6] = {
LineInfo = {
provider = 'LineColumn',
highlight = {colors.fg, colors.grey1}
}
}
gls.left[7] = {
PerCent = {
provider = 'LinePercent',
highlight = {colors.fg, colors.grey1, 'bold'}
}
}
gls.left[8] = {
DiagnosticError = {
provider = 'DiagnosticError',
icon = '',
highlight = {colors.red, colors.grey1}
}
}
gls.left[9] = {
DiagnosticWarn = {
provider = 'DiagnosticWarn',
icon = '',
highlight = {colors.yellow, colors.grey1}
}
}
gls.left[10] = {
DiagnosticHint = {
provider = 'DiagnosticHint',
icon = '',
highlight = {colors.cyan, colors.grey1}
}
}
gls.left[11] = {
DiagnosticInfo = {
provider = 'DiagnosticInfo',
icon = '',
highlight = {colors.blue, colors.grey1}
}
}
gls.right[1] = {
ShowLspClient = {
provider = 'GetLspClient',
condition = function ()
local tbl = {['dashboard'] = true, [''] = true}
if tbl[vim.bo.filetype] then
return false
end
return true
end,
icon = ' LSP:',
highlight = {colors.purple, colors.grey1, 'bold'}
}
}
gls.right[2] = {
FileEncode = {
provider = 'FileEncode',
condition = condition.hide_in_width,
separator = ' ',
separator_highlight = {'NONE', colors.grey1},
highlight = {colors.fg, colors.grey1}
}
}
gls.right[3] = {
FileFormat = {
provider = 'FileFormat',
condition = condition.hide_in_width,
separator = ' ',
separator_highlight = {'NONE', colors.grey1},
highlight = {colors.fg, colors.grey1}
}
}
gls.right[4] = {
GitIcon = {
provider = function() return '' end,
condition = condition.check_git_workspace,
separator = ' ',
separator_highlight = {'NONE', colors.grey1},
highlight = {colors.green, colors.grey1, 'bold'}
}
}
gls.right[5] = {
GitBranch = {
provider = 'GitBranch',
condition = condition.check_git_workspace,
highlight = {colors.green, colors.grey1, 'bold'}
}
}
gls.right[6] = {
GitSeparator = {
provider = function()
return ' '
end,
highlight = {colors.green, colors.grey1}
}
}
gls.right[7] = {
DiffAdd = {
provider = 'DiffAdd',
condition = condition.hide_in_width,
icon = '',
highlight = {colors.green, colors.grey1}
}
}
gls.right[8] = {
DiffModified = {
provider = 'DiffModified',
condition = condition.hide_in_width,
icon = '',
highlight = {colors.yellow, colors.grey1}
}
}
gls.right[9] = {
DiffRemove = {
provider = 'DiffRemove',
condition = condition.hide_in_width,
icon = '',
highlight = {colors.red, colors.grey1}
}
}
gls.short_line_left[1] = {
BufferType = {
provider = 'FileTypeName',
separator = ' ',
separator_highlight = {'NONE', colors.grey1},
highlight = {colors.blue, colors.grey1, 'bold'}
}
}
gls.short_line_left[2] = {
SFileName = {
provider = 'SFileName',
condition = condition.buffer_not_empty,
highlight = {colors.fg, colors.grey1, 'bold'}
}
}
gls.short_line_right[1] = {
BufferIcon = {
provider= 'BufferIcon',
highlight = {colors.fg, colors.grey1}
}
}