简体   繁体   中英

How to add username to netbeans code templates

I am trying to add ${user} to my code templates but its only outputting 'user' Is there a way to set this? Or any suggestions? Ideally I would like to add date and project name as well? I know I can add the ${user} to file templates but it doesn't work in code templates

This is a similar issue NetBeans Code Templates ${date}?

You just hace to use the default attribute:

Lets say you crate a new template named license with the following content:

/*
* All rights reserved.
* Created by ${user default="Keni-Williams"}.
*/

Then everytime you write license and press tab will appear

/*
* All rights reserved.
* Created by Keni-Williams
*/

With the Keny Williams selected in case you want to change it.

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