简体   繁体   中英

Netbeans 7.3 - how do I prefill '@author' field?

I cannot, for the life of me, figure out how to set the @author comment doc code to display my own info in Netbeans.

I want this done for all of my files (js, php, etc).

I have gone to the tools->templates and then click the 'settings' button and uncommented the 'user' variable, entering my own. ie: "user=foo bar ". without the double quotes, of course.

I would like to type "/**" + ENTER and have it insert the comment code such as:

/**
 *
 * @author foo bar <foo@bar.com>
 **/

I've searched the threads and seems that should do it?

This is for Netbeans 7.3 on OSX 10.8.3.

The user name (as set in your OS) should be set per default.
Please check if the template(s) ( tools -> Templates (-> Open in Editor) ) of your file(s) contain such a line:

/**
 *
 * @author ${user}
 */

(Taken from Java Class Template)

or

/* 
 * [...]
 * Author: %<%USER%>%
 * [...]
 */

(Taken from C++ Header Template)

However, you won't get email etc. using this env. variable.

But you can put your full author name (incl. Email) into the template.

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