Best wya to create a shortcut for Bold in HTML

For as long as I've been using an IDE - Ctrl B has taken the selected text and wrapped it with <strong> tags
and Ctrl I has wrapped it with <em> tags

How can I change PhpStorm to do this?

I know Ctrl B currently searches for a declaration, but I can change that easily to something else.

6 comments
Comment actions Permalink

Hmm... We have never had special shortcuts for bold, etc.
You can use 'Code/Surround with' here: select a text block, Ctrl+Alt+T, T  to surround with tag or Ctrl+Alt+T, E to surround with Emmet, then type 'b', Enter.

Related tickets: https://youtrack.jetbrains.com/issue/WEB-13984, https://youtrack.jetbrains.com/issue/IDEA-67811

0
Comment actions Permalink

Hi, not sayingthat PhpStorm has had this feature but ever other code IDE does and I'm very, very used to it.

Sure we can wrap with Emmet or something else, but there must be a simpler way to make a keystoke that does this.

Is there a way to assign a key stroke to a particular Emmet wrap, rather than having a dialog popup, fill that in, hit return etc..

0
Comment actions Permalink
is there a way to assign a key stroke to a particular Emmet wrap, rather than having a dialog popup, fill that in, hit return etc..


Not currently possible - see https://youtrack.jetbrains.com/issue/IDEA-67811

0
Comment actions Permalink

I could suggest you to record a macros where you are using "surround with emmet" or alike and then assign a shortcut to it .. but that does not work properly (at least here on my computer -- it eats some of the letters (e.g. "trong" instead of "strong") or does letters in wrong case (e.g. "STrong" or "Trong") if shortcut uses "Shift" key).

0
Comment actions Permalink

I would suggest JetBrains add this as a default. I'm with Sean, where I feel like this is a pretty common feature among editors. Even THIS editor has the feature. See? I did "cmd+b" while "THIS" was selected. I think Sublime you have to set it up, but at least it works w/o a prompt.

I'll keep digging for a better solution :(

0

Please sign in to leave a comment.