-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Open the File Picker in the folder of the active buffer #1352
Open the File Picker in the folder of the active buffer #1352
Conversation
@@ -648,6 +648,7 @@ impl Default for Keymaps { | |||
|
|||
"space" => { "Space" | |||
"f" => file_picker, | |||
"F" => file_picker_in_directory_of_active_buffer, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's space f F
in doom emacs I guess that's pretty similar to this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was it a suggestion or you just mentioned it? I would not sacrifice the current space f
shortcut as a prefix, it is too common.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I maybe modify the PR to contain only the command implementation without the default key bindings, so the feature can be merged and used with custom configuration while the conversation about the keybindings is going?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can easily fill up the keybindings and later we will have to do like what doom emacs did, more like current space w
which requires only an extra key, I think doing this earlier allows us to reduce breaking changes later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that space f
should be kept as is. I don't think we need space f F
, space F
is enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need space f F, space F is enough.
Yes, for now it's fine. But later when we have as much space f *
like in doom emacs we might have to reconsider this. Doom emacs space mappings is quite well done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I'm not sure whether we will add all of those, helix isn't doom emacs. Emacs often relies on longer key sequences (SPC h d h
etc), but we don't
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't actually find any documentation on SPC f
https://github.com/hlissner/doom-emacs/search?p=1&q=spc+f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to throw some new info out there I've raised a PR related to a similar picker command file_picker_at_cwd
which opens the file picker at the current working directory: #1600
If that PR ends up being merged there would be 3 different file picker related commands including the file_picker_in_directory_of_active_buffer
being discussed in this PR.
Does this new info impact your thoughts about the keymapping of commands and whether or not it would be appropriate to add a submenu to group the "picker" related commands?
@@ -270,6 +270,7 @@ impl MappableCommand { | |||
append_mode, "Insert after selection (append)", | |||
command_mode, "Enter command mode", | |||
file_picker, "Open file picker", | |||
file_picker_in_directory_of_active_buffer, "Open file picker in the directory of the active buffer", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better if the description was shorter so that the infobox wouldn't be too big.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same for the command name, maybe file_picker_in_current_buffer_dir
?
Co-authored-by: Kirawi <[email protected]>
Sorry, looks like there's an error because |
Does #2412 solve your need? It opens a different type of file picker (non-recursive) but on the directory where the file is on. |
Yes, thanks! |
This is superseded by #2412, but I haven't got to find the time to clean it up or figure out the UX for directory preview yet. |
In Programming languages with deeply nested directory hierarchies (e.g. Java or TypeScript in an Angular Project), files in the same folder/package level often needs to be easily accessed or explored.
The deep level of directory hierarchies and the long file names these projects usually use make it difficult to find those files via the default File Picker.
In IntelliJ, one can press
alt+home
to get a navigatable dialog widget to explore/access the files in the currently editing file's folder.A similar functionality could be achieved if there was a way to open the File Picker from the active file's folder.