Neovim/lua/plugins/cokeline.lua

120 lines
3.8 KiB
Lua
Raw Normal View History

2023-11-27 22:37:34 +00:00
return {
2024-02-23 18:23:02 +00:00
{
2023-11-27 22:37:34 +00:00
"willothy/nvim-cokeline",
config = true,
opts = {
2024-02-23 18:23:02 +00:00
fill_hl = "BufferInactive",
2023-11-27 22:37:34 +00:00
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-02-23 18:23:02 +00:00
return "BufferInactive"
2023-11-27 22:37:34 +00:00
end,
fg = function(buffer)
if buffer.is_focused then
return "Normal"
end
2024-02-23 18:23:02 +00:00
return "BufferInactive"
2023-12-01 17:33:05 +00:00
end,
2023-11-27 22:37:34 +00:00
},
components = {
{
2024-02-23 18:23:02 +00:00
text = ' ',
},
{
text = function(_)
2023-12-01 17:33:05 +00:00
return " "
end,
fg = "Normal"
},
{
text = function(buffer) return buffer.devicon.icon end,
2023-11-27 22:37:34 +00:00
fg = function(buffer) return buffer.devicon.color end,
},
{
text = function(buffer) return ' ' .. buffer.filename .. ' ' end,
},
2024-02-23 18:23:02 +00:00
{
text = ' ',
},
2023-11-27 22:37:34 +00:00
{
text = function(buffer)
if buffer.is_modified then
2024-02-23 18:23:02 +00:00
return ''
2023-11-27 22:37:34 +00:00
elseif buffer.is_readonly then
2024-02-23 18:23:02 +00:00
return ''
2023-11-27 22:37:34 +00:00
else
2024-02-23 18:23:02 +00:00
return '󰅖'
2023-11-27 22:37:34 +00:00
end
2024-02-23 18:23:02 +00:00
end,
2023-11-27 22:37:34 +00:00
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-02-23 18:23:02 +00:00
return "Normal"
2023-12-01 17:33:05 +00:00
end
2024-02-23 18:23:02 +00:00
return "BufferInactive"
2023-12-01 17:33:05 +00:00
end,
fg = function(tabpage)
if tabpage.is_active then
2024-02-23 18:23:02 +00:00
return "Normal"
2023-12-01 17:33:05 +00:00
end
2024-02-23 18:23:02 +00:00
return "BufferInactive"
end
2023-12-01 17:33:05 +00:00
},
{
text = function(tabpage)
if tabpage.is_active then
2024-02-23 18:23:02 +00:00
return "󰅙 "
2023-12-01 17:33:05 +00:00
end
return ""
end,
on_click = function(_, _, _, _, tabpage)
tabpage:close()
end,
2024-02-23 18:23:02 +00:00
bg = function(_)
2023-12-01 17:33:05 +00:00
return "Normal"
end,
2024-02-23 18:23:02 +00:00
fg = function(_)
return "Normal"
end
}
},
2023-11-27 22:37:34 +00:00
},
sidebar = {
filetype = { "NvimTree", "neo-tree", "SidebarNvim" },
components = {
{
2024-02-23 18:23:02 +00:00
text = "",
bg = "Normal",
fg = "Normal"
2023-11-27 22:37:34 +00:00
}
},
},
}
}
}
2024-02-23 18:23:02 +00:00