1
votes

How do I expand code templates in Eclipse when using the emacs keybindings?
Is there a hotkey for turning selected code into a template?

1

1 Answers

1
votes

Apparently for C/C++ you have to enable templates in Window -> Preferences-> C/C++ -> Editor -> Content-assist -> Advanced.

Uncheck everything except templates and check templates in both the upper and lower boxes.

Then in the editor type a template name like:

for  

and hit Alt + / to expand it into:

for (var = 0; var < max; ++var) {

}

Use Tab to fill in the blanks.

NOTE: eclipse 3.5