Coder Social home page Coder Social logo

vscode-htmltagwrap's Introduction

vscode-htmltagwrap

Build Status

What is it

Wraps your selection in HTML tags. Can wrap an inline selection or a selection of multiple lines.

To use, select a chunk of code and press "Alt + W" ("Option + W" for Mac).

Wrap text in your images

Download it on the Visual Studio Marketplace

How to Use It

Select a block of text or a string of text. Press Alt + W or Option + W for Mac. Type the tag name you want, and it will populate the beginning and end tag automatically.

This extension works best in files that either use tabs or spaces for indentation. It may not work as well with mixed tabs/spaces.

Report Issues

I welcome pull requests. Please report an issue on GitHub if you have trouble.

Updates

0.0.3

  • Spaces and tabs for indentation are now both supported.
    • Special thanks to @gdziadkiewicz for his PR #4, which also introduced tests for development!

Future features being explored

  • #5 Once a user hits spacebar, then the second multi-cursor is lost so the user can write attributes like classes or styles. (Idea courtesy of Ruben Rios)
  • Should we support getSelections() allowing multiple selections to be wrapped?

vscode-htmltagwrap's People

Contributors

bgashler1 avatar chrisdias avatar gdziadkiewicz avatar msftgits avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vscode-htmltagwrap's Issues

Wrapping with Multiple pointers

Hey there, not sure if this is a bug or a small feature request.

At the moment the plugin doesn't appear to support multiple pointers in the document.

multiplepointers

The behaviour I would hope for would be each selection gets wrapped in the tag.

Tags reverse when no selection is made

If the user actives the htmltagwrap without making a selection the tags reverse to </p><p>. It would seem more appropriate that if no selection is made the tags should still output as <p></p> with the second tag stop being between the tags once the tag as been modified.

suggestion: add 'unwrap' feature :)

Don't know if this is the right place for a suggestion but maybe add an unwrap feature regardless of source of tags to unwrap (i.e. manual or w/ extension). Great extension though!!

Configurable key combination?

I wonder if there's a way to replace the ALT + W key combination in order to trigger it.

I can see the other extension, HTML Tag Wrapper, allows it by just using something like this on the user config:

{
  "key": "ctrl+shift+i",
  "command": "extension.wrapTag",
  "when": "editorTextFocus"
}

Would it be possible to include this on this extension too?
I prefer this one :)

Last letter of closing tag is being "cut" when using autocomplete + deselect

So, the issue is as per the title.

When I'm using this tool and I choose an autocomplete option (press enter), the last letter of the closing tag is cut.

So I end up with something like this:

<CountContext>
    ...
</CountContex>

This ONLY happens if
"htmltagwrap.autoDeselectClosingTag": true

Thus, there must be something wrong with the Deselection.

htmltagwrap incompatible with Git Lens extension

I am using the Git Lens extension and the html tag wrap command (opt+W) is being overridden. It would be nice to have a setting available so the tag wrap command could be changed in case of incompatibility with other extensions or personal preference.

Not stopping after whitespace

I don't think it makes sense to create ending tags with classes, etc. As soon as I type space, I really want the macro to finish. I end up doing this by accident all the time: <div class="hello">hello</div class="hello">.

Cmd-W on Mac is closing

Cmd-W on Mac is mapped to closing. You need to use something else.
Webstorm use to have Cmd-Alt-T to wrap text is tags.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.