Sublime Forum

Shortcut key trigger that inserts correct html break tag?

#1

I can’t find a shortcut to insert a BR tag with the correct version (for XHTML or HTML5, with or without trailing slash).

All there seems to be is typing <BR and them completing it, which only adds the >

It would be nice if command or control return or something similar will add the
or
, in the scope of html files.

Or am I just missing it?

0 Likes

#2

You can add this to your user keybindings: [code] {
“keys”: “ctrl+shift+enter”], “command”: “insert_snippet”, “args”: {“contents”: “
”}, “context”:

  {
    "operand": "text.html",
    "operator": "equal", 
    "match_all": true, 
    "key": "selector"
  }
]

}[/code]

0 Likes

#3

Thanks. Is there no way to have it “smart” as to whether or not to include the / ?

0 Likes

#4

Does the tags extension do this?

0 Likes

#5

Is a very good addition, can be added

0 Likes

#6

I don’t see that in there.

0 Likes

#7

Hmm… I don’t know if this is possible with just a keybinding, might require a plugin… but it wouldn’t be difficult.

0 Likes

#8

Hello. this is code don’t work in my sublime.
Please step by step understand me in sublime.
I am trying in sublime that View->Show console(cltr + `) but that is not working.

0 Likes