Tom
Tom

Reputation: 289

How to print out highlighted text in Eclipse?

I was wondering if there is a way to print out highlighted text in eclipse by using shortcuts.

So say we had

 int number = 2;
 number //highlight number + some key combination to turn -> System.out.println(number);

Thanks in advance!

Upvotes: 1

Views: 98

Answers (1)

howlger
howlger

Reputation: 34137

Select number, hit Ctrl+Space, type syso and hit Enter.

The trick is to trigger the content assist (Ctrl+Space) when something is selected and then type the beginning of the template (in this case syso) and not the other way around (not syso and then Ctrl+Space).

See this @EclipseJavaIDE tip:

enter image description here

Upvotes: 1

Related Questions