-
-
Notifications
You must be signed in to change notification settings - Fork 198
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: z fold bindings for lists (incl. files explorer) #1250
feat: z fold bindings for lists (incl. files explorer) #1250
Conversation
Unrelated |
Don't worry about the tests, they are flaky. |
@theol0403 How to re-trigger them? |
I can merge on a failing test. Just ignore the results. |
@justinmk I agree. Let's not waste more time here. Anybody is free to adjust maps, I just added |
@theol0403 I think it would be great to exclude "flaky" tests if they randomly fail so many times, what do you think? :) |
I am trying to fix the tests but it is proving to be very frustrating - especially since some of the failures come from genuine timing bugs in the extension. For now, it is what it is. It's not the same flaky tests every time. |
Just so we don't only have this one "z" binding that sticks out - is there any other z binding we could use that would make sense here? Even something like zz, zt for scrolling and any other fold+- bindings. I ask just because it feels awkward to introduce the z leader key to the possible tree bindings, but for there to only be one child. |
Thanks for the PR btw! When I made the current bindings I picked something that seemed logical, but drawing inspiration from neotree or nvim-tree is in my opinion ideal. You are right however that we should not waste too much time, but complete and sane defaults will always provide a better experience. |
So, you actually support my initial commit of mapping But ultimately, I don't mind really.
I agree, having only one z-binding is odd, but the result comes from the circumstances. Never used folding in Neovim, so lets elaborate together. Vim is very feature rich when it comes to fold operations, VSCode doesn't offer enough There are also no other folding operations for the files explorer. VSCode's fold actions live under
I realize this is a loose point, because All I wanted was to provide an alternative for copy and offer a collapse all (which is very useful to get clean on the files explorer) to play nice with Maybe we just drop it and let the user come up with their own, you decide. |
I agree that is probably too minor of a topic to keep debating about.
I'm pretty indifferent, but I agree with @justinmk on those specific points. Both c and W seem pretty random. All I was trying to say was "it is good that someone is looking at the different setups and validating the current design". In the same vein, any existing bindings that don't make sense could be deleted. I think something like c and W is something the user should add themselves 👍
I think we could add za/zc/zo, using list.toggle/collapse/expand. I think all we really need is for this pr to add za/zc/zo/zM, and potentially clean up any existing bindings that don't fit in with either vanilla nvim OR nvim-tree. Thank you for your efforts on this btw, sorry for going back and forth so much on something trivial. |
I will look into it later, kk. |
@theol0403 |
@martin-braun I suppose bind zm and zM to the same thing. Same with zO/zC/zA. All lowercase fallbacks. And yeah, seems like zR is not possible. |
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 have a one-line note about Explorer mappings in the readme.md. It's not super obvious.
I can merge when ready. |
@theol0403 Please review once more. If it's cool: Let's go. :) |
| <kbd>z</kbd> <kbd>o</kbd> / <kbd>z</kbd> <kbd>O</kbd> | `list.expand` | | ||
| <kbd>z</kbd> <kbd>c</kbd> | `list.collapse` | | ||
| <kbd>z</kbd> <kbd>C</kbd> | `list.collapseAllToFocus` | | ||
| <kbd>z</kbd> <kbd>a</kbd> / <kbd>z</kbd> <kbd>A</kbd> | `list.toggleExpand` | |
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.
To help with discovery, 1-2 line mention the readme is worth it. But the high-fidelity listing of every mapping is not worth it. Users should instead check vscode shortcuts UI to see exact mappings. The readme should just give a useful hint like:
In the vscode File Explorer some familiar vim commands are configured by default:
- for navigation:
j
,k
,gg
,G
- for expanding/collapsing directories:
zo
,zc
, etc.- run the
Preferences: Open Keyboard Shortcuts
vscode command to see the complete list of keybindings.
This is a more maintainable pattern that we can follow in all sections of the readme, which will result in a less noisy, more maintainable, and still useful overview.
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.
@justinmk Would you mind doing this? I don't know which place would be the best to insert these lines. I will revert my README.md
changes appropriately later.
To clarify: I liked to mention each and every keybinding, because it was done for things like gg
and even Enter
, too. I'm not against summarizing the bindings, but it should go beyond this PR and should involve the removal of other bindings as well imho.
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.
Ok, not a blocker
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 do agree, but
- until this is cleaned up, I'd rather include the list in the readme. I'll revert myself
- unfortunately discovery in keybindings editor is difficult because there is no way to filter by extension
Done! |
Thanks for the PR! |
Revert-Revert-Inception. You're welcome. :) |
nvim-tree allows to copy files using
c
as well. Also, you can collapse all folders withW
which is also a default on nvim-tree.