Closed
Description
I am using "hints" kitten to open file links in terminal vim (in a different tmux pane) and it works really well. In fact, that's the sole reason I switched to kitty (though it's awesome in every other way too).
There are few bits though that I find "hints" is missing:
- regex is never 100% accurate: there are either false positives, or not enough match
- can't group multiple regexps under a single shortcut (I'd like to open file links and web links with the same shortcut)
- can't hint on a text that doesn't look like a file path, but nonetheless maps onto one (e.g., in rails log,
PostsController#create
maps onto a particular line inapp/controllers/posts_controller.rb
So I was thinking to have a go at extending "hints" kitten, such that it supports the following contrived config:
map kitty_mod+f kitten hints --type regex-plus \
--regex1 "FILE_WITH_LINE_NUMBER_REGEX" --transform1 ~/return_input_if_file_exists.sh --program1 ~/bin/open_in_vim.sh
--regex2 "RAILS_CONTROLLER_ACTION_REGEX" --transform2 ~/rails_controller_action_to_path.sh --program2 ~/bin/open_in_vim.sh
--regex3 "WEB_URL_REGEX"
If the command specified in --transformX
returns an empty string: no hint is shown for the --regexX
. Otherwise, the hint is shown and --transformX
output is passed into --programX
command.
Any thoughts on the above? What are the chances of this getting merged?
Metadata
Metadata
Assignees
Labels
No labels