diff options
author | Raymaekers Luca <raymaekers.luca@gmail.com> | 2024-08-15 13:25:05 +0200 |
---|---|---|
committer | Raymaekers Luca <raymaekers.luca@gmail.com> | 2024-08-15 13:25:05 +0200 |
commit | b3a25c858a5cf55c954e9d78acd75a135992778d (patch) | |
tree | 5110f03eb46a2728c89e8d537ec358165cc70f66 /config/essentials/vis/vis-go.lua | |
parent | 4185a9b7ef76d686af011c8f66c14150add04426 (diff) | |
parent | b6484958979b0bb6398dc95b72f233bea20fe1b4 (diff) |
Merge branch 'main' of debuc.com:dotfiles
Diffstat (limited to 'config/essentials/vis/vis-go.lua')
-rw-r--r-- | config/essentials/vis/vis-go.lua | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/config/essentials/vis/vis-go.lua b/config/essentials/vis/vis-go.lua index bb0c7ab..c4788cc 100644 --- a/config/essentials/vis/vis-go.lua +++ b/config/essentials/vis/vis-go.lua @@ -6,6 +6,8 @@ Changes made: - no formatting because already handled by format.lua - removed the goimports option - set env variable for godef that fixes "no definition found" +- removed syntax checks +- gorename is a keybind --]] local function jump_to(path, line, col) @@ -32,9 +34,6 @@ end local function godef() local win = vis.win - if win.syntax ~= "go" then - return 0 - end local file = win.file local pos = win.selection.pos @@ -60,24 +59,13 @@ local function godef() end local function godef_back() - if vis.win.syntax ~= "go" then - return 0 - end - local pos = Gostack:pop() if pos then jump_to(pos.path, pos.line, pos.col) end end -vis:map(vis.modes.NORMAL, "gd", godef, "Jump to Go symbol/definition") -vis:map(vis.modes.NORMAL, "gD", godef_back, "Jump back to previous Go symbol/definition") - local function gorename(argv, force, win, selection) - if win.syntax ~= "go" then - return true - end - local name = argv[1] if not name then vis:info("empty new name provided") @@ -107,6 +95,8 @@ local function gorename(argv, force, win, selection) return true end +vis:map(vis.modes.NORMAL, "gd", godef, "Jump to Go symbol/definition") +vis:map(vis.modes.NORMAL, "gD", godef_back, "Jump back to previous Go symbol/definition") vis:command_register( "gorename", gorename, |