-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
feat: Create, Delete, Copy, Move, Rename files in the new File Explorer #12902
base: master
Are you sure you want to change the base?
Conversation
What would that do? Edit: The person who wrote that deleted their comment Regardless, I would like to not add any more features to this PR aside from fixes since that would mean it is easier to review and has higher chance of being merged |
This was me. Sorry, I read through the code and thought it would be a more straight forward way of copying a file, then navigating to an entirely new folder, then pasting. But the more I read it the more I realized it probably wouldn't be necessary or easy. |
Instead of keybingings, what about a custom parser for the file explorer so that We can do cmds like mv, cp, mkdir right in the search. And being able to "select" using spacebar to make them $1 Like
what is the opinion on this. |
That sounds more complicated (I would like to keep the PR small) and less intuitive imo. The command mode seems more suitable for that |
Could it be possible to configure or use other key binds ? Alt is commonly used in i3wm/swaywm as the modifier. |
I also use Sway and I'll have to remap some of my keys as well to use this PR. The reason why I went with these is that they're mnemonics and the ctrl-* equivalents were taken. Helix also uses Alt-* keys elsewhere The actual solution would be to allow the user to remap these keys. You currently are unable to remap keys for I believe @gabydd has a branch that would fix that, and allow you to remap keys that currently can't be remapped, which should also include this PR (with some changes). But that's a large refactor |
49ccb6c
to
674afbf
Compare
The recently added File Explorer (#11285) is awesome, but it's missing a couple of features which I'd classify as nice-to-have (you can already delete / move / create etc files in Helix, but it's more ergonomic to be able to do that right from the picker instead of having to close it, type the command in cmd mode (
:
) and then going back to the picker)Features this PR adds:
Keymapping
Alt-m
Alt-n
Alt-d
Alt-c
Alt-y
Implementation
Each
Picker
now holds a map ofKeyEvent => KeyHandler
whereKeyHandler
is some function. The function has access to the currently selected item in the Picker and the Picker'seditor_data
In
Component::handle_event
implementation for thePicker
we first of all check if there is aKeyHandler
registered for a specificKeyEvent
. If yes then we execute it.