style(nvim): remove tabs from lua

This commit is contained in:
Rob Watson 2024-12-03 04:39:31 +01:00
parent d6dbebea76
commit aa312d252e
1 changed files with 97 additions and 97 deletions

View File

@ -1,111 +1,111 @@
require("nvim-web-devicons").setup({}) require("nvim-web-devicons").setup({})
local mode_map = { local mode_map = {
NORMAL = "N", NORMAL = "N",
INSERT = "I", INSERT = "I",
REPLACE = "R", REPLACE = "R",
COMMAND = "C", COMMAND = "C",
VISUAL = "v", VISUAL = "v",
["V-BLOCK"] = "V", ["V-BLOCK"] = "V",
["V-LINE"] = "V-LINE", ["V-LINE"] = "V-LINE",
} }
local function format_diff_element(val, sym) local function format_diff_element(val, sym)
if val == nil or val < 1 then if val == nil or val < 1 then
return "" return ""
end end
return sym .. val return sym .. val
end end
local diagnostics = { local diagnostics = {
"diagnostics", "diagnostics",
sources = { "nvim_lsp" }, sources = { "nvim_lsp" },
diagnostics_color = { diagnostics_color = {
error = { fg = "#ffffff", bg = "#bf616a" }, error = { fg = "#ffffff", bg = "#bf616a" },
warn = { fg = "#ebcb8b" }, warn = { fg = "#ebcb8b" },
info = { fg = "#81a1c1" }, info = { fg = "#81a1c1" },
hint = { fg = "#a3be8c" }, hint = { fg = "#a3be8c" },
}, },
always_visible = false, always_visible = false,
separator = { left = " " }, separator = { left = " " },
symbols = { symbols = {
error = function(count) error = function(count)
return count .. "E" return count .. "E"
end, end,
warn = function(count) warn = function(count)
return count .. "W" return count .. "W"
end, end,
info = function(count) info = function(count)
return count .. "I" return count .. "I"
end, end,
hint = function(count) hint = function(count)
return count .. "H" return count .. "H"
end, end,
}, },
} }
require("lualine").setup({ require("lualine").setup({
options = { options = {
icons_enabled = false, icons_enabled = false,
theme = "gruxbox_dark", theme = "gruxbox_dark",
component_separators = "", component_separators = "",
section_separators = { left = "", right = "" }, section_separators = { left = "", right = "" },
}, },
sections = { sections = {
lualine_a = { lualine_a = {
{ {
"mode", "mode",
fmt = function(mode) fmt = function(mode)
return mode_map[mode] or mode return mode_map[mode] or mode
end, end,
}, },
"paste", "paste",
}, },
lualine_b = { "filename" }, lualine_b = { "filename" },
lualine_c = { lualine_c = {
{ {
"branch", "branch",
padding = 1, padding = 1,
}, },
-- render coloured output from gitsigns, this doesn't seem to work with b:gitsigns_status: -- render coloured output from gitsigns, this doesn't seem to work with b:gitsigns_status:
{ {
function() function()
return format_diff_element(vim.b.gitsigns_status_dict.added, "+") return format_diff_element(vim.b.gitsigns_status_dict.added, "+")
end, end,
color = { fg = "#a3be8c" }, color = { fg = "#a3be8c" },
}, },
{ {
function() function()
return format_diff_element(vim.b.gitsigns_status_dict.changed, "~") return format_diff_element(vim.b.gitsigns_status_dict.changed, "~")
end, end,
color = { fg = "#ebcb8b" }, color = { fg = "#ebcb8b" },
}, },
{ {
function() function()
return format_diff_element(vim.b.gitsigns_status_dict.removed, "-") return format_diff_element(vim.b.gitsigns_status_dict.removed, "-")
end, end,
color = { fg = "#bf616a" }, color = { fg = "#bf616a" },
}, },
diagnostics, diagnostics,
}, },
lualine_x = { lualine_x = {
{ {
function() function()
return vim.bo.filetype return vim.bo.filetype
end, end,
padding = { left = 1, right = 0 }, padding = { left = 1, right = 0 },
}, },
}, },
lualine_y = { { "progress", padding = { left = 1, right = 1 } } }, lualine_y = { { "progress", padding = { left = 1, right = 1 } } },
lualine_z = { { "location", padding = { left = 1, right = 1 } } }, lualine_z = { { "location", padding = { left = 1, right = 1 } } },
}, },
inactive_sections = { inactive_sections = {
lualine_a = {}, lualine_a = {},
lualine_b = {}, lualine_b = {},
lualine_c = { "filename", diagnostics }, lualine_c = { "filename", diagnostics },
lualine_x = { { "location", padding = { right = 0 } } }, lualine_x = { { "location", padding = { right = 0 } } },
lualine_y = {}, lualine_y = {},
lualine_z = {}, lualine_z = {},
}, },
}) })