Does anyone have a modern configuration? #167
-
I know there is the require('cokeline').setup({}) in the documentation. But I don't know Lua and I haven't updated this plugin for months, now everything is broken and I can't find a way to display the tabs. This is the config I'm trying: require('cokeline').setup({
-- Only show the bufferline when there are at least this many visible buffers.
-- default: `1`.
show_if_buffers_are_at_least = 1,
buffers = {
filter_valid = function(buffer) return false end,
-- A looser version of `filter_valid`, use this function if you still
-- want the `cokeline-{switch,focus}-{prev,next}` mappings to work for
-- these buffers without displaying them in your bufferline.
-- default: `false`
filter_visible = function(buffer) return false end,
-- Which buffer to focus when a buffer is deleted, `prev` focuses the
-- buffer to the left of the deleted one while `next` focuses the one the
-- right.
-- default: 'next'.
focus_on_delete = 'next',
-- If set to `last` new buffers are added to the end of the bufferline,
-- if `next` they are added next to the current buffer.
-- if set to `directory` buffers are sorted by their full path.
-- if set to `number` buffers are sorted by bufnr, as in default Neovim
-- default: 'last'.
--[[ new_buffers_position = 'last' | 'next' | 'directory' | 'number' | fun(buffer_a, buffer_b) -> true | false, ]]
new_buffers_position = 'last',
delete_on_right_click = false,
},
mappings = {
-- Controls what happens when the first (last) buffer is focused and you
-- try to focus/switch the previous (next) buffer. If `true` the last
-- (first) buffers gets focused/switched, if `false` nothing happens.
-- default: `true`.
cycle_prev_next = true,
disable_mouse = true,
},
-- Maintains a history of focused buffers using a ringbuffer
history = {
enabled = true,
size = 2
},
rendering = {
-- The maximum number of characters a rendered buffer is allowed to take
-- up. The buffer will be truncated if its width is bigger than this
-- value.
-- default: `999`.
max_buffer_width = 999,
},
pick = {
-- Whether to use the filename's first letter first before
-- picking a letter from the valid letters list in order.
-- default: `true`
use_filename = true,
-- The list of letters that are valid as pick letters. Sorted by
-- keyboard reachability by default, but may require tweaking for
-- non-QWERTY keyboard layouts.
-- default: `'asdfjkl;ghnmxcvbziowerutyqpASDFJKLGHNMXCVBZIOWERTYQP'`
letters = 'string',
},
-- The default highlight group values.
-- The `fg`, `bg`, and `sp` keys are either colors in hexadecimal format or
-- functions taking a `buffer` parameter and returning a color in
-- hexadecimal format. Style attributes work the same way, but functions
-- should return boolean values.
default_hl = {
-- default: `ColorColumn`'s background color for focused buffers,
-- `Normal`'s foreground color for unfocused ones.
fg = 'hlgroup',
-- default: `Normal`'s foreground color for focused buffers,
-- `ColorColumn`'s background color for unfocused ones.
-- default: `Normal`'s foreground color.
bg = 'hlgroup',
-- default: unset.
sp = 'hlgroup',
bold = false,
italic = false,
underline = false,
undercurl = false,
strikethrough = false,
},
-- The highlight group used to fill the tabline space
fill_hl = 'TabLineFill',
-- A list of components to be rendered for each buffer. Check out the section
-- below explaining what this value can be set to.
-- default: see `/lua/cokeline/defaults.lua`
--[[ components = {..}, ]]
-- Custom areas can be displayed on the right hand side of the bufferline.
-- They act identically to buffer components, except their methods don't take a Buffer object.
-- If you want a rhs component to be stateful, you can wrap it in a closure containing state.
--[[ rhs = {..}, ]]
-- Tabpages can be displayed on either the left or right of the bufferline.
-- They act the same as other components, except they are passed TabPage objects instead of
-- buffer objects.
tabs = {
placement = "left",
--[[ components = {..} ]]
},
-- Left sidebar to integrate nicely with file explorer plugins.
-- This is a table containing a `filetype` key and a list of `components` to
-- be rendered in the sidebar.
-- The last component will be automatically space padded if necessary
-- to ensure the sidebar and the window below it have the same width.
sidebar = {
filetype = '<filetype>',
--[[ components = {..}, ]]
},
}) Produce this errors:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Fixed the warnings in 7fc83d8. My config quite large and a bit messy but you can check it out here if you want :) Also, a few notes on your config:
If you don't know Lua, you may want to try bufferline.nvim which requires less configuration. Cokeline is more of an API for building your own bufferline/tabline, so the defaults are pretty minimal. |
Beta Was this translation helpful? Give feedback.
Fixed the warnings in 7fc83d8.
My config quite large and a bit messy but you can check it out here if you want :)
Also, a few notes on your config:
filter_valid
andfilter_visible
settings, and returning false from both will hide every buffer,If you don't know Lua, you may want to try bufferline.nvim which requires less configuration. Cokeline is more of an API for building your own bufferline/tabline, so the defaults are pretty minimal.