Is it possible to create a new file with a certain name with hotkeys in IntelliJ IDEA?

Answered

Often create new files with a specific format, so customize the file template, new when you need to Alt + Insert and then select the corresponding template.

However, I feel that this operation is still too cumbersome and would like to implement.

  1. directly use shortcut keys to perform this operation, instead of opening the New menu first, and then select

  2. In most cases, the name of the file is also fixed, so the default behavior should be directly use the fixed name.

After searching on Google, I didn't find a solution that satisfied me.

Is this a good feature to implement in IDEA? Do I have to write extensions or scripts?

0
1 comment

In most cases, the name of the file is also fixed, so the default behavior should be directly use the fixed name

You can add variable to the filename [1], so the name would be dynamic based on the inserted text [3]: 

 

directly use shortcut keys to perform this operation, instead of opening the New menu first, and then select

You can use macros for that: https://www.jetbrains.com/help/idea/using-macros-in-the-editor.html

0

Please sign in to leave a comment.