nvim lualine tweaks

This commit is contained in:
Henrik Bakken
2025-08-20 10:21:23 +02:00
parent a58a5a7e5f
commit 11cab46f0c
+18 -22
View File
@@ -284,14 +284,11 @@ vim.api.nvim_create_autocmd("FileType", {
}, },
callback = function(event) callback = function(event)
vim.bo[event.buf].buflisted = false vim.bo[event.buf].buflisted = false
vim.schedule(function() vim.schedule(
vim.keymap.set( function()
"n", vim.keymap.set("n", "q", "<cmd>q<cr>", { buffer = event.buf, silent = true, desc = "Quit Buffer" })
"q", end
"<cmd>q<cr>", )
{ buffer = event.buf, silent = true, desc = "Quit Buffer" }
)
end)
end, end,
}) })
@@ -519,24 +516,19 @@ local function makespec_lualine()
"nvim-lualine/lualine.nvim", "nvim-lualine/lualine.nvim",
dependencies = { "echasnovski/mini.icons", "folke/noice.nvim" }, dependencies = { "echasnovski/mini.icons", "folke/noice.nvim" },
opts = { opts = {
options = { theme = "auto", globalstatus = false }, options = { theme = "auto", globalstatus = false, always_divide_middle = false },
extensions = { "fugitive", "neo-tree", "lazy" }, extensions = { "fugitive", "neo-tree", "lazy" },
sections = { sections = {
lualine_a = { "mode" }, lualine_a = { "mode" },
lualine_b = {}, lualine_b = {},
lualine_c = { { "filename", path = 1, shorting_target = 0 } }, lualine_c = { { "filename", path = 1, shorting_target = 0 } },
lualine_x = { lualine_x = {},
-- { 'require("noice").api.status.message.get()', color = { fg = "#99c794" } }, -- gets too obtrusive
{ 'require("noice").api.status.mode.get()', color = "lualine_a_command" },
{ 'require("noice").api.status.command.get()', color = "lualine_a_command" },
},
lualine_y = { lualine_y = {
"encoding",
"filetype", "filetype",
{ "location", separator = "of", padding = { left = 1, right = 1 } }, { "location", separator = "/", padding = { left = 1, right = 1 } },
"vim.api.nvim_buf_line_count(0)", "vim.api.nvim_buf_line_count(0)",
}, },
lualine_z = { { function() return "" .. os.date("%R") end } }, lualine_z = {},
}, },
inactive_sections = { inactive_sections = {
lualine_a = {}, lualine_a = {},
@@ -546,7 +538,7 @@ local function makespec_lualine()
}, },
lualine_x = {}, lualine_x = {},
lualine_y = { lualine_y = {
{ "location", separator = "of", padding = { left = 1, right = 1 } }, { "location", separator = "/", padding = { left = 1, right = 1 } },
"vim.api.nvim_buf_line_count(0)", "vim.api.nvim_buf_line_count(0)",
}, },
lualine_z = {}, lualine_z = {},
@@ -561,15 +553,19 @@ local function makespec_lualine()
}, },
lualine_b = {}, lualine_b = {},
lualine_c = {}, lualine_c = {},
lualine_x = {}, lualine_x = {
lualine_y = {}, -- { 'require("noice").api.status.message.get()', color = { fg = "#99c794" } }, -- gets too obtrusive
lualine_z = { { 'require("noice").api.status.mode.get()', color = "lualine_a_command" },
{ 'require("noice").api.status.command.get()', color = "lualine_a_command" },
},
lualine_y = {
{ {
"tabs", "tabs",
mode = 0, mode = 0,
tabs_color = { active = "lualine_a_command" }, tabs_color = { active = "lualine_b_command" },
}, },
}, },
lualine_z = { { function() return "" .. os.date("%R") end } },
}, },
}, },
} }