From 838688f2449e2e61f6d19ea11b8812ba784e0745 Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Mon, 2 Jun 2025 09:27:41 -0400 Subject: add barbar for tabs --- nvim/.config/nvim/lazy-lock.json | 1 + nvim/.config/nvim/lua/plugins/barbar.lua | 74 ++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 nvim/.config/nvim/lua/plugins/barbar.lua (limited to 'nvim') diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index ea24cea..c61ca2b 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -1,5 +1,6 @@ { "LuaSnip": { "branch": "master", "commit": "458560534a73f7f8d7a11a146c801db00b081df0" }, + "barbar.nvim": { "branch": "master", "commit": "53b5a2f34b68875898f0531032fbf090e3952ad7" }, "blink.cmp": { "branch": "main", "commit": "022521a8910a5543b0251b21c9e1a1e989745796" }, "conform.nvim": { "branch": "master", "commit": "6feb2f28f9a9385e401857b21eeac3c1b66dd628" }, "fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" }, diff --git a/nvim/.config/nvim/lua/plugins/barbar.lua b/nvim/.config/nvim/lua/plugins/barbar.lua new file mode 100644 index 0000000..9787b05 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/barbar.lua @@ -0,0 +1,74 @@ +return { + { + 'romgrk/barbar.nvim', + dependencies = { + 'lewis6991/gitsigns.nvim', + 'nvim-tree/nvim-web-devicons', + }, + init = function() + vim.g.barbar_auto_setup = false + end, + version = '^1.0.0', + config = function() + require('barbar').setup {} + + local map = vim.api.nvim_set_keymap + local opts = { noremap = true, silent = true } + + -- Move to previous/next + map('n', '', 'BufferPrevious', opts) + map('n', '', 'BufferNext', opts) + + -- Re-order to previous/next + map('n', '', 'BufferMovePrevious', opts) + map('n', '>', 'BufferMoveNext', opts) + + -- Goto buffer in position... + map('n', '', 'BufferGoto 1', opts) + map('n', '', 'BufferGoto 2', opts) + map('n', '', 'BufferGoto 3', opts) + map('n', '', 'BufferGoto 4', opts) + map('n', '', 'BufferGoto 5', opts) + map('n', '', 'BufferGoto 6', opts) + map('n', '', 'BufferGoto 7', opts) + map('n', '', 'BufferGoto 8', opts) + map('n', '', 'BufferGoto 9', opts) + map('n', '', 'BufferLast', opts) + + -- Pin/unpin buffer + map('n', '', 'BufferPin', opts) + + -- Goto pinned/unpinned buffer + -- :BufferGotoPinned + -- :BufferGotoUnpinned + + -- Close buffer + map('n', '', 'BufferClose', opts) + + -- Wipeout buffer + -- :BufferWipeout + + -- Close commands + -- :BufferCloseAllButCurrent + -- :BufferCloseAllButPinned + -- :BufferCloseAllButCurrentOrPinned + -- :BufferCloseBuffersLeft + -- :BufferCloseBuffersRight + + -- Magic buffer-picking mode + map('n', '', 'BufferPick', opts) + map('n', '', 'BufferPickDelete', opts) + + -- Sort automatically by... + map('n', 'bb', 'BufferOrderByBufferNumber', opts) + map('n', 'bn', 'BufferOrderByName', opts) + map('n', 'bd', 'BufferOrderByDirectory', opts) + map('n', 'bl', 'BufferOrderByLanguage', opts) + map('n', 'bw', 'BufferOrderByWindowNumber', opts) + + -- Other: + -- :BarbarEnable - enables barbar (enabled by default) + -- :BarbarDisable - very bad command, should never be used + end, + }, +} -- cgit v1.2.3