refactor(nvim): use smaller utils for buffer management
This commit is contained in:
parent
79c3789184
commit
bac022fde9
@ -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" })
|
vim.keymap.set("v", "<leader>/", ":'<,'>CommentToggle<CR>", { silent = true, desc = "Toggle Selection Comment" })
|
||||||
|
|
||||||
-- Buffer mappings
|
-- Buffer mappings
|
||||||
vim.keymap.set("n", "<A-a>", ":BufferPrevious<CR>", { silent = true, desc = "Go to Previous Buffer" })
|
vim.keymap.set("n", "<A-a>", ":bprevious<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-s>", ":bnext<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-x>", function()
|
||||||
|
require("bufdelete").bufdelete(0)
|
||||||
|
end, { silent = true, desc = "Close Buffer" })
|
||||||
|
|
||||||
-- Vim Notify Mappings
|
-- Vim Notify Mappings
|
||||||
vim.keymap.set("n", "<leader>nv", ":Telescope notify<CR>", { silent = true, desc = "Notifications: Search" })
|
vim.keymap.set("n", "<leader>nv", ":Telescope notify<CR>", { silent = true, desc = "Notifications: Search" })
|
||||||
@ -167,7 +169,7 @@ wk.register({
|
|||||||
name = "Git",
|
name = "Git",
|
||||||
},
|
},
|
||||||
}, { prefix = "<leader>" })
|
}, { 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
|
-- Gitsigns Mappings
|
||||||
vim.keymap.set("n", "]g", "<cmd>Gitsigns next_hunk<CR><CR>", { silent = true, desc = "Gitsigns: Next Hunk" })
|
vim.keymap.set("n", "]g", "<cmd>Gitsigns next_hunk<CR><CR>", { silent = true, desc = "Gitsigns: Next Hunk" })
|
||||||
|
@ -79,19 +79,6 @@ return packer.startup({
|
|||||||
event = "BufEnter",
|
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.
|
-- Statusline.
|
||||||
use({
|
use({
|
||||||
"nvim-lualine/lualine.nvim",
|
"nvim-lualine/lualine.nvim",
|
||||||
@ -788,6 +775,11 @@ return packer.startup({
|
|||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
-- Better buffer deletion
|
||||||
|
use({
|
||||||
|
'famiu/bufdelete.nvim'
|
||||||
|
})
|
||||||
|
|
||||||
-- Leave at end!!!
|
-- Leave at end!!!
|
||||||
-- Install and deploy packer plugins
|
-- Install and deploy packer plugins
|
||||||
-- automatically
|
-- automatically
|
||||||
|
Loading…
Reference in New Issue
Block a user