-
-
Notifications
You must be signed in to change notification settings - Fork 10
Closed
Description
- What's the output of
git remote get-url origin
?
ᐅ git remote get-url origin
https://github.com/linrongbin16/gitlinker.nvim.git
- what's the expect git host url you want to generate?
It is generated correctly, but it uses the clipboard action with either the command or API.
- how do you configure this plugin?
later(function()
add({
source = "linrongbin16/gitlinker.nvim",
depends = { "nvim-lua/plenary.nvim" },
})
local gitlinker = require("gitlinker")
local actions = require("gitlinker.actions")
local routers = require("gitlinker.routers")
local base_path = "{_A.PROTOCOL}://{_A.HOST}/"
local repo_path = "{_A.ORG}/{_A.REPO}/"
local file_path = repo_path .. "blob/{_A.REV}/{_A.FILE}"
gitlinker.setup({
router = {
file = {
["gitlab%.com"] = base_path .. file_path,
["^github%.com"] = base_path .. file_path,
},
repo = {
["gitlab%.com"] = repo_path .. file_path,
["^github%.com"] = repo_path .. file_path,
},
},
mappings = nil,
})
vim.keymap.set({ "n", "v" }, "<leader>glr", function() gitlinker.link({ router_type = "repo" }) end, { desc = "repo yank" })
vim.keymap.set({ "n", "v" }, "<leader>glR", function() gitlinker.link({ router_type = "repo", action = actions.system }) end, { desc = "repo open" })
vim.keymap.set({ "n", "v" }, "<leader>glf", function() gitlinker.link({ router_type = "file" }) end, { desc = "file yank" })
vim.keymap.set({ "n", "v" }, "<leader>glF", function() gitlinker.link({ router_type = "file", action = actions.system }) end, { desc = "file open" })
vim.keymap.set({ "n", "v" }, "<leader>gll", function() gitlinker.link({ router_type = "browse" }) end, { desc = "lines yank" })
vim.keymap.set({ "n", "v" }, "<leader>glL", function() gitlinker.link({ router_type = "browse", action = actions.system }) end, { desc = "lines open" })
end)
linrongbin16
Metadata
Metadata
Assignees
Labels
No labels