--KEYBINDINGS local map = vim.api.nvim_set_keymap local opts = { noremap = true, silent = true } -- Move to previous/next map('n', '', 'BufferLineCyclePrev', opts) map('n', '', 'BufferLineCycleNext', opts) -- Re-order to previous/next map('n', '', 'BufferLineMovePrevious', opts) map('n', '>', 'BufferLineMoveNext', opts) -- Goto buffer in position... map('n', '', 'BufferLineGoToBuffer 1', opts) map('n', '', 'BufferLineGoToBuffer 2', opts) map('n', '', 'BufferLineGoToBuffer 3', opts) map('n', '', 'BufferLineGoToBuffer 4', opts) map('n', '', 'BufferLineGoToBuffer 5', opts) map('n', '', 'BufferLineGoToBuffer 6', opts) map('n', '', 'BufferLineGoToBuffer 7', opts) map('n', '', 'BufferLineGoToBuffer 8', opts) map('n', '', 'BufferLineGoToBuffer 9', opts) -- Close buffer map('n', '', 'BufferLinePickClose', opts) -- Set bufferline's options require("bufferline").setup({ options = { mode = "buffers", numbers = "none", close_command = "bdelete! %d", right_mouse_command = "bdelete! %d", left_mouse_command = "buffer %d", middle_mouse_command = "bdelete! %d", indicator = { icon = "▎", style = "icon", }, buffer_close_icon = '', modified_icon = '●', close_icon = '', left_trunc_marker = '', right_trunc_marker = '', max_name_length = 18, max_prefix_length = 15, truncate_names = true, tab_size = 18, diagnostics = "nvim_lsp", diagnostics_update_in_insert = true, diagnostics_indicator = function(count, level, diagnostics_dict, context) return "(" .. count .. ")" end, color_icons = true, show_buffer_icons = true, show_buffer_close_icons = true, show_buffer_default_icon = true, show_close_icon = true, show_tab_indicators = true, show_duplicate_prefix = true, persist_buffer_sort = true, separator_style = "slant", enforce_regular_tabs = true, always_show_bufferline = true, hover = { enabled = true, delay = 200, reveal = { 'close' } }, sort_by = 'insert_after_current', custom_filter = function(buf_number, buf_numbers) -- filter out filetypes you don't want to see if vim.bo[buf_number].filetype ~= "" then return true end end, }, highlights = require("catppuccin.groups.integrations.bufferline").get() })