diff --git a/lua/taken/plugins/barbecue.lua b/lua/taken/plugins/barbecue.lua index aa93b40..ea59bc0 100644 --- a/lua/taken/plugins/barbecue.lua +++ b/lua/taken/plugins/barbecue.lua @@ -1,3 +1,4 @@ +--- @type LazyPluginSpec return { "utilyre/barbecue.nvim", name = "barbecue", diff --git a/lua/taken/plugins/buffermanager.lua b/lua/taken/plugins/buffermanager.lua new file mode 100644 index 0000000..03bb6fd --- /dev/null +++ b/lua/taken/plugins/buffermanager.lua @@ -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", "bb", function() + ui.toggle_quick_menu() + end, { silent = true, desc = "Buffer manager" }) + end, +} diff --git a/lua/taken/plugins/copilot.lua b/lua/taken/plugins/copilot.lua index b0deb32..4e40113 100644 --- a/lua/taken/plugins/copilot.lua +++ b/lua/taken/plugins/copilot.lua @@ -3,12 +3,13 @@ return { "zbirenbaum/copilot.lua", cmd = "Copilot", event = "InsertEnter", + dependencies = "AndreM222/copilot-lualine", config = function() require("copilot").setup({ panel = { keymap = { - open = "" - } + open = "", + }, }, suggestion = { auto_trigger = true, diff --git a/lua/taken/plugins/harpoon.lua b/lua/taken/plugins/harpoon.lua index 5bd5ea8..4b680b5 100644 --- a/lua/taken/plugins/harpoon.lua +++ b/lua/taken/plugins/harpoon.lua @@ -2,7 +2,10 @@ return { "ThePrimeagen/harpoon", branch = "harpoon2", - dependencies = { "nvim-lua/plenary.nvim" }, + dependencies = { + "nvim-lua/plenary.nvim", + "letieu/harpoon-lualine", + }, config = function() local harpoon = require("harpoon") @@ -11,7 +14,7 @@ return { vim.keymap.set("n", "a", function() harpoon:list():append() end, { silent = true, desc = "Append current file to harpoon" }) - vim.keymap.set("n", "th", function() + vim.keymap.set("n", "", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end, { silent = true, desc = "Toggle harpoon quick menu" }) diff --git a/lua/taken/plugins/lualine.lua b/lua/taken/plugins/lualine.lua index 8535c44..3af77af 100644 --- a/lua/taken/plugins/lualine.lua +++ b/lua/taken/plugins/lualine.lua @@ -3,6 +3,8 @@ return { "nvim-lualine/lualine.nvim", dependencies = { "nvim-tree/nvim-web-devicons", + "AndreM222/copilot-lualine", + "letieu/harpoon-lualine", }, config = function() local lualine = require("lualine") @@ -49,110 +51,104 @@ return { t = colors.red, } + local mode = { + "mode", + separator = { left = "" }, + right_padding = 2, + color = function() + return { bg = mode_color[vim.fn.mode()], fg = colors.bg } + end, + } + local filename = { + "filename", + color = { fg = colors.magenta, gui = "bold" }, + } + local branch = { + "branch", + icon = "", + color = { fg = colors.violet, gui = "bold" }, + on_click = function() + vim.cmd("Neogit") + end, + } + local diagnostics = { + "diagnostics", + sources = { "nvim_diagnostic" }, + symbols = { error = " ", warn = " ", info = " " }, + diagnostics_color = { + color_error = { fg = colors.red }, + color_warn = { fg = colors.yellow }, + color_info = { fg = colors.cyan }, + }, + } + local harpoon = { + "harpoon2", + indicators = { "1", "2", "3", "4" }, + active_indicators = { "[1]", "[2]", "[3]", "[4]" }, + separator = " ", + } + local copilot = { + "copilot", + show_colors = true, + } + local diff = { + "diff", + symbols = { added = " ", modified = "󰝤 ", removed = " " }, + diff_color = { + added = { fg = colors.green }, + modified = { fg = colors.orange }, + removed = { fg = colors.red }, + }, + cond = conditions.hide_in_width, + } + local fileformat = { + "fileformat", + fmt = string.upper, + color = { fg = colors.green, gui = "bold" }, + } + local lazy = { + require("lazy.status").updates, + cond = require("lazy.status").has_updates, + color = { fg = colors.violet }, + on_click = function() + local confirmation = vim.ui.select({ "Yes", "No" }, { prompt = "Update plugins?" }, function(choice) + if choice == "Yes" then + vim.cmd("Lazy sync") + else + vim.notify("Update cancelled", "info", { title = "Lazy" }) + end + end) + end, + } + local filetype = { + "filetype", + color = { fg = colors.darkblue }, + } + local progress = { + "progress", + color = { fg = colors.magenta }, + } + local location = { + "location", + separator = { right = "" }, + left_padding = 2, + color = function() + return { bg = mode_color[vim.fn.mode()], fg = colors.bg } + end, + } + lualine.setup({ options = { component_separators = "", section_separators = { left = "", right = "" }, }, sections = { - lualine_a = { - { - "mode", - separator = { left = "" }, - right_padding = 2, - color = function() - return { bg = mode_color[vim.fn.mode()], fg = colors.bg } - end, - }, - }, - lualine_b = { - { - "filename", - color = { fg = colors.magenta, gui = "bold" }, - }, - { - "branch", - icon = "", - color = { fg = colors.violet, gui = "bold" }, - on_click = function() - vim.cmd("Neogit") - end, - }, - }, - lualine_c = { - { - "diagnostics", - sources = { "nvim_diagnostic" }, - symbols = { error = " ", warn = " ", info = " " }, - diagnostics_color = { - color_error = { fg = colors.red }, - color_warn = { fg = colors.yellow }, - color_info = { fg = colors.cyan }, - }, - }, - }, - lualine_x = { - { - "diff", - symbols = { added = " ", modified = "󰝤 ", removed = " " }, - diff_color = { - added = { fg = colors.green }, - modified = { fg = colors.orange }, - removed = { fg = colors.red }, - }, - cond = conditions.hide_in_width, - }, - { - "o:encoding", - fmt = string.upper, - cond = conditions.hide_in_width, - color = { fg = colors.green, gui = "bold" }, - }, - { - "fileformat", - fmt = string.upper, - color = { fg = colors.green, gui = "bold" }, - }, - { - - require("lazy.status").updates, - cond = require("lazy.status").has_updates, - color = { fg = colors.violet }, - on_click = function() - local confirmation = vim.ui.select( - { "Yes", "No" }, - { prompt = "Update plugins?" }, - function(choice) - if choice == "Yes" then - vim.cmd("Lazy sync") - else - vim.notify("Update cancelled", "info", { title = "Lazy" }) - end - end - ) - end, - }, - }, - lualine_y = { - { - "filetype", - color = { fg = colors.darkblue }, - }, - { - "progress", - color = { fg = colors.magenta }, - }, - }, - lualine_z = { - { - "location", - separator = { right = "" }, - left_padding = 2, - color = function() - return { bg = mode_color[vim.fn.mode()], fg = colors.bg } - end, - }, - }, + 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 = { lualine_a = { "filename" }, diff --git a/lua/taken/plugins/telescope.lua b/lua/taken/plugins/telescope.lua index 2725441..45d664e 100644 --- a/lua/taken/plugins/telescope.lua +++ b/lua/taken/plugins/telescope.lua @@ -60,19 +60,5 @@ return { vim.keymap.set("n", "fd", "Telescope file_browser", { silent = true, desc = "File browser" }) vim.keymap.set("n", "fr", "Telescope reloader", { silent = true, desc = "Reload config" }) vim.keymap.set("n", "fc", "Telescope commands", { silent = true, desc = "Commands" }) - - vim.keymap.set("n", "bb", function() - builtin.buffers({ - attach_mappings = function(_, map) - map("i", "", function(prompt_bufnr) - require("telescope.actions").delete_buffer(prompt_bufnr) - end) - map("n", "", function(prompt_bufnr) - require("telescope.actions").delete_buffer(prompt_bufnr) - end) - return true - end, - }) - end, { silent = true, desc = "Find buffers" }) end, }