I often keep a :terminal open on the right of a vertical split, and on the left keep a window open for files:
------------------------------
| | |
| file buffers | :terminal |
| | |
------------------------------
When navigating through the terminal window in normal mode, I'd like to be able to type gf when the cursor is positioned over a file path and have it opened in the left window. Is anyone aware of a plugin or script that will allow this sort of thing? Even a snippet to get me started would be helpful. :)
Bonus: git diff shows file paths prefixed with a/ and b/. It would be great to somehow use gf on those as well, with the prefixes ignored:
diff --git a/dev/pricing_scenario_service/repl_core.clj b/dev/pricing_scenario_service/repl_core.clj
Thanks!
nnoremapline was messing withgfin non-terminal buffers, so I added a test for&buftype == 'terminal'in a separate function. – apostl3pol Dec 21 '22 at 23:16tnoremapcommand is executed whenever I typegdat the terminal prompt! I'm just omitting it because I really do only want it in normal mode. – apostl3pol Dec 23 '22 at 20:34gfthe only way I see is to make the key séquence more rare or to make it dependent of the context. – Vivian De Smedt Dec 23 '22 at 22:01