feat: new utils + some styling

This commit is contained in:
2025-09-19 14:35:29 +02:00
parent 85b5984a83
commit f3c775b33b
4 changed files with 176 additions and 168 deletions

View File

@@ -1,107 +1,107 @@
local config = {
highlights = {
buffer_selected = { bold = true },
diagnostic_selected = { bold = true },
info_selected = { bold = true },
info_diagnostic_selected = { bold = true },
warning_selected = { bold = true },
warning_diagnostic_selected = { bold = true },
error_selected = { bold = true },
error_diagnostic_selected = { bold = true },
},
options = {
themeable = true,
numbers = "none",
diagnostics = "nvim_lsp", -- or "coc"
max_prefix_length = 8,
close_command = "b# | bd#",
right_mouse_command = "b# | bd#",
left_mouse_command = "buffer %d",
buffer_close_icon = "󰅖",
modified_icon = "",
close_icon = "",
left_trunc_marker = "",
right_trunc_marker = "",
max_name_length = 18,
truncate_names = true,
tab_size = 18,
color_icons = true,
show_buffer_icons = true,
show_buffer_close_icons = true,
show_tab_indicators = true,
duplicates_across_groups = true, -- whether to consider duplicate paths in different groups as duplicates
persist_buffer_sort = true, -- whether or not custom sorted buffers should persist
separator_style = { "", "" }, -- { "▏", "" } | "slant" | "slope" | "thick" | "thin" | { 'any', 'any' },
-- always_show_bufferline = false,
auto_toggle_bufferline = true,
show_close_icon = true,
hover = {
enabled = true,
delay = 200,
reveal = { "close" },
},
offsets = {
{
filetype = "neo-tree",
text = "",
highlight = "Directory",
separator = "", -- use a "true" to enable the default, or set your own character
},
},
groups = {
options = {
toggle_hidden_on_enter = true, -- when you re-enter a hidden group this options re-opens that group so the buffer is visible
},
items = {
{
name = "Tests",
highlight = { underline = true, sp = "blue" },
priority = 2,
-- icon = " ",
matcher = function(buf)
return buf.path:match("%_test") or buf.path:match("%_spec")
end,
},
{
name = "Docs",
-- icon = "󰈙 ",
highlight = { undercurl = false, sp = "green" },
auto_close = false,
matcher = function(buf)
return buf.path:match("%.md") or buf.path:match("%.txt")
end,
separator = {
style = require("bufferline.groups").separator.tab,
},
},
{
name = "Shells",
highlight = { undercurl = false, sp = "grey" },
auto_close = false,
matcher = function(buf)
return buf.path:match("zsh")
end,
separator = {
style = require("bufferline.groups").separator.tab,
},
},
{
name = "Docker",
highlight = { undercurl = false, sp = "blue" },
auto_close = false,
matcher = function(buf)
return buf.path:match("dockerfile")
or buf.path:match("DOCKERFILE")
or buf.path:match("Dockerfile")
or buf.path:match("docker%-compose%.yml")
end,
separator = {
style = require("bufferline.groups").separator.tab,
},
},
},
},
},
highlights = {
buffer_selected = { bold = true },
diagnostic_selected = { bold = true },
info_selected = { bold = true },
info_diagnostic_selected = { bold = true },
warning_selected = { bold = true },
warning_diagnostic_selected = { bold = true },
error_selected = { bold = true },
error_diagnostic_selected = { bold = true },
},
options = {
themeable = true,
numbers = "none",
diagnostics = "nvim_lsp", -- or "coc"
max_prefix_length = 8,
close_command = "b# | bd#",
right_mouse_command = "b# | bd#",
left_mouse_command = "buffer %d",
buffer_close_icon = "󰅖",
modified_icon = "",
close_icon = "",
left_trunc_marker = "",
right_trunc_marker = "",
max_name_length = 18,
truncate_names = true,
tab_size = 18,
color_icons = true,
show_buffer_icons = true,
show_buffer_close_icons = true,
show_tab_indicators = true,
duplicates_across_groups = true, -- whether to consider duplicate paths in different groups as duplicates
persist_buffer_sort = true, -- whether or not custom sorted buffers should persist
separator_style = { "", "" }, -- { "▏", "" } | "slant" | "slope" | "thick" | "thin" | { 'any', 'any' },
-- always_show_bufferline = false,
auto_toggle_bufferline = true,
show_close_icon = true,
hover = {
enabled = true,
delay = 200,
reveal = { "close" },
},
offsets = {
{
filetype = "neo-tree",
text = "",
highlight = "Directory",
separator = "", -- use a "true" to enable the default, or set your own character
},
},
groups = {
options = {
toggle_hidden_on_enter = true, -- when you re-enter a hidden group this options re-opens that group so the buffer is visible
},
items = {
{
name = "Tests",
highlight = { underline = true, sp = "blue" },
priority = 2,
-- icon = " ",
matcher = function(buf)
return buf.path:match("%_test") or buf.path:match("%_spec")
end,
},
{
name = "Docs",
-- icon = "󰈙 ",
highlight = { undercurl = false, sp = "green" },
auto_close = false,
matcher = function(buf)
return buf.path:match("%.md") or buf.path:match("%.txt")
end,
separator = {
style = require("bufferline.groups").separator.tab,
},
},
{
name = "Shells",
highlight = { undercurl = false, sp = "grey" },
auto_close = false,
matcher = function(buf)
return buf.path:match("zsh")
end,
separator = {
style = require("bufferline.groups").separator.tab,
},
},
{
name = "Docker",
highlight = { undercurl = false, sp = "blue" },
auto_close = false,
matcher = function(buf)
return buf.path:match("dockerfile")
or buf.path:match("DOCKERFILE")
or buf.path:match("Dockerfile")
or buf.path:match("docker%-compose%.yml")
end,
separator = {
style = require("bufferline.groups").separator.tab,
},
},
},
},
},
}
return config

View File

@@ -1,43 +1,43 @@
local options = {
options = {
icons_enabled = true,
theme = "auto",
component_separators = { left = "", right = "" },
section_separators = { left = "", right = "" },
disabled_filetypes = {
statusline = {},
winbar = {},
},
ignore_focus = {},
always_divide_middle = true,
always_show_tabline = true,
globalstatus = true,
refresh = {
statusline = 1000,
tabline = 1000,
winbar = 1000,
},
},
sections = {
lualine_a = { "mode" },
lualine_b = { "branch", "diff" },
lualine_c = { "filename" },
lualine_x = { "diagnostics", "filetype", "encoding", "fileformat" },
lualine_y = { "progress" },
lualine_z = { "location" },
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = { "filename" },
lualine_x = { "location" },
lualine_y = {},
lualine_z = {},
},
tabline = {},
winbar = {},
inactive_winbar = {},
extensions = {},
options = {
icons_enabled = true,
theme = "auto",
component_separators = { left = "", right = "" },
section_separators = { left = "", right = "" },
disabled_filetypes = {
statusline = {},
winbar = {},
},
ignore_focus = {},
always_divide_middle = true,
always_show_tabline = true,
globalstatus = true,
refresh = {
statusline = 1000,
tabline = 1000,
winbar = 1000,
},
},
sections = {
lualine_a = { "mode" },
lualine_b = { "branch", "diff" },
lualine_c = { "filename" },
lualine_x = { "diagnostics", "filetype", "encoding", "fileformat" },
lualine_y = { "progress" },
lualine_z = { "location" },
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = { "filename" },
lualine_x = { "location" },
lualine_y = {},
lualine_z = {},
},
tabline = {},
winbar = {},
inactive_winbar = {},
extensions = {},
}
return options