2021-07-15 08:19:22 -07:00
|
|
|
|
local gl = require 'galaxyline'
|
2021-07-11 15:06:37 -07:00
|
|
|
|
local gls = gl.section
|
2021-07-15 08:19:22 -07:00
|
|
|
|
gl.short_line_list = { 'LuaTree', 'vista', 'dbui' }
|
2021-07-11 15:06:37 -07:00
|
|
|
|
|
|
|
|
|
local colors = {
|
|
|
|
|
bg = '#282c34',
|
|
|
|
|
yellow = '#fabd2f',
|
|
|
|
|
cyan = '#008080',
|
|
|
|
|
darkblue = '#081633',
|
|
|
|
|
green = '#afd700',
|
|
|
|
|
orange = '#FF8800',
|
|
|
|
|
purple = '#5d4d7a',
|
|
|
|
|
magenta = '#d16d9e',
|
|
|
|
|
grey = '#c0c0c0',
|
|
|
|
|
blue = '#0087d7',
|
2021-07-15 08:19:22 -07:00
|
|
|
|
red = '#ec5f67',
|
2021-07-11 15:06:37 -07:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
local buffer_not_empty = function()
|
2021-07-15 08:19:22 -07:00
|
|
|
|
if vim.fn.empty(vim.fn.expand '%:t') ~= 1 then
|
2021-07-11 15:06:37 -07:00
|
|
|
|
return true
|
|
|
|
|
end
|
|
|
|
|
return false
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
gls.left[1] = {
|
|
|
|
|
FirstElement = {
|
2021-07-15 08:19:22 -07:00
|
|
|
|
provider = function()
|
|
|
|
|
return '▋'
|
|
|
|
|
end,
|
|
|
|
|
highlight = { colors.blue, colors.yellow },
|
2021-07-11 15:06:37 -07:00
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
gls.left[2] = {
|
|
|
|
|
ViMode = {
|
|
|
|
|
provider = function()
|
2021-07-15 08:19:22 -07:00
|
|
|
|
local alias = { n = 'NORMAL', i = 'INSERT', c = 'COMMAND', v = 'VISUAL', V = 'VISUAL LINE', [''] = 'VISUAL BLOCK' }
|
2021-07-11 15:06:37 -07:00
|
|
|
|
return alias[vim.fn.mode()]
|
|
|
|
|
end,
|
|
|
|
|
separator = '',
|
2021-07-15 08:19:22 -07:00
|
|
|
|
separator_highlight = {
|
|
|
|
|
colors.purple,
|
|
|
|
|
function()
|
|
|
|
|
if not buffer_not_empty() then
|
|
|
|
|
return colors.purple
|
|
|
|
|
end
|
|
|
|
|
return colors.darkblue
|
|
|
|
|
end,
|
|
|
|
|
},
|
|
|
|
|
highlight = { colors.darkblue, colors.purple, 'bold' },
|
2021-07-11 15:06:37 -07:00
|
|
|
|
},
|
|
|
|
|
}
|
2021-07-15 08:19:22 -07:00
|
|
|
|
gls.left[3] = {
|
2021-07-11 15:06:37 -07:00
|
|
|
|
FileIcon = {
|
|
|
|
|
provider = 'FileIcon',
|
|
|
|
|
condition = buffer_not_empty,
|
2021-07-15 08:19:22 -07:00
|
|
|
|
highlight = { require('galaxyline.provider_fileinfo').get_file_icon_color, colors.darkblue },
|
2021-07-11 15:06:37 -07:00
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
gls.left[4] = {
|
|
|
|
|
FileName = {
|
2021-07-15 08:19:22 -07:00
|
|
|
|
provider = { 'FileName', 'FileSize' },
|
2021-07-11 15:06:37 -07:00
|
|
|
|
condition = buffer_not_empty,
|
|
|
|
|
separator = '',
|
2021-07-15 08:19:22 -07:00
|
|
|
|
separator_highlight = { colors.purple, colors.darkblue },
|
|
|
|
|
highlight = { colors.magenta, colors.darkblue },
|
|
|
|
|
},
|
2021-07-11 15:06:37 -07:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gls.left[5] = {
|
|
|
|
|
GitIcon = {
|
2021-07-15 08:19:22 -07:00
|
|
|
|
provider = function()
|
|
|
|
|
return ' '
|
|
|
|
|
end,
|
2021-07-11 15:06:37 -07:00
|
|
|
|
condition = buffer_not_empty,
|
2021-07-15 08:19:22 -07:00
|
|
|
|
highlight = { colors.orange, colors.purple },
|
|
|
|
|
},
|
2021-07-11 15:06:37 -07:00
|
|
|
|
}
|
|
|
|
|
gls.left[6] = {
|
|
|
|
|
GitBranch = {
|
|
|
|
|
provider = 'GitBranch',
|
|
|
|
|
condition = buffer_not_empty,
|
2021-07-15 08:19:22 -07:00
|
|
|
|
highlight = { colors.grey, colors.purple },
|
|
|
|
|
},
|
2021-07-11 15:06:37 -07:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
local checkwidth = function()
|
2021-07-15 08:19:22 -07:00
|
|
|
|
local squeeze_width = vim.fn.winwidth(0) / 2
|
2021-07-11 15:06:37 -07:00
|
|
|
|
if squeeze_width > 40 then
|
|
|
|
|
return true
|
|
|
|
|
end
|
|
|
|
|
return false
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
gls.left[7] = {
|
|
|
|
|
DiffAdd = {
|
|
|
|
|
provider = 'DiffAdd',
|
|
|
|
|
condition = checkwidth,
|
|
|
|
|
icon = ' ',
|
2021-07-15 08:19:22 -07:00
|
|
|
|
highlight = { colors.green, colors.purple },
|
|
|
|
|
},
|
2021-07-11 15:06:37 -07:00
|
|
|
|
}
|
|
|
|
|
gls.left[8] = {
|
|
|
|
|
DiffModified = {
|
|
|
|
|
provider = 'DiffModified',
|
|
|
|
|
condition = checkwidth,
|
|
|
|
|
icon = ' ',
|
2021-07-15 08:19:22 -07:00
|
|
|
|
highlight = { colors.orange, colors.purple },
|
|
|
|
|
},
|
2021-07-11 15:06:37 -07:00
|
|
|
|
}
|
|
|
|
|
gls.left[9] = {
|
|
|
|
|
DiffRemove = {
|
|
|
|
|
provider = 'DiffRemove',
|
|
|
|
|
condition = checkwidth,
|
|
|
|
|
icon = ' ',
|
2021-07-15 08:19:22 -07:00
|
|
|
|
highlight = { colors.red, colors.purple },
|
|
|
|
|
},
|
2021-07-11 15:06:37 -07:00
|
|
|
|
}
|
|
|
|
|
gls.left[10] = {
|
|
|
|
|
LeftEnd = {
|
2021-07-15 08:19:22 -07:00
|
|
|
|
provider = function()
|
|
|
|
|
return ''
|
|
|
|
|
end,
|
2021-07-11 15:06:37 -07:00
|
|
|
|
separator = '',
|
2021-07-15 08:19:22 -07:00
|
|
|
|
separator_highlight = { colors.purple, colors.bg },
|
|
|
|
|
highlight = { colors.purple, colors.purple },
|
|
|
|
|
},
|
2021-07-11 15:06:37 -07:00
|
|
|
|
}
|
|
|
|
|
gls.left[11] = {
|
|
|
|
|
DiagnosticError = {
|
|
|
|
|
provider = 'DiagnosticError',
|
|
|
|
|
icon = ' ',
|
2021-07-15 08:19:22 -07:00
|
|
|
|
highlight = { colors.red, colors.bg },
|
|
|
|
|
},
|
2021-07-11 15:06:37 -07:00
|
|
|
|
}
|
|
|
|
|
gls.left[12] = {
|
|
|
|
|
Space = {
|
2021-07-15 08:19:22 -07:00
|
|
|
|
provider = function()
|
|
|
|
|
return ' '
|
|
|
|
|
end,
|
|
|
|
|
},
|
2021-07-11 15:06:37 -07:00
|
|
|
|
}
|
|
|
|
|
gls.left[13] = {
|
|
|
|
|
DiagnosticWarn = {
|
|
|
|
|
provider = 'DiagnosticWarn',
|
|
|
|
|
icon = ' ',
|
2021-07-15 08:19:22 -07:00
|
|
|
|
highlight = { colors.blue, colors.bg },
|
|
|
|
|
},
|
2021-07-11 15:06:37 -07:00
|
|
|
|
}
|
2021-07-15 08:19:22 -07:00
|
|
|
|
gls.right[1] = {
|
2021-07-11 15:06:37 -07:00
|
|
|
|
FileFormat = {
|
|
|
|
|
provider = 'FileFormat',
|
|
|
|
|
separator = '',
|
2021-07-15 08:19:22 -07:00
|
|
|
|
separator_highlight = { colors.bg, colors.purple },
|
|
|
|
|
highlight = { colors.grey, colors.purple },
|
|
|
|
|
},
|
2021-07-11 15:06:37 -07:00
|
|
|
|
}
|
|
|
|
|
gls.right[2] = {
|
|
|
|
|
LineInfo = {
|
|
|
|
|
provider = 'LineColumn',
|
|
|
|
|
separator = ' | ',
|
2021-07-15 08:19:22 -07:00
|
|
|
|
separator_highlight = { colors.darkblue, colors.purple },
|
|
|
|
|
highlight = { colors.grey, colors.purple },
|
2021-07-11 15:06:37 -07:00
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
gls.right[3] = {
|
|
|
|
|
PerCent = {
|
|
|
|
|
provider = 'LinePercent',
|
|
|
|
|
separator = '',
|
2021-07-15 08:19:22 -07:00
|
|
|
|
separator_highlight = { colors.darkblue, colors.purple },
|
|
|
|
|
highlight = { colors.grey, colors.darkblue },
|
|
|
|
|
},
|
2021-07-11 15:06:37 -07:00
|
|
|
|
}
|
|
|
|
|
gls.right[4] = {
|
|
|
|
|
ScrollBar = {
|
|
|
|
|
provider = 'ScrollBar',
|
2021-07-15 08:19:22 -07:00
|
|
|
|
highlight = { colors.yellow, colors.purple },
|
|
|
|
|
},
|
2021-07-11 15:06:37 -07:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gls.short_line_left[1] = {
|
|
|
|
|
BufferType = {
|
|
|
|
|
provider = 'FileTypeName',
|
|
|
|
|
separator = '',
|
2021-07-15 08:19:22 -07:00
|
|
|
|
separator_highlight = { colors.purple, colors.bg },
|
|
|
|
|
highlight = { colors.grey, colors.purple },
|
|
|
|
|
},
|
2021-07-11 15:06:37 -07:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gls.short_line_right[1] = {
|
|
|
|
|
BufferIcon = {
|
2021-07-15 08:19:22 -07:00
|
|
|
|
provider = 'BufferIcon',
|
2021-07-11 15:06:37 -07:00
|
|
|
|
separator = '',
|
2021-07-15 08:19:22 -07:00
|
|
|
|
separator_highlight = { colors.purple, colors.bg },
|
|
|
|
|
highlight = { colors.grey, colors.purple },
|
|
|
|
|
},
|
2021-07-11 15:06:37 -07:00
|
|
|
|
}
|