Neovim/lua/plugins/cokeline.lua

128 lines
4.3 KiB
Lua

return {
{
"willothy/nvim-cokeline",
config = true,
opts = {
show_if_buffers_are_at_least = 1,
buffers = {
focus_on_delete = "next",
new_buffers_position = 'last',
},
mappings = {
disable_mouse = false,
},
default_hl = {
bg = function(buffer)
if buffer.is_focused then
return "Normal"
end
return "ColorColumn"
end,
fg = function(buffer)
if buffer.is_focused then
return "Normal"
end
return "TabLine"
end,
bold = function(buffer)
return buffer.is_focused
end,
},
components = {
{
text = function(buffer)
if buffer.is_focused then
return ""
end
return " "
end,
fg = "Normal"
},
{
text = function(buffer) return buffer.devicon.icon end,
fg = function(buffer) return buffer.devicon.color end,
},
{
text = function(buffer) return ' ' .. buffer.filename .. ' ' end,
},
{
text = function(buffer)
if buffer.is_modified then
return ''
elseif buffer.is_readonly then
return ''
else
return ''
end
end
},
{
text = '󰅖',
on_click = function(_, _, _, _, buffer)
buffer:delete()
end
},
{
text = ' ',
}
},
tabs = {
placement = "right",
components = {
{
text = function(tabpage)
return ' ' .. tabpage.number .. ' '
end,
bg = function(tabpage)
if tabpage.is_active then
return "TabLineSel"
end
return "ColorColumn"
end,
fg = function(tabpage)
if tabpage.is_active then
return "TabLine"
end
return "Normal"
end,
bold = true
},
{
text = function(tabpage)
if tabpage.is_active then
return "󰅖 "
end
return ""
end,
on_click = function(_, _, _, _, tabpage)
tabpage:close()
end,
bg = function(tabpage)
if tabpage.is_active then
return "TabLineSel"
end
return "ColorColumn"
end,
fg = function(tabpage)
if tabpage.is_active then
return "TabLine"
end
return "Normal"
end,
bold = true
},
}
},
sidebar = {
filetype = { "NvimTree", "neo-tree", "SidebarNvim" },
components = {
{
text = "Explorer",
bg = "ColorColumn"
}
},
},
}
}
}