add barbar
This commit is contained in:
parent
90d237a3af
commit
3e0eb965a4
3 changed files with 80 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
"LuaSnip": { "branch": "master", "commit": "c9b9a22904c97d0eb69ccb9bab76037838326817" },
|
"LuaSnip": { "branch": "master", "commit": "c9b9a22904c97d0eb69ccb9bab76037838326817" },
|
||||||
"alpha-nvim": { "branch": "main", "commit": "de72250e054e5e691b9736ee30db72c65d560771" },
|
"alpha-nvim": { "branch": "main", "commit": "de72250e054e5e691b9736ee30db72c65d560771" },
|
||||||
|
"barbar.nvim": { "branch": "master", "commit": "40c176c9af7e9aefe3af9ec9d985a3edb50d66a3" },
|
||||||
"catppuccin": { "branch": "main", "commit": "f67b886d65a029f12ffa298701fb8f1efd89295d" },
|
"catppuccin": { "branch": "main", "commit": "f67b886d65a029f12ffa298701fb8f1efd89295d" },
|
||||||
"cmp-nvim-lsp": { "branch": "main", "commit": "99290b3ec1322070bcfb9e846450a46f6efa50f0" },
|
"cmp-nvim-lsp": { "branch": "main", "commit": "99290b3ec1322070bcfb9e846450a46f6efa50f0" },
|
||||||
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
||||||
|
|
78
lua/nyanko/lazy/barbar.lua
Normal file
78
lua/nyanko/lazy/barbar.lua
Normal file
|
@ -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", "<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)
|
||||||
|
|
||||||
|
-- Close buffer
|
||||||
|
map("n", "<A-c>", "<Cmd>BufferClose<CR>", opts)
|
||||||
|
|
||||||
|
-- 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>",
|
||||||
|
{ noremap = true, silent = true, desc = "Sort [B]uffers by [B]uffer Number" }
|
||||||
|
)
|
||||||
|
map(
|
||||||
|
"n",
|
||||||
|
"<Space>bn",
|
||||||
|
"<Cmd>BufferOrderByName<CR>",
|
||||||
|
{ noremap = true, silent = true, desc = "Sort [B]uffers By [N]ame" }
|
||||||
|
)
|
||||||
|
map(
|
||||||
|
"n",
|
||||||
|
"<Space>bd",
|
||||||
|
"<Cmd>BufferOrderByDirectory<CR>",
|
||||||
|
{ noremap = true, silent = true, desc = "Sort [B]uffers by [D]irectory" }
|
||||||
|
)
|
||||||
|
map(
|
||||||
|
"n",
|
||||||
|
"<Space>bl",
|
||||||
|
"<Cmd>BufferOrderByLanguage<CR>",
|
||||||
|
{ noremap = true, silent = true, desc = "Sort [B]uffers by [L]anguage" }
|
||||||
|
)
|
||||||
|
map(
|
||||||
|
"n",
|
||||||
|
"<Space>bw",
|
||||||
|
"<Cmd>BufferOrderByWindowNumber<CR>",
|
||||||
|
{ noremap = true, silent = true, desc = "Sort [B]uffers by [W]indow Number" }
|
||||||
|
)
|
||||||
|
end,
|
||||||
|
opts = {
|
||||||
|
icons = {
|
||||||
|
filetype = {
|
||||||
|
enabled = false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
|
@ -9,6 +9,7 @@ return {
|
||||||
spec = {
|
spec = {
|
||||||
{ "<leader>s", group = "[S]earch" },
|
{ "<leader>s", group = "[S]earch" },
|
||||||
{ "<leader>o", group = "[O]pen" },
|
{ "<leader>o", group = "[O]pen" },
|
||||||
|
{ "<leader>b", group = "[B]uffer" },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue