Use barbar.nvim instead of bufferline

This commit is contained in:
Levente Krizsán 2024-09-04 13:09:35 +02:00
parent 9d83eceebf
commit 435b652c8e
3 changed files with 16 additions and 26 deletions

View File

@ -1,5 +1,6 @@
{ {
"LuaSnip": { "branch": "master", "commit": "45db5addf8d0a201e1cf247cae4cdce605ad3768" }, "LuaSnip": { "branch": "master", "commit": "45db5addf8d0a201e1cf247cae4cdce605ad3768" },
"barbar.nvim": { "branch": "master", "commit": "31b6951c53a59bccfa91bf3984ed1510a940c836" },
"bufferline.nvim": { "branch": "main", "commit": "0b2fd861eee7595015b6561dade52fb060be10c4" }, "bufferline.nvim": { "branch": "main", "commit": "0b2fd861eee7595015b6561dade52fb060be10c4" },
"bufresize.nvim": { "branch": "master", "commit": "3b19527ab936d6910484dcc20fb59bdb12322d8b" }, "bufresize.nvim": { "branch": "master", "commit": "3b19527ab936d6910484dcc20fb59bdb12322d8b" },
"cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
@ -49,4 +50,4 @@
"ts-comments.nvim": { "branch": "main", "commit": "98d7d4dec0af1312d38e288f800bbf6ff562b6ab" }, "ts-comments.nvim": { "branch": "main", "commit": "98d7d4dec0af1312d38e288f800bbf6ff562b6ab" },
"vim-sleuth": { "branch": "master", "commit": "1cc4557420f215d02c4d2645a748a816c220e99b" }, "vim-sleuth": { "branch": "master", "commit": "1cc4557420f215d02c4d2645a748a816c220e99b" },
"which-key.nvim": { "branch": "main", "commit": "bfec3d6bc0a9b0b2cb11644642f78c2c3915eef0" } "which-key.nvim": { "branch": "main", "commit": "bfec3d6bc0a9b0b2cb11644642f78c2c3915eef0" }
} }

View File

@ -1,7 +1,7 @@
-- https://github.com/romgrk/barbar.nvim -- https://github.com/romgrk/barbar.nvim
return { return {
'romgrk/barbar.nvim', 'romgrk/barbar.nvim',
enabled = false, enabled = true,
dependencies = { dependencies = {
'lewis6991/gitsigns.nvim', -- OPTIONAL: for git status 'lewis6991/gitsigns.nvim', -- OPTIONAL: for git status
'nvim-tree/nvim-web-devicons', -- OPTIONAL: for file icons 'nvim-tree/nvim-web-devicons', -- OPTIONAL: for file icons
@ -9,5 +9,17 @@ return {
init = function() init = function()
vim.g.barbar_auto_setup = false vim.g.barbar_auto_setup = false
end, end,
opts = {}, opts = {
sidebar_filetypes = {
['neo-tree'] = { event = 'BufWipeout' },
},
},
config = function(_, opts)
require('barbar').setup(opts)
vim.keymap.set('n', '<Tab>', '<Cmd>BufferNext<CR>', { noremap = true, silent = true, desc = 'Move to next buffer' })
vim.keymap.set('n', '<S-Tab>', '<Cmd>BufferPrevious<CR>', { noremap = true, silent = true, desc = 'Move to previous buffer' })
vim.keymap.set('n', '<leader>bc', '<Cmd>BufferClose<CR>', { noremap = true, silent = true, desc = 'Close current buffer' })
end,
} }

View File

@ -1,23 +0,0 @@
-- https://github.com/akinsho/bufferline.nvim
return {
'akinsho/bufferline.nvim',
enabled = true,
opts = {
options = {
mode = 'buffers',
themable = true,
diagnostics = 'nvim_lsp',
offsets = {
{
filetype = 'neo-tree',
},
},
},
},
config = function(_, opts)
require('bufferline').setup(opts)
vim.keymap.set('n', '<Tab>', ':BufferLineCycleNext<CR>', { noremap = true, silent = true, desc = 'Move to next buffer' })
vim.keymap.set('n', '<S-Tab>', ':BufferLineCyclePrev<CR>', { noremap = true, silent = true, desc = 'Move to previous buffer' })
end,
}