From 5ecb74ad85e424ed0d75a32b0e3a3e62c58c13ab Mon Sep 17 00:00:00 2001 From: jdhao Date: Sun, 25 Sep 2022 23:39:33 +0800 Subject: [PATCH] more mapping and doc update for gitlinker --- README.md | 2 ++ lua/config/git-linker.lua | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/README.md b/README.md index 5114921..dbb4dd7 100644 --- a/README.md +++ b/README.md @@ -167,6 +167,8 @@ Some of the shortcuts I use frequently are listed here. In the following shortcu | `gc` | Normal | Linux/macOS/Win | Run git commit | | `gpl` | Normal | Linux/macOS/Win | Run git pull | | `gpu` | Normal | Linux/macOS/Win | Run git push | +| `gl` | Normal/Visual | Linux/macOS/Win | Get perm link for current/visually-select lines +| `gb` | Normal | macOS | Browse current git repo in browser | `` | Normal | Linux/macOS/Win | Compile&run current source file (for C++, LaTeX, Lua, Python) | | `` | Normal | Linux/macOS/Win | Toggle spell checking | | `` | Normal | Linux/macOS/Win | Toggle paste mode | diff --git a/lua/config/git-linker.lua b/lua/config/git-linker.lua index e2f7607..e19f0a8 100644 --- a/lua/config/git-linker.lua +++ b/lua/config/git-linker.lua @@ -13,3 +13,13 @@ keymap.set({ "n", "v" }, "gl", "", { gitlinker.get_buf_range_url(mode) end, }) + +keymap.set("n", "gb", "", { + silent = true, + desc = "browse repo in browser", + callback = function() + gitlinker.get_repo_url({ + action_callback = gitlinker.actions.open_in_browser + }) + end +})