From 5078c097f80ff796ef5b37a492a7ad5fa27202cf Mon Sep 17 00:00:00 2001 From: Marcelo Jacobus Date: Mon, 4 Nov 2024 16:23:03 -0300 Subject: [PATCH] Add mapping for OpenGithubFile --- lua/plugins/open-browser-github.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lua/plugins/open-browser-github.lua b/lua/plugins/open-browser-github.lua index 9bf68b0..d9911e2 100644 --- a/lua/plugins/open-browser-github.lua +++ b/lua/plugins/open-browser-github.lua @@ -1,4 +1,15 @@ return { "tyru/open-browser-github.vim", dependencies = { { "tyru/open-browser.vim" } }, + config = function() + local map = LazyVim.safe_keymap_set + + map("n", "of", function() + vim.cmd("OpenGithubFile") + end, { desc = "Open Github file" }) + + map("v", "of", function() + vim.api.nvim_command("'<,'>OpenGithubFile") + end, { desc = "Open Github file (visual)" }) + end, }