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

Wrap in abbreviation #44

Open
bennypowers opened this issue Jun 7, 2022 · 3 comments
Open

Wrap in abbreviation #44

bennypowers opened this issue Jun 7, 2022 · 3 comments

Comments

@bennypowers
Copy link

Given

<dl>
  <dt>Term</dt>
  <super-duper>Definition</super-duper>
<!--   ☝️ cursor here -->
</dl>

I'd like to perform a text action, e.g. gwat ("Go wrap a tag") which would prompt for an emmet abbreviation then wrap the text object (the tag) in an abbreviation.
So in that example, if I performed: gwat dd.super <cr>, then I would get the following:

<dl>
  <dt>Term</dt>
  <dd class="super">
    <super-duper>Definition</super-duper>
  </dd>
</dl>

If then, I visually selected the dt and dd tags, and performed gw div <cr>, I'd get:

<dl>
  <div>
    <dt>Term</dt>
    <dd class="super">
      <super-duper>Definition</super-duper>
    </dd>
  </div>
</dl>
@olrtg
Copy link
Collaborator

olrtg commented Apr 12, 2023

Hey @bennypowers I normally use vim-surround to wrap with an HTML tag (but that doesn't fix completly your problem i guess). Will do some investigation later this week.

@brandoncc
Copy link

I was looking for this feature today as well.

@olrtg
Copy link
Collaborator

olrtg commented Sep 17, 2023

@brandoncc @bennypowers Today I published a new plugin that lets you do that but you'll have to move to my emmet language server... https://github.com/olrtg/nvim-emmet this is the repo... hope that helps!

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

No branches or pull requests

3 participants