aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Triguba <eugene.triguba@paymentworks.com>2025-06-02 09:27:41 -0400
committerEugene Triguba <eugene.triguba@paymentworks.com>2025-06-02 09:27:41 -0400
commit838688f2449e2e61f6d19ea11b8812ba784e0745 (patch)
tree926322d837d3414523a7a75518da4adbe74a618b
parentadd conform keys/formatters and cleanup lsp config (diff)
downloaddotfiles-838688f2449e2e61f6d19ea11b8812ba784e0745.zip
add barbar for tabs
-rw-r--r--nvim/.config/nvim/lazy-lock.json1
-rw-r--r--nvim/.config/nvim/lua/plugins/barbar.lua74
2 files changed, 75 insertions, 0 deletions
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', '<A-,>', '<Cmd>BufferPrevious<CR>', opts)
+ map('n', '<A-.>', '<Cmd>BufferNext<CR>', opts)
+
+ -- Re-order to previous/next
+ map('n', '<A-<>', '<Cmd>BufferMovePrevious<CR>', opts)
+ map('n', '<A->>', '<Cmd>BufferMoveNext<CR>', opts)
+
+ -- Goto buffer in position...
+ map('n', '<A-1>', '<Cmd>BufferGoto 1<CR>', opts)
+ map('n', '<A-2>', '<Cmd>BufferGoto 2<CR>', opts)
+ map('n', '<A-3>', '<Cmd>BufferGoto 3<CR>', opts)
+ map('n', '<A-4>', '<Cmd>BufferGoto 4<CR>', opts)
+ map('n', '<A-5>', '<Cmd>BufferGoto 5<CR>', opts)
+ map('n', '<A-6>', '<Cmd>BufferGoto 6<CR>', opts)
+ map('n', '<A-7>', '<Cmd>BufferGoto 7<CR>', opts)
+ map('n', '<A-8>', '<Cmd>BufferGoto 8<CR>', opts)
+ map('n', '<A-9>', '<Cmd>BufferGoto 9<CR>', opts)
+ map('n', '<A-0>', '<Cmd>BufferLast<CR>', opts)
+
+ -- Pin/unpin buffer
+ map('n', '<A-p>', '<Cmd>BufferPin<CR>', opts)
+
+ -- Goto pinned/unpinned buffer
+ -- :BufferGotoPinned
+ -- :BufferGotoUnpinned
+
+ -- Close buffer
+ map('n', '<A-c>', '<Cmd>BufferClose<CR>', opts)
+
+ -- Wipeout buffer
+ -- :BufferWipeout
+
+ -- Close commands
+ -- :BufferCloseAllButCurrent
+ -- :BufferCloseAllButPinned
+ -- :BufferCloseAllButCurrentOrPinned
+ -- :BufferCloseBuffersLeft
+ -- :BufferCloseBuffersRight
+
+ -- Magic buffer-picking mode
+ map('n', '<C-p>', '<Cmd>BufferPick<CR>', opts)
+ map('n', '<C-s-p>', '<Cmd>BufferPickDelete<CR>', opts)
+
+ -- Sort automatically by...
+ map('n', '<Space>bb', '<Cmd>BufferOrderByBufferNumber<CR>', opts)
+ map('n', '<Space>bn', '<Cmd>BufferOrderByName<CR>', opts)
+ map('n', '<Space>bd', '<Cmd>BufferOrderByDirectory<CR>', opts)
+ map('n', '<Space>bl', '<Cmd>BufferOrderByLanguage<CR>', opts)
+ map('n', '<Space>bw', '<Cmd>BufferOrderByWindowNumber<CR>', opts)
+
+ -- Other:
+ -- :BarbarEnable - enables barbar (enabled by default)
+ -- :BarbarDisable - very bad command, should never be used
+ end,
+ },
+}