vdshb
vdshb

Reputation: 1999

How to make default kind of new kotlin file to class?

There is kotlin file by default, but I want to make a class as default kind. Just like in Java. I hate to swith it to class every time I want to make new class file.

enter image description here

Upvotes: 13

Views: 2875

Answers (2)

hongbin dou
hongbin dou

Reputation: 11

You can update File templates

update Kotlin File to kotlin Classcontents,Kotlin File tab we don't use it most of the time.

Than. new Kotlin File tab = new Kotlin Class tab.

It's stupid, but it works for me.This saves time in choosing Class by arrow.

Upvotes: 1

Igor
Igor

Reputation: 2089

I don't think this is possible. You can, however, create own file template (preferences -> editor -> file and code templates)

Now just select the package in Project view and use New... action (not Kotlin File/Class that you used before). Popup will appear where you can type characters to select desired template

enter image description here

Upvotes: 2

Related Questions