Skip to content

Commit 503a798

Browse files
committed
Add : Git Links -> copy github link or open the current file in github directly through nvim
1 parent 25cba28 commit 503a798

4 files changed

Lines changed: 20 additions & 1 deletion

File tree

init.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ require("lazy").setup({
6969
require("plugins.mdx"),
7070
require("plugins.inline"),
7171
require("plugins.git"),
72+
require("plugins.gitlink"),
7273

7374
ui = {
7475
-- If you are using a Nerd Font: set icons to an empty table which will use the

lazy-lock.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
"blink-cmp-supermaven": { "branch": "main", "commit": "635ce12e9e2d2a5a483728ac764d0bc5b57af23b" },
88
"blink-emoji.nvim": { "branch": "master", "commit": "066013e4c98a9318408ee3f1ca2dbcb6fa3e4c06" },
99
"blink.cmp": { "branch": "main", "commit": "327fff91fe6af358e990be7be1ec8b78037d2138" },
10-
"blink.indent": { "branch": "main", "commit": "63275b3b0df71047514613353294f02dae510bfc" },
1110
"codecompanion.nvim": { "branch": "main", "commit": "6fe6b45b2f3b2e856801cba29d24ecc1bf2f8941" },
1211
"colorful-menu.nvim": { "branch": "master", "commit": "d5b97d247528be308b6b69d96b5950a30e470f3d" },
1312
"comment-box.nvim": { "branch": "main", "commit": "06bb771690bc9df0763d14769b779062d8f12bc5" },
@@ -20,6 +19,7 @@
2019
"fugit2.nvim": { "branch": "main", "commit": "619b3dc130f50e0ecb0cb0026133b393ec202fae" },
2120
"fzf-lua": { "branch": "main", "commit": "6bb2a266facf0d16e30371b6b433037d1828a674" },
2221
"gemini-nvim": { "branch": "master", "commit": "d2c1e33c8afccb67bc528a3ddfb0e24c923ca202" },
22+
"gitlink.nvim": { "branch": "master", "commit": "71ba861df22882049632077a7b502dbcea04b7ad" },
2323
"gitsigns.nvim": { "branch": "main", "commit": "20ad4419564d6e22b189f6738116b38871082332" },
2424
"gruvbox": { "branch": "master", "commit": "697c00291db857ca0af00ec154e5bd514a79191f" },
2525
"img-clip.nvim": { "branch": "main", "commit": "e7e29f0d07110405adecd576b602306a7edd507a" },

lua/core/keymaps.lua

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,18 @@ vim.keymap.set("n", "<leader>jf", function()
7171
local script = file_dir .. "/run_cpp.sh"
7272
vim.cmd("terminal bash " .. script)
7373
end)
74+
75+
vim.keymap.set("n", "<leader>gc", function()
76+
require("gitlink").copy()
77+
end, {
78+
desc = "copy github link",
79+
silent = true,
80+
})
81+
82+
vim.keymap.set("n", "<leader>go", function()
83+
require("gitlink").open()
84+
end, {
85+
desc = "open in github",
86+
silent = true,
87+
})
88+

lua/plugins/gitlink.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
return {
2+
"wsdjeg/gitlink.nvim",
3+
}

0 commit comments

Comments
 (0)