diff --git a/README.md b/README.md index 9484289..4b7b43a 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,13 @@ end) - `:OpenInGHFileLines` - Opens the current file page in GitHub. This command supports ranges. + +## Registers + +All of the commands above optionally take a register, e.g. `:OpenInGHFileLines+`. +In this case, the URL will not be opened in the browser, but put into the register given. +This is especially useful if you're running neovim on a remote machine, but want to open the URL locally. + ## Usage You can call the commands directly or define mappings them: diff --git a/plugin/openingh.lua b/plugin/openingh.lua index 4178875..ffba143 100644 --- a/plugin/openingh.lua +++ b/plugin/openingh.lua @@ -25,7 +25,7 @@ vim.api.nvim_create_user_command("OpenInGHFile", function(opts) openingh.open_url(url) else vim.fn.setreg(opts.reg, url) - print("URL yanked") + print("URL put into register " .. opts.reg) end end, { register = true, @@ -47,7 +47,7 @@ vim.api.nvim_create_user_command("OpenInGHFileLines", function(opts) openingh.open_url(url) else vim.fn.setreg(opts.reg, url) - print("URL yanked") + print("URL put into register " .. opts.reg) end end, { register = true, @@ -63,7 +63,7 @@ vim.api.nvim_create_user_command("OpenInGHRepo", function(opts) openingh.open_url(url) else vim.fn.setreg(opts.reg, url) - print("URL yanked") + print("URL put into register " .. opts.reg) end end, { register = true,