Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quickly open partial filenames in an editor #2268

Closed
sundarv85 opened this issue Jan 9, 2020 · 7 comments
Closed

Quickly open partial filenames in an editor #2268

sundarv85 opened this issue Jan 9, 2020 · 7 comments

Comments

@sundarv85
Copy link

I see there is a kitten Hints which helps in selecting the filenames that are in terminal.

Would it also be possible to quickly open those files in an editor.. something like what iterm3 supports Quickly open files

@sundarv85
Copy link
Author

Thanks for such a quick fix! One more request would be, instead of restricting the opening to only vim, could vim be the default and an option to configure the editor itself. For e.g. I use Sublime Text 3, instead of vim and I would like to open it using that.

@kovidgoyal
Copy link
Owner

There already is, read the docs accompanying the code.

@sundarv85
Copy link
Author

My compilation errors also contains columns. For e.g.

./test.go:247:52: undefined: setPath

The {path} comes out as 247 and {line} as 52. Probably column field needs to be handled too.

@sundarv85
Copy link
Author

Just to add, I see go shows the column number in case of compilation error. In case of run time crash or so, it shows only the file path and line number (the column is not available).

@kovidgoyal
Copy link
Owner

Then write your own matching code that does whatever you need, the hints
kitten is completely customizable: https://sw.kovidgoyal.net/kitty/kittens/hints.html#completely-customizing-the-matching-and-actions-of-the-kitten

@sundarv85
Copy link
Author

Hi @kovidgoyal I found that if the regex in kitty commit is changed from

((?:\S*/\S+)|(?:\S+[.][a-zA-Z0-9]{2,7})):(\d+) regexr link showing the matches

to

(?:\S+[.][a-zA-Z0-9]{2,7}):(\d+) regexr link showing the matches

Then the jumping to the correct line is working.

The first one is using the last : as the line number. Instead the second option is using the entry after the first : as the line number. You can see it in the regexr links.

Do you think that is acceptable to change?

@kovidgoyal
Copy link
Owner

That change means only files with extensions will be matched, if you want to match the first number after a colon, rather than the last, the correct change is to put a ? after the first +

kovidgoyal added a commit that referenced this issue Mar 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants