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 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...

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...

Â

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

Windows JDK Manager (win-jdk-Manager)

ADjo LABS PROJECT : Simple and lightweight desktop utility with Interactive cmd Interface for easy view, re-point and switching between JAVA versions on windows. Demonstrating the capability...

MORE IN THIS CATEGORY

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 View Java API Doc Hints within IntelliJ

IntelliJ Quick Documentation So how do you generally refer your Java API Doc? If you use Google or online Java API Doc or even a...

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...

CHECKOUT TUTORIALS

Getting Started with Selenium WebDriver

Table of Contents 1. Selenium and Selenium Web Driver 2. Setting-Up the Environment 3. Test Script with Selenium Web Driver 3.1) Creating a project 3.2) Creating...

Working with JMeter Listeners

- Advertisement -spot_img