-
-
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
File explorer and tree helper #2377
Conversation
This looks great! Could you render the tree with ASCII like this:
Could we also make the item in the explorer generic via an interface or something? I wanted to use the same component to display a variable tree in the debugger (for example the "Local" pane here: https://emacs-lsp.github.io/dap-mode/screenshots/Swift.png or her https://code.visualstudio.com/assets/docs/editor/debugging/debug-session.png) |
I have a question for my knowledge, I know nothing about rust or how works helix, but why implement this feature into helix instead a plugin like does vim or neovim? |
We currently don't have a plugin system available yet. |
This maybe could close #1163 |
Could be used also for LSP document symbols. And I also liked the tree-like view of workspace diagnostics in |
I wanted to do something like this later on like doom emacs space space so the feature might intersect with this a bit (but didn't work on it yet). More like the list view you have shown, but with a design like our current file picker picker without a separate set of keys, just search and press, maybe you can give that a try and see. EDIT: I guess I will push that ahead of time, maybe I will try to get it done by this weekend so no more procrastinating for me, then we can compare. |
I'm really excited for this feature to come out 😄 |
I have just tried it and it works very well. These are the only problems that I've had so far:
|
One issue with this design is that it does not interact with last picker which user can then use space ', and even if it does, the keys are too different to group it with other pickers. |
Personally I think having 4 different ways of showing the file tree is a bit too much (at least to be included by default), and that we should stick with one view that is the most useful (we will also end up with less code to maintain). I would recommend the overlayed tree version over the others since:
Also I feel unsure about having potentially destructive commands like renaming and deleting files included with the file tree, especially since they're bound to two character keys which are easy to type accidentally. |
I'll have a try, but maybe need a few day. |
Based on doom emacs find-file but also wanted to show an alternative to file explorer helix-editor#2377.
Based on doom emacs find-file but also wanted to show an alternative to file explorer helix-editor#2377.
Sorry that I didn't do this earlier but here is a draft #2412 |
73197db
to
92b9356
Compare
I have added arrow keys support and hides the gutter also is fixed. |
I have optimized render and extracted the tree helper code in helix-term/src/ui/tree.rs and it's alreay for review. |
Can we get a status update on this?
|
Have you read the thread? The PR needs to be rebased, PR reviewed and tested. |
I've been using helix as my daily for the past couple months and super excited for this! thank you so much for implementing this! |
this is the change that is needed to use professionally, since in large projects there are thousands of folders, excited about this change |
| `n` | Repeat last search | | ||
| `Shift-n` | Repeat last search reverse | | ||
| `gg` | Move to first item | | ||
| `ge` | Move to last item | |
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.
This line is already there
`G` | Move to last item
better merge it with the other available option
| `ge` | Move to last item | | |
| `ge`, `G` | Move to last item | |
| `gc` | Make current dir as root dir | | ||
| `mf` | Create new file under current item's parent | | ||
| `md` | Create new dir under current item's parent | | ||
| `rf` | Remove file selected | |
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.
a suggestion on usability, probably it would be good to include that the removal will prompt for confirmation
| `rf` | Remove the selected file with confirmation
| `rd` | Remove the selected dir with confirmation
I mean, probably in the future there would be an option to not require confirmation, maybe some rF
and/or rD
Looks very interesting can't wait to see this implemented. |
Is there an option to pay a bounty to see this or a similar PR accomplishing it merged? Although it's quite unfortunate that it hasn't been merged yet, we're also asking the author to just hand out their valuable time for free. Maybe we should go back to the basics and trade something of value in exchange for the value we're getting |
I've rebased this with master cossonfork#2 @cossonleo, would you update your branch? |
If the PR author is inactive, then you are free to continue in a separate PR. |
Guys, I, recently, forked helix and embedded @cossonleo tree-explorer code into the most recent helix master commit. |
then please open a pull request in helix, at least the feature could be tested again and the code reviewed |
|
this PR could be closed like #5566 i think, |
Replaced by #5768 |
ref: helix-editor/helix#200 ref: helix-editor/helix#2377 ref: helix-editor/helix#5566 ref: helix-editor/helix#5768 Co-authored-by: cossonleo <cossonleo@foxmail.com> Co-authored-by: wongjiahau <hou32hou@gmail.com>
ref: helix-editor/helix#200 ref: helix-editor/helix#2377 ref: helix-editor/helix#5566 ref: helix-editor/helix#5768 Co-authored-by: cossonleo <cossonleo@foxmail.com> Co-authored-by: JJ <git@toki.la> Co-authored-by: Quan Tong <quantonganh@gmail.com>
ref: helix-editor/helix#200 ref: helix-editor/helix#2377 ref: helix-editor/helix#5566 ref: helix-editor/helix#5768 Co-authored-by: cossonleo <cossonleo@foxmail.com> Co-authored-by: JJ <git@toki.la> Co-authored-by: Quan Tong <quantonganh@gmail.com>
Add a explorer wdiget that display file under the current dir with tree style or list style.
Add two shortcuts,
Ctrl-e
andCtrl-E
to toggle file explorer.features
[ctrl]-jk/tab/arrow keys
to switch selected itemf
key to fitler itemsb
to back to parent dirz
to fold current level items? /
keys to search itemsrd/rf
to delete files/dirs but you must typeYES
to confirm.mf/md
to create file/dirThere are four explore style:
embed + tree:
embed + list:
overlay + tree:
overlay + list: