简体   繁体   中英

How Can I insert System.out.println() in Eclipse with ctrl + space

When i was watching a video about java, a man has inserted System.out.println() immediately to screen. How can i do it. He only Write "S" character...

i do it this way: write syso and press ctrl+space . i believe you can configure this stuff: window -> preferences -> java -> editor -> content assist

Syso and hit CTRL + SPACE it will work in eclipse ....

And if you want to change it,,,

window > Preferences > Java > Editor > Templates.

Type syso and press ENTER .


There is no need to press CTRL + Space . You can bring up content assist whenever you type a letter:

  1. Navigate to Window > Preferences > Java > Editor > Content Assist .
  2. Enter .abcdefghijklmnopqrstuvwxyz into the field entitled Auto activation triggers for Java .

Now, whenever you type, the code completion suggestions will appear.

Syso ,然后按CTRL + Space

This will have a problem if your window 7 have more than one language input selection. because CTRL + SPACE will trigger the language change instead of insert System.out.println() ;

I like using the template box Ctrl+Alt+Space , this way you can quickly

  1. Select and highlight what to print
  2. Ctrl+Alt+Space
  3. type : syso
  4. Enter

Actually I found out you don't even have to write syso , in eclipse even

yso + Ctrl+Space

is enough.

在 Eclipse Neon 中,它是sysout Ctrl+Space

syso CTRL+spacebar 的快捷方式适用于所有版本的 eclipse 如果设置的问题已更改,则不应更改设置,因此您可以通过执行以下步骤来使其正确 1) 更改快捷方式的绑定 2) 确保已选中在模板下 3)自动完成

因此,如果您是 mac 用户,请键入 sysout 并尝试使用 control+space,控制键是指 mac 键盘中 fn 键旁边​​的那个。

For me it started working after I checked Template Proposals in Eclipse -> Preferences -> Java -> Editor -> Content Assist . I switched it on in both the default and cycling sections.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM