diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 5cd3283e..de41ec8c 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -33,6 +33,9 @@ local defaults = { misc = { dots = "󰇘", }, + ft = { + octo = "", + }, dap = { Stopped = { "󰁕 ", "DiagnosticWarn", "DapStoppedLine" }, Breakpoint = " ", diff --git a/lua/lazyvim/config/keymaps.lua b/lua/lazyvim/config/keymaps.lua index 768a41b8..b1db0b44 100644 --- a/lua/lazyvim/config/keymaps.lua +++ b/lua/lazyvim/config/keymaps.lua @@ -134,6 +134,7 @@ map("n", "ub", function() LazyVim.toggle("background", false, {"light", map("n", "gg", function() LazyVim.lazygit( { cwd = LazyVim.root.git() }) end, { desc = "Lazygit (Root Dir)" }) map("n", "gG", function() LazyVim.lazygit() end, { desc = "Lazygit (cwd)" }) map("n", "gb", LazyVim.lazygit.blame_line, { desc = "Git Blame Line" }) +map("n", "gB", LazyVim.lazygit.browse, { desc = "Git Browse" }) map("n", "gf", function() local git_path = vim.api.nvim_buf_get_name(0) diff --git a/lua/lazyvim/plugins/extras/coding/copilot-chat.lua b/lua/lazyvim/plugins/extras/coding/copilot-chat.lua index 7e636b65..c21c51d6 100644 --- a/lua/lazyvim/plugins/extras/coding/copilot-chat.lua +++ b/lua/lazyvim/plugins/extras/coding/copilot-chat.lua @@ -22,6 +22,7 @@ return { } end, keys = { + { "a", "", desc = "+ai" }, { "aa", function() @@ -66,16 +67,6 @@ return { end, }, - { - "folke/which-key.nvim", - optional = true, - opts = { - defaults = { - ["a"] = { name = "+ai" }, - }, - }, - }, - -- Telescope integration { "nvim-telescope/telescope.nvim", diff --git a/lua/lazyvim/plugins/extras/coding/yanky.lua b/lua/lazyvim/plugins/extras/coding/yanky.lua index 46dca784..27fa519a 100644 --- a/lua/lazyvim/plugins/extras/coding/yanky.lua +++ b/lua/lazyvim/plugins/extras/coding/yanky.lua @@ -9,7 +9,7 @@ return { }, keys = { -- stylua: ignore - { "p", function() require("telescope").extensions.yank_history.yank_history({ }) end, desc = "Open Yank History" }, + { "p", function() require("telescope").extensions.yank_history.yank_history({ }) end, desc = "Open Yank History" }, { "y", "(YankyYank)", mode = { "n", "x" }, desc = "Yank Text" }, { "p", "(YankyPutAfter)", mode = { "n", "x" }, desc = "Put Yanked Text After Cursor" }, { "P", "(YankyPutBefore)", mode = { "n", "x" }, desc = "Put Yanked Text Before Cursor" }, diff --git a/lua/lazyvim/plugins/extras/dap/core.lua b/lua/lazyvim/plugins/extras/dap/core.lua index 06b8862d..44256c33 100644 --- a/lua/lazyvim/plugins/extras/dap/core.lua +++ b/lua/lazyvim/plugins/extras/dap/core.lua @@ -49,17 +49,6 @@ return { opts = {}, }, - -- which key integration - { - "folke/which-key.nvim", - optional = true, - opts = { - defaults = { - ["d"] = { name = "+debug" }, - }, - }, - }, - -- mason.nvim integration { "jay-babu/mason-nvim-dap.nvim", @@ -85,6 +74,7 @@ return { -- stylua: ignore keys = { + { "d", "", desc = "+debug" }, { "dB", function() require("dap").set_breakpoint(vim.fn.input('Breakpoint condition: ')) end, desc = "Breakpoint Condition" }, { "db", function() require("dap").toggle_breakpoint() end, desc = "Toggle Breakpoint" }, { "dc", function() require("dap").continue() end, desc = "Continue" }, diff --git a/lua/lazyvim/plugins/extras/editor/leap.lua b/lua/lazyvim/plugins/extras/editor/leap.lua index 6145d641..cf6e7478 100644 --- a/lua/lazyvim/plugins/extras/editor/leap.lua +++ b/lua/lazyvim/plugins/extras/editor/leap.lua @@ -50,14 +50,8 @@ return { update_n_lines = "gzn", -- Update `n_lines` }, }, - }, - { - "folke/which-key.nvim", - optional = true, - opts = { - defaults = { - ["gz"] = { name = "+surround" }, - }, + keys = { + { "gz", "", desc = "+surround" }, }, }, diff --git a/lua/lazyvim/plugins/extras/editor/refactoring.lua b/lua/lazyvim/plugins/extras/editor/refactoring.lua index ff6351c7..586cda53 100644 --- a/lua/lazyvim/plugins/extras/editor/refactoring.lua +++ b/lua/lazyvim/plugins/extras/editor/refactoring.lua @@ -7,6 +7,7 @@ return { "nvim-treesitter/nvim-treesitter", }, keys = { + { "r", "", desc = "+refactor" }, { "rs", function() @@ -124,15 +125,4 @@ return { end end, }, - - -- which key integration - { - "folke/which-key.nvim", - optional = true, - opts = { - defaults = { - ["r"] = { name = "+refactor" }, - }, - }, - }, } diff --git a/lua/lazyvim/plugins/extras/lang/kotlin.lua b/lua/lazyvim/plugins/extras/lang/kotlin.lua index 1db56545..087f3620 100644 --- a/lua/lazyvim/plugins/extras/lang/kotlin.lua +++ b/lua/lazyvim/plugins/extras/lang/kotlin.lua @@ -16,7 +16,7 @@ return { { "williamboman/mason.nvim", opts = function(_, opts) - vim.list_extend(opts.ensure_installed or {}, { "ktlint", "kotlin-debug-adapter" }) + vim.list_extend(opts.ensure_installed or {}, { "ktlint" }) end, }, -- Add syntax highlighting @@ -35,7 +35,7 @@ return { }, }, }, - -- Add linting as optional + -- Add linting { "mfussenegger/nvim-lint", optional = true, @@ -44,7 +44,7 @@ return { linters_by_ft = { kotlin = { "ktlint" } }, }, }, - -- Add formatting as optional + -- Add formatting { "stevearc/conform.nvim", optional = true, @@ -52,7 +52,7 @@ return { formatters_by_ft = { kotlin = { "ktlint" } }, }, }, - -- Add formatting and linting as optional + -- Add formatting and linting { "nvimtools/none-ls.nvim", optional = true, @@ -72,7 +72,7 @@ return { opts = function() local dap = require("dap") if not dap.adapters.kotlin then - require("dap").adapters.kotlin = { + dap.adapters.kotlin = { type = "executable", command = "kotlin-debug-adapter", options = { auto_continue_if_many_stopped = false }, diff --git a/lua/lazyvim/plugins/extras/lang/tex.lua b/lua/lazyvim/plugins/extras/lang/tex.lua index 0b7796b5..8bddb17d 100644 --- a/lua/lazyvim/plugins/extras/lang/tex.lua +++ b/lua/lazyvim/plugins/extras/lang/tex.lua @@ -5,15 +5,6 @@ return { root = { ".latexmkrc", ".texlabroot", "texlabroot", "Tectonic.toml" }, }) end, - { - "folke/which-key.nvim", - optional = true, - opts = { - defaults = { - ["l"] = { name = "+vimtex" }, - }, - }, - }, -- Add BibTeX/LaTeX to treesitter { @@ -38,6 +29,9 @@ return { vim.g.vimtex_mappings_disable = { ["n"] = { "K" } } -- disable `K` as it conflicts with LSP hover vim.g.vimtex_quickfix_method = vim.fn.executable("pplatex") == 1 and "pplatex" or "latexlog" end, + keys = { + { "l", "", desc = "+vimtext" }, + }, }, -- Correctly setup lspconfig for LaTeX 🚀 diff --git a/lua/lazyvim/plugins/extras/test/core.lua b/lua/lazyvim/plugins/extras/test/core.lua index 973adafe..dd7c7640 100644 --- a/lua/lazyvim/plugins/extras/test/core.lua +++ b/lua/lazyvim/plugins/extras/test/core.lua @@ -1,15 +1,6 @@ return { recommended = true, desc = "Neotest support. Requires language specific adapters to be configured. (see lang extras)", - { - "folke/which-key.nvim", - optional = true, - opts = { - defaults = { - ["t"] = { name = "+test" }, - }, - }, - }, { "nvim-neotest/neotest", dependencies = { "nvim-neotest/nvim-nio" }, @@ -110,6 +101,7 @@ return { end, -- stylua: ignore keys = { + {"t", "", desc = "+test"}, { "tt", function() require("neotest").run.run(vim.fn.expand("%")) end, desc = "Run File" }, { "tT", function() require("neotest").run.run(vim.uv.cwd()) end, desc = "Run All Test Files" }, { "tr", function() require("neotest").run.run() end, desc = "Run Nearest" }, diff --git a/lua/lazyvim/plugins/ui.lua b/lua/lazyvim/plugins/ui.lua index 5ef3405e..e3c7aa87 100644 --- a/lua/lazyvim/plugins/ui.lua +++ b/lua/lazyvim/plugins/ui.lua @@ -92,6 +92,10 @@ return { text_align = "left", }, }, + ---@param opts bufferline.IconFetcherOpts + get_element_icon = function(opts) + return LazyVim.config.icons.ft[opts.filetype] + end, }, }, config = function(_, opts) @@ -133,7 +137,7 @@ return { local opts = { options = { theme = "auto", - globalstatus = true, + globalstatus = vim.o.laststatus == 3, disabled_filetypes = { statusline = { "dashboard", "alpha", "starter" } }, }, sections = { @@ -262,16 +266,6 @@ return { main = "ibl", }, - -- Displays a popup with possible key bindings of the command you started typing - { - "folke/which-key.nvim", - opts = function(_, opts) - if LazyVim.has("noice.nvim") then - opts.defaults["sn"] = { name = "+noice" } - end - end, - }, - -- Highly experimental plugin that completely replaces the UI for messages, cmdline and the popupmenu. { "folke/noice.nvim", @@ -305,6 +299,7 @@ return { }, -- stylua: ignore keys = { + { "sn", "", desc = "+noice"}, { "", function() require("noice").redirect(vim.fn.getcmdline()) end, mode = "c", desc = "Redirect Cmdline" }, { "snl", function() require("noice").cmd("last") end, desc = "Noice Last Message" }, { "snh", function() require("noice").cmd("history") end, desc = "Noice History" }, diff --git a/lua/lazyvim/util/lazygit.lua b/lua/lazyvim/util/lazygit.lua index e360ad82..1786eefd 100644 --- a/lua/lazyvim/util/lazygit.lua +++ b/lua/lazyvim/util/lazygit.lua @@ -159,4 +159,36 @@ function M.blame_line(opts) return require("lazy.util").float_cmd(cmd, opts) end +function M.browse() + local config = require("lazy.manage.git").get_config(LazyVim.root.detectors.pattern(0, { ".git" })[1]) + local remotes = {} ---@type {name:string, url:string}[] + for name, url in pairs(config) do + name = name:match("^remote%.(.-)%.url$") + if name then + url = url:gsub("git@github.com:", "https://github.com/"):gsub("%.git$", "") --[[@as string]] + table.insert(remotes, { name = name, url = url }) + end + end + + local function open(remote) + if remote then + LazyVim.info(("Opening [%s](%s)"):format(remote.name, remote.url)) + vim.ui.open(remote.url) + end + end + + if #remotes == 0 then + return LazyVim.error("No git remotes found") + elseif #remotes == 1 then + return open(remotes[1]) + end + + vim.ui.select(remotes, { + prompt = "Select remote to browse", + format_item = function(item) + return item.name .. (" "):rep(8 - #item.name) .. " 🔗 " .. item.url + end, + }, open) +end + return M