Wrapping selected text with quotes or with a tag
已回答
Hi, is there a way, similar to TextMate, where if I select some text I can then wrap it in quotes or some other tag on either side of the selected string?
Thanks
请先登录再写评论。
Try Code|Surround With... action
I did... nothing happens, what do I do after that? Or what is the procedure for using it properly?
submited a feature request today... please vote:
http://youtrack.jetbrains.net/issue/WI-1829?query=by:+me
"nothing happens"? you don't get this popup?
Not in .css files to be more precise... I did test it in php files and i saw the popup.
Okay, we'll discuss the matter internally and will post updates directly to the issue http://youtrack.jetbrains.net/issue/WI-1829
For google's search sake.
The option is in:
Preferences> Editor > General > Smart Keys: Surround selection on typing quote or brace.
For google's search sake. <- how do you think we got here?
@Jasson works with quotes and brackets, but cannot wrap with tags.
@Erika
Screenshot from Alexey Gopachenko's post shows what can be used for tags. It even has Emmet there (e.g. so you can surround multiple lines into <li> tag each).
Quote (double or single), braces -- they are all single symbols. But tag requires at least 3 symbols to type so such "surround" that Jasson have mentioned cannot be applied here.
Hi,
Is it possible to wrap with a dynamic live template? For example assume I have three lines of texts as:
text1
text2
text3
I want to wrap them with something like System.out.println(" ");.
System.out.println("text1");
System.out.println("text2");
System.out.println("text3");
But this can change next time as list.add("");
list.add("text1");
list.add("text2");
list.add("text3");
So I want to have a popup to ask me what I want to to wrap it with and I'll be able to enter System.out.println("<text to wrap>");
I can do this by vertical typing but would be quicker if I had a template for that.
Thanks!
No, that's unfortunately not supported
You may use Multiple Carets for this. Not the same, but does the job in most cases.
Thanks @Andriy that looks like a useful one!