return { -- tab line "akinsho/bufferline.nvim", version = "*", dependencies = "nvim-tree/nvim-web-devicons", config = function() local bufferline = require("bufferline") bufferline.setup({ options = { mode = "buffers", show_buffer_close_icons = false, middle_mouse_command = "bdelete! %d", indicator = { style = "underline" }, offsets = { { filetype = "NvimTree", text = " ", text_align = "center", separator = true, }, }, separator_style = { " ", " " }, diagnostics = "nvim_lsp", diagnostics_indicator = function(count, level, diagnostics_dict, context) local icon = level:match("error") and "󰅚 " or "󰀪 " return icon .. count end, }, }) local opts = { silent = true } -- go to buffer opts.desc = "go to buffer 1" vim.keymap.set("n", "g1", "BufferLineGoToBuffer 1", opts) opts.desc = "go to buffer 2" vim.keymap.set("n", "g2", "BufferLineGoToBuffer 2", opts) opts.desc = "go to buffer 3" vim.keymap.set("n", "g3", "BufferLineGoToBuffer 3", opts) opts.desc = "go to buffer 4" vim.keymap.set("n", "g4", "BufferLineGoToBuffer 4", opts) opts.desc = "go to buffer 5" vim.keymap.set("n", "g5", "BufferLineGoToBuffer 5", opts) opts.desc = "go to buffer 6" vim.keymap.set("n", "g6", "BufferLineGoToBuffer 6", opts) opts.desc = "go to buffer 7" vim.keymap.set("n", "g7", "BufferLineGoToBuffer 7", opts) opts.desc = "go to buffer 8" vim.keymap.set("n", "g8", "BufferLineGoToBuffer 8", opts) opts.desc = "go to buffer 9" vim.keymap.set("n", "g9", "BufferLineGoToBuffer 9", opts) opts.desc = "go to buffer 10" vim.keymap.set("n", "g0", "BufferLineGoToBuffer 10", opts) opts.desc = nil -- cycle between buffers vim.keymap.set("n", "J", "BufferLineCyclePrev", opts) vim.keymap.set("n", "K", "BufferLineCycleNext", opts) -- move buffers vim.keymap.set("n", "", "BufferLineMovePrev", opts) vim.keymap.set("n", "", "BufferLineMoveNext", opts) -- go to previous buffer vim.keymap.set({ "n", "i" }, "", "b#", opts) end, }