Neovim/lua/plugins/cokeline.lua

104 lines
3.3 KiB
Lua
Raw Normal View History

2023-11-27 22:37:34 +00:00
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
2024-01-02 22:44:49 +00:00
return "TabLine"
2023-11-27 22:37:34 +00:00
end,
fg = function(buffer)
if buffer.is_focused then
return "Normal"
end
return "TabLine"
end,
bold = function(buffer)
return buffer.is_focused
2023-12-01 17:33:05 +00:00
end,
2023-11-27 22:37:34 +00:00
},
components = {
{
2023-12-01 17:33:05 +00:00
text = function(buffer)
if buffer.is_focused then
2024-01-02 22:44:49 +00:00
return ""
2023-12-01 17:33:05 +00:00
end
return " "
end,
fg = "Normal"
},
2023-11-27 22:37:34 +00:00
{
text = function(buffer)
if buffer.is_modified then
return ''
elseif buffer.is_readonly then
return ''
else
2024-01-02 22:44:49 +00:00
return ' '
2023-11-27 22:37:34 +00:00
end
end
},
2024-01-02 22:44:49 +00:00
{
text = function(buffer) return buffer.devicon.icon end,
fg = function(buffer) return buffer.devicon.color end,
},
{
text = function(buffer) return ' ' .. buffer.filename .. ' ' end,
},
2023-11-27 22:37:34 +00:00
{
text = '󰅖',
on_click = function(_, _, _, _, buffer)
buffer:delete()
end
},
{
text = ' ',
}
},
tabs = {
placement = "right",
components = {
{
text = function(tabpage)
2023-12-01 17:33:05 +00:00
return ' ' .. tabpage.number .. ' '
end,
bg = function(tabpage)
if tabpage.is_active then
2024-01-02 22:44:49 +00:00
return "NormalNC"
2023-12-01 17:33:05 +00:00
end
2024-01-02 22:44:49 +00:00
return "TabLine"
2023-12-01 17:33:05 +00:00
end,
fg = function(tabpage)
if tabpage.is_active then
2024-01-02 22:44:49 +00:00
return "NormalNC"
2023-12-01 17:33:05 +00:00
end
2024-01-02 22:44:49 +00:00
return "TabLine"
2023-12-01 17:33:05 +00:00
end,
bold = true
},
2024-01-02 22:44:49 +00:00
},
2023-11-27 22:37:34 +00:00
},
sidebar = {
filetype = { "NvimTree", "neo-tree", "SidebarNvim" },
components = {
{
2024-01-02 22:44:49 +00:00
text = "",
2023-12-01 17:33:05 +00:00
bg = "ColorColumn"
2023-11-27 22:37:34 +00:00
}
},
},
}
}
}