Updated plugins and added buffer manager
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
--- @type LazyPluginSpec
|
||||||
return {
|
return {
|
||||||
"utilyre/barbecue.nvim",
|
"utilyre/barbecue.nvim",
|
||||||
name = "barbecue",
|
name = "barbecue",
|
||||||
|
|||||||
15
lua/taken/plugins/buffermanager.lua
Normal file
15
lua/taken/plugins/buffermanager.lua
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
--- @type LazyPluginSpec
|
||||||
|
return {
|
||||||
|
"j-morano/buffer_manager.nvim",
|
||||||
|
dependencies = "nvim-lua/plenary.nvim",
|
||||||
|
config = function()
|
||||||
|
local buffer_manager = require("buffer_manager")
|
||||||
|
local ui = require("buffer_manager.ui")
|
||||||
|
|
||||||
|
buffer_manager.setup()
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<leader>bb", function()
|
||||||
|
ui.toggle_quick_menu()
|
||||||
|
end, { silent = true, desc = "Buffer manager" })
|
||||||
|
end,
|
||||||
|
}
|
||||||
@@ -3,12 +3,13 @@ return {
|
|||||||
"zbirenbaum/copilot.lua",
|
"zbirenbaum/copilot.lua",
|
||||||
cmd = "Copilot",
|
cmd = "Copilot",
|
||||||
event = "InsertEnter",
|
event = "InsertEnter",
|
||||||
|
dependencies = "AndreM222/copilot-lualine",
|
||||||
config = function()
|
config = function()
|
||||||
require("copilot").setup({
|
require("copilot").setup({
|
||||||
panel = {
|
panel = {
|
||||||
keymap = {
|
keymap = {
|
||||||
open = "<M-c>"
|
open = "<M-c>",
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
suggestion = {
|
suggestion = {
|
||||||
auto_trigger = true,
|
auto_trigger = true,
|
||||||
|
|||||||
@@ -2,7 +2,10 @@
|
|||||||
return {
|
return {
|
||||||
"ThePrimeagen/harpoon",
|
"ThePrimeagen/harpoon",
|
||||||
branch = "harpoon2",
|
branch = "harpoon2",
|
||||||
dependencies = { "nvim-lua/plenary.nvim" },
|
dependencies = {
|
||||||
|
"nvim-lua/plenary.nvim",
|
||||||
|
"letieu/harpoon-lualine",
|
||||||
|
},
|
||||||
config = function()
|
config = function()
|
||||||
local harpoon = require("harpoon")
|
local harpoon = require("harpoon")
|
||||||
|
|
||||||
@@ -11,7 +14,7 @@ return {
|
|||||||
vim.keymap.set("n", "<leader>a", function()
|
vim.keymap.set("n", "<leader>a", function()
|
||||||
harpoon:list():append()
|
harpoon:list():append()
|
||||||
end, { silent = true, desc = "Append current file to harpoon" })
|
end, { silent = true, desc = "Append current file to harpoon" })
|
||||||
vim.keymap.set("n", "<leader>th", function()
|
vim.keymap.set("n", "<A-h>", function()
|
||||||
harpoon.ui:toggle_quick_menu(harpoon:list())
|
harpoon.ui:toggle_quick_menu(harpoon:list())
|
||||||
end, { silent = true, desc = "Toggle harpoon quick menu" })
|
end, { silent = true, desc = "Toggle harpoon quick menu" })
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ return {
|
|||||||
"nvim-lualine/lualine.nvim",
|
"nvim-lualine/lualine.nvim",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"nvim-tree/nvim-web-devicons",
|
"nvim-tree/nvim-web-devicons",
|
||||||
|
"AndreM222/copilot-lualine",
|
||||||
|
"letieu/harpoon-lualine",
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
local lualine = require("lualine")
|
local lualine = require("lualine")
|
||||||
@@ -49,38 +51,27 @@ return {
|
|||||||
t = colors.red,
|
t = colors.red,
|
||||||
}
|
}
|
||||||
|
|
||||||
lualine.setup({
|
local mode = {
|
||||||
options = {
|
|
||||||
component_separators = "",
|
|
||||||
section_separators = { left = "", right = "" },
|
|
||||||
},
|
|
||||||
sections = {
|
|
||||||
lualine_a = {
|
|
||||||
{
|
|
||||||
"mode",
|
"mode",
|
||||||
separator = { left = "" },
|
separator = { left = "" },
|
||||||
right_padding = 2,
|
right_padding = 2,
|
||||||
color = function()
|
color = function()
|
||||||
return { bg = mode_color[vim.fn.mode()], fg = colors.bg }
|
return { bg = mode_color[vim.fn.mode()], fg = colors.bg }
|
||||||
end,
|
end,
|
||||||
},
|
}
|
||||||
},
|
local filename = {
|
||||||
lualine_b = {
|
|
||||||
{
|
|
||||||
"filename",
|
"filename",
|
||||||
color = { fg = colors.magenta, gui = "bold" },
|
color = { fg = colors.magenta, gui = "bold" },
|
||||||
},
|
}
|
||||||
{
|
local branch = {
|
||||||
"branch",
|
"branch",
|
||||||
icon = "",
|
icon = "",
|
||||||
color = { fg = colors.violet, gui = "bold" },
|
color = { fg = colors.violet, gui = "bold" },
|
||||||
on_click = function()
|
on_click = function()
|
||||||
vim.cmd("Neogit")
|
vim.cmd("Neogit")
|
||||||
end,
|
end,
|
||||||
},
|
}
|
||||||
},
|
local diagnostics = {
|
||||||
lualine_c = {
|
|
||||||
{
|
|
||||||
"diagnostics",
|
"diagnostics",
|
||||||
sources = { "nvim_diagnostic" },
|
sources = { "nvim_diagnostic" },
|
||||||
symbols = { error = " ", warn = " ", info = " " },
|
symbols = { error = " ", warn = " ", info = " " },
|
||||||
@@ -89,10 +80,18 @@ return {
|
|||||||
color_warn = { fg = colors.yellow },
|
color_warn = { fg = colors.yellow },
|
||||||
color_info = { fg = colors.cyan },
|
color_info = { fg = colors.cyan },
|
||||||
},
|
},
|
||||||
},
|
}
|
||||||
},
|
local harpoon = {
|
||||||
lualine_x = {
|
"harpoon2",
|
||||||
{
|
indicators = { "1", "2", "3", "4" },
|
||||||
|
active_indicators = { "[1]", "[2]", "[3]", "[4]" },
|
||||||
|
separator = " ",
|
||||||
|
}
|
||||||
|
local copilot = {
|
||||||
|
"copilot",
|
||||||
|
show_colors = true,
|
||||||
|
}
|
||||||
|
local diff = {
|
||||||
"diff",
|
"diff",
|
||||||
symbols = { added = " ", modified = " ", removed = " " },
|
symbols = { added = " ", modified = " ", removed = " " },
|
||||||
diff_color = {
|
diff_color = {
|
||||||
@@ -101,58 +100,55 @@ return {
|
|||||||
removed = { fg = colors.red },
|
removed = { fg = colors.red },
|
||||||
},
|
},
|
||||||
cond = conditions.hide_in_width,
|
cond = conditions.hide_in_width,
|
||||||
},
|
}
|
||||||
{
|
local fileformat = {
|
||||||
"o:encoding",
|
|
||||||
fmt = string.upper,
|
|
||||||
cond = conditions.hide_in_width,
|
|
||||||
color = { fg = colors.green, gui = "bold" },
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fileformat",
|
"fileformat",
|
||||||
fmt = string.upper,
|
fmt = string.upper,
|
||||||
color = { fg = colors.green, gui = "bold" },
|
color = { fg = colors.green, gui = "bold" },
|
||||||
},
|
}
|
||||||
{
|
local lazy = {
|
||||||
|
|
||||||
require("lazy.status").updates,
|
require("lazy.status").updates,
|
||||||
cond = require("lazy.status").has_updates,
|
cond = require("lazy.status").has_updates,
|
||||||
color = { fg = colors.violet },
|
color = { fg = colors.violet },
|
||||||
on_click = function()
|
on_click = function()
|
||||||
local confirmation = vim.ui.select(
|
local confirmation = vim.ui.select({ "Yes", "No" }, { prompt = "Update plugins?" }, function(choice)
|
||||||
{ "Yes", "No" },
|
|
||||||
{ prompt = "Update plugins?" },
|
|
||||||
function(choice)
|
|
||||||
if choice == "Yes" then
|
if choice == "Yes" then
|
||||||
vim.cmd("Lazy sync")
|
vim.cmd("Lazy sync")
|
||||||
else
|
else
|
||||||
vim.notify("Update cancelled", "info", { title = "Lazy" })
|
vim.notify("Update cancelled", "info", { title = "Lazy" })
|
||||||
end
|
end
|
||||||
end
|
end)
|
||||||
)
|
|
||||||
end,
|
end,
|
||||||
},
|
}
|
||||||
},
|
local filetype = {
|
||||||
lualine_y = {
|
|
||||||
{
|
|
||||||
"filetype",
|
"filetype",
|
||||||
color = { fg = colors.darkblue },
|
color = { fg = colors.darkblue },
|
||||||
},
|
}
|
||||||
{
|
local progress = {
|
||||||
"progress",
|
"progress",
|
||||||
color = { fg = colors.magenta },
|
color = { fg = colors.magenta },
|
||||||
},
|
}
|
||||||
},
|
local location = {
|
||||||
lualine_z = {
|
|
||||||
{
|
|
||||||
"location",
|
"location",
|
||||||
separator = { right = "" },
|
separator = { right = "" },
|
||||||
left_padding = 2,
|
left_padding = 2,
|
||||||
color = function()
|
color = function()
|
||||||
return { bg = mode_color[vim.fn.mode()], fg = colors.bg }
|
return { bg = mode_color[vim.fn.mode()], fg = colors.bg }
|
||||||
end,
|
end,
|
||||||
|
}
|
||||||
|
|
||||||
|
lualine.setup({
|
||||||
|
options = {
|
||||||
|
component_separators = "",
|
||||||
|
section_separators = { left = "", right = "" },
|
||||||
},
|
},
|
||||||
},
|
sections = {
|
||||||
|
lualine_a = { mode },
|
||||||
|
lualine_b = { filename, branch },
|
||||||
|
lualine_c = { diagnostics, "%=", harpoon },
|
||||||
|
lualine_x = { copilot, diff, fileformat, lazy },
|
||||||
|
lualine_y = { filetype, progress },
|
||||||
|
lualine_z = { location },
|
||||||
},
|
},
|
||||||
inactive_sections = {
|
inactive_sections = {
|
||||||
lualine_a = { "filename" },
|
lualine_a = { "filename" },
|
||||||
|
|||||||
@@ -60,19 +60,5 @@ return {
|
|||||||
vim.keymap.set("n", "<leader>fd", "<cmd>Telescope file_browser<CR>", { silent = true, desc = "File browser" })
|
vim.keymap.set("n", "<leader>fd", "<cmd>Telescope file_browser<CR>", { silent = true, desc = "File browser" })
|
||||||
vim.keymap.set("n", "<leader>fr", "<cmd>Telescope reloader<CR>", { silent = true, desc = "Reload config" })
|
vim.keymap.set("n", "<leader>fr", "<cmd>Telescope reloader<CR>", { silent = true, desc = "Reload config" })
|
||||||
vim.keymap.set("n", "<leader>fc", "<cmd>Telescope commands<CR>", { silent = true, desc = "Commands" })
|
vim.keymap.set("n", "<leader>fc", "<cmd>Telescope commands<CR>", { silent = true, desc = "Commands" })
|
||||||
|
|
||||||
vim.keymap.set("n", "<leader>bb", function()
|
|
||||||
builtin.buffers({
|
|
||||||
attach_mappings = function(_, map)
|
|
||||||
map("i", "<c-d>", function(prompt_bufnr)
|
|
||||||
require("telescope.actions").delete_buffer(prompt_bufnr)
|
|
||||||
end)
|
|
||||||
map("n", "<c-d>", function(prompt_bufnr)
|
|
||||||
require("telescope.actions").delete_buffer(prompt_bufnr)
|
|
||||||
end)
|
|
||||||
return true
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
end, { silent = true, desc = "Find buffers" })
|
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user