Skip to content
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

change show_subtree command into ':tree-sitter-subtree' typable command #1524

Merged

Conversation

the-mikedavis
Copy link
Member

Following up on #1453 (comment), this is a default mapping for the new show_subtree command.

To start off I have it under space+t which is what I've been using, since it's pretty similar presentation-wise to the LSP-driven documentation hover space+k. I'm open to suggestions though.

Copy link
Contributor

@pickfire pickfire left a 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 it is good to have this as default especially when this is used for debugging purposes. User can just add this to the config when they needed it.

If anything, I think maybe we could have :show_subtree command so that user can run without changing the config. Even with the current one, it is not usable when the screen is small either way. Maybe writing to file is better.

Screenshot_20220116_211555

@hovsater
Copy link
Contributor

I agree with @pickfire here. I don't see this meriting being in the default keymap. Adding a :show_subtree command make sense though and users who find themselves using this often may bind it at their disposal. 🙂

@the-mikedavis
Copy link
Member Author

I like the sound of a typable command, I'll switch this PR to do that instead 👍

@the-mikedavis
Copy link
Member Author

Is there a way to translate between commands::Context and compositor::Context? Looks like typable commands take the latter and regular commands the former, and they look similar structure-wise

@pickfire
Copy link
Contributor

I don't think there is a way to convert. But if you find it similar, then maybe you can do From for them if possible to make it easier for future contributors, otherwise I think can just manually create it. I didn't touch work on these two parts but I don't think there is an issue.

@the-mikedavis
Copy link
Member Author

As it turns out, the current! macro for getting the view and document works the same between the two cxs. The way you add callbacks is a bit different though

Now adding the typable command I think it might be better to only have the typable command. I don't see too much utility in being able to have a keymap for it when I can just :sub<tab>. What do you think, should I remove the old show_subtree regular command?

@the-mikedavis the-mikedavis changed the title add default keymap for show_subtree command add typable command for show_subtree Jan 17, 2022
@pickfire
Copy link
Contributor

Now adding the typable command I think it might be better to only have the typable command. I don't see too much utility in being able to have a keymap for it when I can just :sub. What do you think, should I remove the old show_subtree regular command?

Yeah, I think this should be good.

@the-mikedavis the-mikedavis changed the title add typable command for show_subtree change show_subtree command into ':show-subtree' typable command Jan 18, 2022
@archseer
Copy link
Member

How about prefixing it with tree-sitter? :tree-sitter-subtree, alias :ts-subtree. Would match :tree-sitter-scopes

@the-mikedavis the-mikedavis changed the title change show_subtree command into ':show-subtree' typable command change show_subtree command into ':tree-sitter-subtree' typable command Jan 20, 2022
@archseer archseer merged commit f453f87 into helix-editor:master Jan 21, 2022
@the-mikedavis the-mikedavis deleted the md-show-subtree-keymapping branch February 1, 2022 02:38
EricCrosson added a commit to EricCrosson/dotfiles that referenced this pull request Apr 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants