openingh.nvim/plugin/openingh.lua
2023-04-08 20:34:18 +02:00

20 lines
453 B
Lua

if vim.g.openingh then
return
end
vim.g.openingh = true
local openingh = require("openingh")
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,
})
vim.api.nvim_create_user_command("OpenInGHRepo", function()
openingh.open_repo()
end, {})