Sublime Forum

Smart wrap in function

#1

I’m pretty sure it’s possible to make it a plugin but i’m not plugin-aware enough to swear it.

This idea:

  • you select the text to be wrapped
  • you hit whatever shortcut assigned to smart wrapping
  • you enter you the element to wrap the text in
  • you hit enter

But it should be smart so:

  • if you enter

    , it closes with

    in html files
  • if you enter /* it closes with */ in PHP files
  • if you enter “”", it closes with “”" in py files
  • it works with multiple selections so you can wrap several
  • in one row
  • etc
0 Likes

#2

I’m sure there was (at least in 1.4 - maybe Plugin driven though) a way to select text, type your tag then press tab or enter (whatever it was) and it’d wrap it.

Also, you can already wrap most things in (, ", ’ and { - at least you can in most languages I use.

0 Likes