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

tag textobject for working with html markup #6682

Open
Ansimorph opened this issue Apr 10, 2023 · 6 comments · May be fixed by #11158
Open

tag textobject for working with html markup #6682

Ansimorph opened this issue Apr 10, 2023 · 6 comments · May be fixed by #11158
Labels
C-enhancement Category: Improvements

Comments

@Ansimorph
Copy link

When working with html, having access to a tag textobject is very useful in vim to change content nested in a html-tag.
Here's an example for deleting text in a h1 tag:

<h1>text</h1>
dit
<h1></h1>

Is something like this possible with current treesitter textobjects in helix? Could a tag be mapped to a function or would this interaction require a new textobject?

@Ansimorph Ansimorph added the C-enhancement Category: Improvements label Apr 10, 2023
@the-mikedavis the-mikedavis linked a pull request Apr 10, 2023 that will close this issue
@jqhr
Copy link

jqhr commented Jan 27, 2024

Is there any news on this issue now?

@rifazn
Copy link

rifazn commented Feb 14, 2024

I'm considering to use Helix and I thought this would be possible if Tree Sitter is installed.

Doesn't having TS installed offer this functionality?

Will having an html LSP server make it work?


Sorry I'm asking before trying as I don't want to get into configuring it and find that something like dit or cit in vim will not work here... From reading the docs in Helix, I though mitc would work.

Thanks for letting me know!

@Ansimorph
Copy link
Author

@rifazn having Tresitter or an LSP installed is not enough to make this work. Helix needs to expose the Tresitter objects via keyboard shortcuts to enable something like vim's cit. So currently this will not work with helix in the main branch.

@adriangalilea
Copy link

I've been using helix and I absolutely love it, but this one is a bit painful when working on HTML and React.

@johannesrave
Copy link

johannesrave commented Jul 4, 2024

would it be possible to simply copy the query files from the nvim repo? there is an html_tags folder and an html folder

can we simply copy them to https://github.com/helix-editor/helix/tree/master/runtime/queries/html ? how does html_tags play into it?

@hemedani
Copy link

I've been using helix and I absolutely love it, but this one is a bit painful when working on HTML and React.

@adriangalilea

Just use Alt-o for selecting inside HTML tags even in React project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: Improvements
Projects
None yet
6 participants