Open custom hyperlinks in a terminal text editor at a given line/column #3261
eugenesvk
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
WezTerm has this great feature of Explicit Hyperlinks where various shell apps can mark their output as links with custom handler scheme so that, for example, you can use delta as a pager for ripgrep with a custom link scheme to click on the file name with a match to open that file at an exact line/column position (columns support is planned in delta).
For a GUI editor, you'd use your OS link registration facilities (see open-in-editor) and let the default WezTerm handler handle it, but then for terminal editors it doesn't work and you need to deal with the handlers directly in the terminal, so you can use the code below to register a custom URI handler filter that would type the proper
editor /path/to/file
command for you in a new tab (similarly to how a GUI editor would open it in a new tab)Limitations:
Add this snippet to your custom lua std library add import it to your config with the code ↑
Beta Was this translation helpful? Give feedback.
All reactions