How to "surround" text with quotes

I'm hoping there's either a plug-in or a way to do this in IDEA 4.0.

If I have text:



And want to copy and paste additional text between the lines 'where' and 'order'. e.g.


Is there an intention or "smart" pasting that will enclose my strings in quotes and add the '+' sign at the end of each line? Resulting in



Thanks,
Jim

2 comments
Comment actions Permalink

try a live template with "$SELECTION$" +

Jim Clark wrote:

I'm hoping there's either a plug-in or a way to do this in IDEA 4.0.

If I have text:

"where ........" + > "order by......";]]>

And want to copy and paste additional text between the lines 'where' and 'order'. e.g.

"where ........" + > and field1 = 1 > and field2 = 2 > and field3 = 3 > "order by......";]]>
Is there an intention or "smart" pasting that will enclose my strings in quotes and add the '+' sign at the end of each line? Resulting in

"where ........" + > "and field1 = 1 " + > "and field2 = 2 " + > "and field3 = 3 " + > "order by......";]]>

Thanks,
Jim

0
Comment actions Permalink

Without any additional effort (setting up a live template or creating a
plugin), IDEA can do this with just one more keystroke.

If you hit Enter while in the string, IDEA will extend the string to the
next line. For example, with the cursor at the pipe symbol, hit Enter and
this:



Becomes this:


Now simply paste in your text to get your desired results.

-sms

PS: With my config, it included '\n' chars at the end of each line.



"Brad" <brad@somewhere.com> wrote in message
news:c92tsb$ntd$1@is.intellij.net...

try a live template with "$SELECTION$" +

>

Jim Clark wrote:

>

I'm hoping there's either a plug-in or a way to do this in IDEA 4.0.

>

If I have text:

>

> "where ........" + > > "order by......";]]>

>

And want to copy and paste additional text between the lines 'where' and

'order'. e.g.

>

> "where ........" + > > and field1 = 1 > > and field2 = 2 > > and field3 = 3 > > "order by......";]]>
Is there an intention or "smart" pasting that will enclose my strings in

quotes and add the '+' sign at the end of each line? Resulting in

>

> "where ........" + > > "and field1 = 1 " + > > "and field2 = 2 " + > > "and field3 = 3 " + > > "order by......";]]>

>

Thanks,
Jim



0

Please sign in to leave a comment.