Shortcut To Auto-Insert ‘main’ Method in IntelliJ

Auto-Insert 'Main' Method using 'Live Template' in IntelliJ

IntelliJ Live Templates

Live templates let you insert frequently-used or custom code constructs into your source code file quickly and efficiently

IntelliJ IDEA comes with a set of predefined Live Templates. You can use them as-is, or modify them to suit your needs. If you want to create a new live template, you can do it from scratch, on the basis of the copy of an existing template, or from a fragment of source code. Live templates are stored in the following location:

  • Windows: \.IntelliJ IDEA\config\templates.
  • Linux: ~IntelliJ IDEA/config/templates.
  • OS X: ~/Library/Preferences/IntelliJ IDEA/templates.

Shortcut For ‘main’ Method

OPTION 1: In IntelliJ IDEA, type ‘psvm’ and press TAB to automatically generate a ‘main’ method

blank

OPTION 2: You can also generate ‘main’ method by simply typing ‘main’ and then press TAB

blank

View All Available Shortcuts

To view all default ‘Live Templates’ type Ctrl + J

blank

You can also view, edit or create shortcuts from the settings. Navigate to File > Settings > Live Templates

blank
Tushar Sharma
Tushar Sharmahttps://www.automationdojos.com
Hi! This is Tushar, the author of 'Automation Dojos'. A passionate IT professional with a big appetite for learning, I enjoy technical content creation and curation. Hope you are having a good time! Don't forget to subscribe and stay in touch. Wishing you happy learning!

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Recent Posts

RELATED POSTS

How To Add SSH Private Keys to Eclipse

One of the common use cases for accessing Git repositories on Github is authentication via SSH keys. This offers a secure way of working...

How To Always Open Files in New Tab in VSCode

The VSCode has rocketed its way to one of the top development IDEs due to its fresh look, usability, tons of feature sets, and...

How To Change Font for Eclipse Package Explorer

This article shows how to change the Package Explorer text size and style. The font used for tree and table views can now be customized...

Â

RECENT 'HOW-TO'

How To Install Oh-My-Posh On Windows PowerShell

Oh-My-Posh is a powerful custom prompt engine for any shell that has the ability to adjust the prompt string with a function or variable. It does not...

SIMILAR ON CODEX

FEATURED PROJECTS

SEPA Bulk File Generator and Validator

ADjo LABS PROJECT: SEPA Bulk File Generator and Validator. Supported File Types PAIN008, PAIN001, PACS003 and PACS008. Tested for supporting PAIN.008.001.001 and PAIN.008.001.002 (version 1&2). The XML...

MORE IN THIS CATEGORY

How To Change Font for Eclipse Editor Pane

This article shows how to change the text size and style for the Eclipse editor pane. The font used for Eclipse editor pane can be...

How To Change Font for Eclipse Package Explorer

This article shows how to change the Package Explorer text size and style. The font used for tree and table views can now be customized...

How To Always Open Files in New Tab in VSCode

The VSCode has rocketed its way to one of the top development IDEs due to its fresh look, usability, tons of feature sets, and...

CHECKOUT TUTORIALS

Java Tutorial #5 – Loop Statements

Iteration statements are used to repeat a particular block of code until a certain condition is true. In this article, we will be taking...
- Advertisement -spot_img