summaryrefslogtreecommitdiff
path: root/.config/nvim/lua/custom/plugins/octo.lua
diff options
context:
space:
mode:
authorKyren223 <ulmliad223@gmail.com>2024-10-27 23:55:50 +0200
committerKyren223 <ulmliad223@gmail.com>2024-10-27 23:55:50 +0200
commitda5359364637eddbadcc188121c1a3e38afebba3 (patch)
treef64659e5c4daa85631246f08f50596b37fc1d2ac /.config/nvim/lua/custom/plugins/octo.lua
parentb1d9342211c3c4942757cf607943a8cbeb81f976 (diff)
Split the git.lua into 4 separate plugins
Diffstat (limited to '.config/nvim/lua/custom/plugins/octo.lua')
-rw-r--r--.config/nvim/lua/custom/plugins/octo.lua23
1 files changed, 23 insertions, 0 deletions
diff --git a/.config/nvim/lua/custom/plugins/octo.lua b/.config/nvim/lua/custom/plugins/octo.lua
new file mode 100644
index 0000000..26c1dbb
--- /dev/null
+++ b/.config/nvim/lua/custom/plugins/octo.lua
@@ -0,0 +1,23 @@
+return {
+ 'pwntester/octo.nvim',
+ cmd = 'Octo',
+ keys = {
+ { '<leader>gi', '<cmd>Octo issue search<cr>', desc = '[G]ithub [I]ssues (local)' },
+ { '<leader>pr', '<cmd>Octo pr search<cr>', desc = 'Github [PR]s (local)' },
+ { '<leader>gI', '<cmd>Octo search is:issue is:open author:@me<cr>', desc = '[G]ithub [I]ssues (global)' },
+ { '<leader>pR', '<cmd>Octo search is:pr author:@me<cr>', desc = 'Github [PR]s (global)' },
+ },
+ config = function()
+ require('octo').setup({ suppress_missing_scope = { projects_v2 = true } })
+
+ vim.treesitter.language.register('markdown', 'octo')
+ vim.api.nvim_create_autocmd('FileType', {
+ pattern = 'octo',
+ callback = function()
+ -- Autocomplete for @ (user mention) and # (issue)
+ vim.keymap.set('i', '@', '@<C-x><C-o>', { silent = true, buffer = true })
+ vim.keymap.set('i', '#', '#<C-x><C-o>', { silent = true, buffer = true })
+ end,
+ })
+ end,
+}