From 3e0eb965a4fc498d1969b2abf96a3039012cdf04 Mon Sep 17 00:00:00 2001 From: bunny winter Date: Wed, 8 Jan 2025 21:01:31 -0600 Subject: [PATCH] add barbar --- lazy-lock.json | 1 + lua/nyanko/lazy/barbar.lua | 78 +++++++++++++++++++++++++++++++++++ lua/nyanko/lazy/which-key.lua | 1 + 3 files changed, 80 insertions(+) create mode 100644 lua/nyanko/lazy/barbar.lua diff --git a/lazy-lock.json b/lazy-lock.json index cfa9361..815c941 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,6 +1,7 @@ { "LuaSnip": { "branch": "master", "commit": "c9b9a22904c97d0eb69ccb9bab76037838326817" }, "alpha-nvim": { "branch": "main", "commit": "de72250e054e5e691b9736ee30db72c65d560771" }, + "barbar.nvim": { "branch": "master", "commit": "40c176c9af7e9aefe3af9ec9d985a3edb50d66a3" }, "catppuccin": { "branch": "main", "commit": "f67b886d65a029f12ffa298701fb8f1efd89295d" }, "cmp-nvim-lsp": { "branch": "main", "commit": "99290b3ec1322070bcfb9e846450a46f6efa50f0" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, diff --git a/lua/nyanko/lazy/barbar.lua b/lua/nyanko/lazy/barbar.lua new file mode 100644 index 0000000..e48b316 --- /dev/null +++ b/lua/nyanko/lazy/barbar.lua @@ -0,0 +1,78 @@ +return { + "romgrk/barbar.nvim", + init = function() + vim.g.barbar_auto_setup = false + + 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) + + -- Close buffer + map("n", "", "BufferClose", opts) + + -- Magic buffer-picking mode + map("n", "", "BufferPick", opts) + map("n", "", "BufferPickDelete", opts) + + -- Sort automatically by... + map( + "n", + "bb", + "BufferOrderByBufferNumber", + { noremap = true, silent = true, desc = "Sort [B]uffers by [B]uffer Number" } + ) + map( + "n", + "bn", + "BufferOrderByName", + { noremap = true, silent = true, desc = "Sort [B]uffers By [N]ame" } + ) + map( + "n", + "bd", + "BufferOrderByDirectory", + { noremap = true, silent = true, desc = "Sort [B]uffers by [D]irectory" } + ) + map( + "n", + "bl", + "BufferOrderByLanguage", + { noremap = true, silent = true, desc = "Sort [B]uffers by [L]anguage" } + ) + map( + "n", + "bw", + "BufferOrderByWindowNumber", + { noremap = true, silent = true, desc = "Sort [B]uffers by [W]indow Number" } + ) + end, + opts = { + icons = { + filetype = { + enabled = false, + }, + }, + }, +} diff --git a/lua/nyanko/lazy/which-key.lua b/lua/nyanko/lazy/which-key.lua index e9e0ca4..ec72b9c 100644 --- a/lua/nyanko/lazy/which-key.lua +++ b/lua/nyanko/lazy/which-key.lua @@ -9,6 +9,7 @@ return { spec = { { "s", group = "[S]earch" }, { "o", group = "[O]pen" }, + { "b", group = "[B]uffer" }, }, }, }