diff --git a/lua/lazyvim/plugins/extras/util/octo.lua b/lua/lazyvim/plugins/extras/util/octo.lua new file mode 100644 index 00000000..d23ea883 --- /dev/null +++ b/lua/lazyvim/plugins/extras/util/octo.lua @@ -0,0 +1,51 @@ +return { + + -- depends on the git extra for highlighting and auto-completion of github issues/prs + { import = "lazyvim.plugins.extras.lang.git" }, + + -- Octo + { + "pwntester/octo.nvim", + cmd = "Octo", + init = function() + vim.treesitter.language.register("markdown", "octo") + end, + opts = { + enable_builtin = true, + default_to_projects_v2 = true, + default_merge_method = "squash", + picker = "telescope", + }, + keys = { + { "gi", "Octo issue list", desc = "List Isues (Octo)" }, + { "gI", "Octo issue search", desc = "Search Isues (Octo)" }, + { "gp", "Octo pr list", desc = "List PRs (Octo)" }, + { "gP", "Octo pr search", desc = "Search PRs (Octo)" }, + { "gr", "Octo repo list", desc = "List Repos (Octo)" }, + { "gS", "Octo search", desc = "Search (Octo)" }, + { "a", "", desc = "+assignee (Otco)", ft = "octo" }, + { "c", "", desc = "+comment/code (Otco)", ft = "octo" }, + { "l", "", desc = "+label (Otco)", ft = "octo" }, + { "i", "", desc = "+issue (Otco)", ft = "octo" }, + { "r", "", desc = "+react (Otco)", ft = "octo" }, + { "p", "", desc = "+pr (Otco)", ft = "octo" }, + { "v", "", desc = "+review (Otco)", ft = "octo" }, + { "@", "@", mode = "i", ft = "octo", silent = true }, + { "#", "#", mode = "i", ft = "octo", silent = true }, + }, + }, + + -- Octo Picker + { + "pwntester/octo.nvim", + opts = function(_, opts) + if LazyVim.has("telescope.nvim") then + opts.picker = "telescope" + elseif LazyVim.has("fzf-lua") then + opts.picker = "fzf-lua" + else + LazyVim.error("`octo.nvim` requires `telescope.nvim` or `fzf-lua`") + end + end, + }, +} diff --git a/lua/lazyvim/util/ui.lua b/lua/lazyvim/util/ui.lua index 5877fd7f..d1a68ced 100644 --- a/lua/lazyvim/util/ui.lua +++ b/lua/lazyvim/util/ui.lua @@ -34,7 +34,7 @@ function M.get_signs(buf, lnum) ) for _, extmark in pairs(extmarks) do signs[#signs + 1] = { - name = extmark[4].sign_hl_group or "", + name = extmark[4].sign_hl_group or extmark[4].sign_name or "", text = extmark[4].sign_text, texthl = extmark[4].sign_hl_group, priority = extmark[4].priority, @@ -106,6 +106,9 @@ function M.statuscolumn() ---@type Sign?,Sign?,Sign? local left, right, fold, githl for _, s in ipairs(M.get_signs(buf, vim.v.lnum)) do + if s.name and s.name:lower():find("^octo_clean") then + s.texthl = "IblScope" + end if s.name and (s.name:find("GitSign") or s.name:find("MiniDiffSign")) then right = s if use_githl then @@ -115,7 +118,7 @@ function M.statuscolumn() left = s end end - if vim.v.virtnum ~= 0 then + if vim.v.virtnum ~= 0 and vim.bo[buf].filetype ~= "octo" then left = nil end