I try to select a piece of text and wrap it with <strong>
tag.
After I highlight some text and hit Alt+Shift+W (same as using Edit > Tag > Wrap Selection with Tag) my text is surrounded by <p>
and </p>
. I then start to type the word strong
which replaces both p
's simultaneously. If I complete typing the word it's ok, but if I use auto completion and hit Enter after I've typed st
for example I get something like:
<strong></strong>>word</st>
Tested it with/without Emmet plugin and does the same.
You can use an emmet
alternative shortcut: Ctrl+Shift+G
It asks you for a wrap abbreviation in the bottom of the frame, so just insert strong
and click Enter. It will just wrap all the content highlighted.
Solution without emmet :
Go to Packages/User
Add a folder Snippets
Creat in it a file named : wrapstrong.sublime-snippet
which contain :
<snippet>
<!-- $SELECTION peut être appelé plusieurs fois -->
<content><![CDATA[<strong>$SELECTION</strong>]]></content>
<!-- Facultatif: Description affichée dans le menu -->
<description>Wrap in strong</description>
</snippet>
And finally bind it to a Key in Key Binding User ->
{"keys": [ "super+b" ], "command": "insert_snippet", "args": { "name": "Packages/User/Snippets/wrapstrong.sublime-snippet"} }
Relaunch Sublime Text and there you are !
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With