How to add shortcut keys for java code in eclipse

前端 未结 6 583
情深已故
情深已故 2020-11-29 20:42

Say I type \"sout\", the intellisense should expand it to \"System.out.println()\". Is there a way to adding such templates?

6条回答
  •  夕颜
    夕颜 (楼主)
    2020-11-29 20:59

    I've been Eclipse-free for over a year now, but I believe Eclipse calls these "Templates". Look in your settings for them. You invoke a template by typing its abbreviation and pressing the normal code completion hotkey (ctrl+space by default) or using the Tab key. The standard eclipse shortcut for System.out.println() is "sysout", so "sysout" would do what you want.

    Here's another stackoverflow question that has some more details about it: How to use the "sysout" snippet in Eclipse with selected text?

提交回复
热议问题