refactor(nvim): use smaller utils for buffer management

This commit is contained in:
Price Hiller 2022-10-25 19:09:54 -05:00
parent 79c3789184
commit bac022fde9
2 changed files with 11 additions and 17 deletions

View File

@ -131,9 +131,11 @@ vim.keymap.set("n", "<leader>/", ":CommentToggle<CR>", { silent = true, desc = "
vim.keymap.set("v", "<leader>/", ":'<,'>CommentToggle<CR>", { silent = true, desc = "Toggle Selection Comment" })
-- Buffer mappings
vim.keymap.set("n", "<A-a>", ":BufferPrevious<CR>", { silent = true, desc = "Go to Previous Buffer" })
vim.keymap.set("n", "<A-s>", ":BufferNext<CR>", { silent = true, desc = "Go to Next Buffer" })
vim.keymap.set("n", "<A-x>", ":BufferClose<CR>", { silent = true, desc = "Close Buffer" })
vim.keymap.set("n", "<A-a>", ":bprevious<CR>", { silent = true, desc = "Go to Previous Buffer" })
vim.keymap.set("n", "<A-s>", ":bnext<CR>", { silent = true, desc = "Go to Next Buffer" })
vim.keymap.set("n", "<A-x>", function()
require("bufdelete").bufdelete(0)
end, { silent = true, desc = "Close Buffer" })
-- Vim Notify Mappings
vim.keymap.set("n", "<leader>nv", ":Telescope notify<CR>", { silent = true, desc = "Notifications: Search" })
@ -167,7 +169,7 @@ wk.register({
name = "Git",
},
}, { prefix = "<leader>" })
vim.keymap.set("n", "<leader>gg", require('neogit').open, { silent = true, desc = "Neogit: Open" })
vim.keymap.set("n", "<leader>gg", require("neogit").open, { silent = true, desc = "Neogit: Open" })
-- Gitsigns Mappings
vim.keymap.set("n", "]g", "<cmd>Gitsigns next_hunk<CR><CR>", { silent = true, desc = "Gitsigns: Next Hunk" })

View File

@ -79,19 +79,6 @@ return packer.startup({
event = "BufEnter",
})
-- Tab Line at top of editor
use({
"romgrk/barbar.nvim",
requires = { "kyazdani42/nvim-web-devicons" },
config = function()
require("bufferline").setup({
animation = true,
auto_hide = true,
})
end,
})
-- Statusline.
use({
"nvim-lualine/lualine.nvim",
@ -788,6 +775,11 @@ return packer.startup({
end,
})
-- Better buffer deletion
use({
'famiu/bufdelete.nvim'
})
-- Leave at end!!!
-- Install and deploy packer plugins
-- automatically