Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

more flexible goto_file #8824

Closed
ModProg opened this issue Nov 15, 2023 · 4 comments
Closed

more flexible goto_file #8824

ModProg opened this issue Nov 15, 2023 · 4 comments
Labels
A-command Area: Commands C-enhancement Category: Improvements

Comments

@ModProg
Copy link

ModProg commented Nov 15, 2023

After opening #8822 I noticed that there are more things I miss from vim in regard to gf.

  1. Allow non . punctuation after a path, e.g., path, or "path"; should open path and not path, and path"; respectively, if you want the latter behavior it is easy enough to just do a f,gf. (maybe we could have a config option for what characters are path, like isfname in VIM)
  2. Support paths that omit the file extension. Simple behavior could be “if file not exist, try appending current extension”, but a more flexible tool could be a file type based suffixesadd (VIM) like list of extensions to try.
  3. VIM also as a includeexpr which allows transforming a path by replacing characters, i.e., . with / in java imports. (This is applied after the normal behavior failed.) This might be best implemented when the scripting support lands, though we could also just have a regex, replacements tuple that would probably already cover most things.

Not every file has an LSP, and this just allows navigating these almost as if one had one.

@ModProg ModProg added the C-enhancement Category: Improvements label Nov 15, 2023
@ModProg
Copy link
Author

ModProg commented Nov 15, 2023

I feel like at least 1. is very actionable, and I'd look into implementing this and #8822.

If you agree with the other additions, I'd look into those as well, though I'd need some input on how the config options should look.

@daedroza
Copy link
Contributor

I am unsure about the direction of VIM about such this feature but can we instead have file picker show up with the relevant text in search box?

Until it is implemented is there a way to map a new keyboard shortcut to search for file using file picker with selected text under cursor?

@matoous
Copy link
Contributor

matoous commented Nov 16, 2023

Personally, I feel like points 2. and 3. would be better left for plugin (once that's possible). Point 1. seems like a reasonable requirement that would ideally be fixed.

@kirawi kirawi added A-helix-term Area: Helix term improvements A-command Area: Commands and removed A-helix-term Area: Helix term improvements labels Dec 8, 2023
This was referenced Dec 9, 2023
@TornaxO7
Copy link
Contributor

TornaxO7 commented Dec 13, 2023

for anyone who subscribed to this: Could you try out #9065 pls? gf should now basically behave similar to gf in neovim.

@helix-editor helix-editor locked and limited conversation to collaborators Apr 7, 2024
@pascalkuthe pascalkuthe converted this issue into discussion #10213 Apr 7, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
A-command Area: Commands C-enhancement Category: Improvements
Projects
None yet
Development

No branches or pull requests

5 participants