dotfiles/hm/vim/feline.lua

166 lines
6.2 KiB
Lua
Raw Permalink Normal View History

vim.cmd([[
set noshowmode
set laststatus=2
]])
local base16_colors = require('base16-colorscheme').colors
2021-07-04 22:47:10 +02:00
local vi_mode_utils = require('feline.providers.vi_mode')
local lsp = require('feline.providers.lsp')
require('feline').setup({
default_bg = 'base01',
default_fg = 'base04',
theme = {
base00 = base16_colors.base00,
base01 = base16_colors.base01,
base02 = base16_colors.base02,
base03 = base16_colors.base03,
base04 = base16_colors.base04,
base05 = base16_colors.base05,
base06 = base16_colors.base06,
base07 = base16_colors.base07,
base08 = base16_colors.base08,
base09 = base16_colors.base09,
base0A = base16_colors.base0A,
base0B = base16_colors.base0B,
base0C = base16_colors.base0C,
base0D = base16_colors.base0D,
base0E = base16_colors.base0E,
base0F = base16_colors.base0F,
},
2021-07-04 22:47:10 +02:00
components = {
2021-11-11 21:52:05 +01:00
active = {
{
2021-07-04 22:47:10 +02:00
{
provider = function() return string.format(' %d ', vim.fn.line('$')) end,
-- If you can, make it depend on the actual bar size
left_sep = {
{str = 'block', fg = 'base05'}
},
hl = {
fg = 'base01',
bg = 'base04',
},
},
{
provider = 'vi_mode',
hl = function()
return {
name = vi_mode_utils.get_mode_highlight_name(),
bg = vi_mode_utils.get_mode_color(),
fg = 'white',
style = 'bold',
}
end,
left_sep = {''},
right_sep = {''},
},
{
provider='',
hl = function()
return {
bg = vi_mode_utils.get_mode_color(),
fg = (vim.bo.modified and 'base09') or 'base0D',
}
end,
},
{
provider = 'file_info',
type = 'relative',
hl = function()
return {
fg = 'base06',
bg = (vim.bo.modified and 'base09') or 'base0D',
style = 'bold',
}
end,
left_sep = {''},
right_sep = {''},
},
{
provider='',
hl = function()
return {
bg = 'base02',
fg = (vim.bo.modified and 'base09') or 'base0D',
}
end,
},
{
provider = 'position',
hl = { fg = 'base05', bg = 'base02' },
right_sep = {''},
},
-- If it miraculously became easy to do, add LSP position here
{
provider='',
hl = { bg = 'base01', fg = 'base02' },
},
2021-11-11 21:52:05 +01:00
},
{
2021-07-04 22:47:10 +02:00
{
provider='',
hl = { bg = 'base03', fg = 'base01', },
},
{
provider='z',
enabled = function() return next(vim.lsp.buf_get_clients()) == nil end,
hl = { bg = 'base03', fg = 'base01', },
left_sep = '',
},
{
provider = 'diagnostic_errors',
2022-01-08 16:34:39 +01:00
enabled = function() return lsp.diagnostics_exist(vim.diagnostic.severity.ERROR) end,
2021-07-04 22:47:10 +02:00
hl = { fg = 'red', bg = 'base03', },
left_sep = '',
},
{
provider = 'diagnostic_warnings',
2022-01-08 16:34:39 +01:00
enabled = function() return lsp.diagnostics_exist(vim.diagnostic.severity.WARN) end,
2021-07-04 22:47:10 +02:00
hl = { fg = 'yellow', bg = 'base03', },
left_sep = '',
},
{
provider = 'diagnostic_hints',
2022-01-08 16:34:39 +01:00
enabled = function() return lsp.diagnostics_exist(vim.diagnostic.severity.HINT) end,
2021-07-04 22:47:10 +02:00
hl = { fg = 'cyan', bg = 'base03', },
left_sep = '',
},
{
provider = 'diagnostic_info',
2022-01-08 16:34:39 +01:00
enabled = function() return lsp.diagnostics_exist(vim.diagnostic.severity.INFO) end,
2021-07-04 22:47:10 +02:00
hl = { fg = 'skyblue', bg = 'base03', },
left_sep = '',
},
{
provider='█',
hl = { bg = 'base02', fg = 'base03', },
},
{
provider = 'git_diff_added',
hl = { fg = 'green', bg = 'base02', },
left_sep = '',
enabled = function() return vim.b.gitsigns_status_dict end,
},
{
provider = 'git_diff_changed',
hl = { fg = 'orange', bg = 'base02', },
left_sep = '',
enabled = function() return vim.b.gitsigns_status_dict end,
},
{
provider = 'git_diff_removed',
hl = { fg = 'red', bg = 'base02', },
left_sep = '',
enabled = function() return vim.b.gitsigns_status_dict end,
},
{
provider = 'git_branch',
hl = { fg = 'base05', bg = 'base02', style = 'bold', },
right_sep = '',
left_sep = '',
enabled = function() return vim.b.gitsigns_status_dict end,
},
}
},
}
})