openingh.nvim/plugin/openingh.lua

21 lines
453 B
Lua
Raw Normal View History

2022-09-25 23:30:27 +03:00
if vim.g.openingh then
return
2022-09-25 23:30:27 +03:00
end
vim.g.openingh = true
2022-10-16 00:28:16 -04:00
local openingh = require("openingh")
2022-09-26 23:53:18 +03:00
vim.api.nvim_create_user_command("OpenInGHFile", function(opts)
if opts.range == 0 then -- Nothing was selected
openingh.open_file()
else -- Current line or block was selected
openingh.open_file(opts.line1, opts.line2)
end
end, {
range = true,
})
2022-09-25 23:30:27 +03:00
vim.api.nvim_create_user_command("OpenInGHRepo", function()
2023-04-08 20:30:49 +02:00
openingh.open_repo()
2022-09-25 23:30:27 +03:00
end, {})