summaryrefslogtreecommitdiff
path: root/.config/nvim/lua/plugins/octo.lua
diff options
context:
space:
mode:
authorKyren223 <Kyren223@proton.me>2025-04-24 11:36:39 +0300
committerKyren223 <Kyren223@proton.me>2025-04-24 11:36:39 +0300
commit6bef8f32b19778fdfe52f0eb39719425508dcc7b (patch)
treef293141ed7e8676b76bb06c07a0fa9472b10e2ac /.config/nvim/lua/plugins/octo.lua
parentdbd9a6fdd0c44e26b200fb706aacd120a2e09c47 (diff)
Refactored nvim config to make it easier and less insanely nested
Diffstat (limited to '.config/nvim/lua/plugins/octo.lua')
-rw-r--r--.config/nvim/lua/plugins/octo.lua23
1 files changed, 23 insertions, 0 deletions
diff --git a/.config/nvim/lua/plugins/octo.lua b/.config/nvim/lua/plugins/octo.lua
new file mode 100644
index 0000000..26c1dbb
--- /dev/null
+++ b/.config/nvim/lua/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,
+}