What is LightEdit Mode?
As we talked about in an earlier blog post, LightEdit mode lets you use IntelliJ IDEA’s text editing features without creating or opening a dedicated project. In LightEdit mode, a file is opened in a separate editor window which may coexist with other (project) windows.
The mode has certain limitations: it offers simpler code completion (or sometimes none at all), no code inspections, only basic code highlighting that doesn’t require sophisticated code analysis, and so on. But if you just need to open a single file, make a few changes, and save, LightEdit is the quickest way to do it, and you don’t have to use a third-party editor either.
How does it work?
If you have an `idea` launcher script (Linux/MacOS) or `idea(64).exe` (Windows), you can open any file just by passing it as a parameter to the launcher:
The same can be accomplished if a file is associated with the launcher script or executable in a system file manager. Then, click on a file, for example in Windows Explorer or Finder, to launch IntelliJ IDEA with the file opened in LightEdit mode:
There is one exception though: if the project to which the file belongs is already open, it will be opened in the project window as usual, that is, LightEdit mode will not activate.
Note: When IntelliJ IDEA is already running, the launcher doesn’t start another instance, but only makes the already running process create an editor window.
Basic Git integration is available at the moment. If you open a file in the Git repository, you’ll see a widget showing the current Git branch. Changes to the file are also shown in the editor, similar to usual project mode. Expect more things to come in the future such as Git history, commits, and so on.
Switching to Project mode
Whenever you feel a few simple changes won’t be enough, and you need to use the capabilities of a full-blown IDE, you can switch to project mode right away. Go to File | Open File in Project…, or select Open File in Project… from the context menu, or choose the “Open File in Project” intention by using Alt+Enter:
If the file is already under a project root, the project will be opened and an editor tab with the file will appear there. If not, you will be prompted to choose a root directory where an IntelliJ IDEA project will be created. The IDE will attempt to find a good location for the project root based on the presence of a Git repository, Gradle build files, and so on. But in any case, you can change it before creating the project.
We will continue to enhance LightEdit in future IntelliJ IDEA releases so that you can do even more in a projectless mode. And of course, hearing back from you is really important. If you have an improvement idea or run into a usability problem, please let us know by creating a YouTrack ticket. Thanks!
Subscribe to Blog updates
Thanks, we've got you!
Import Postman Collections to the HTTP Client
We know that many of you use Postman collections and want to stay in the flow while working with them. This means staying inside IntelliJ IDEA and not switching to a different app. Great news! You can now effortlessly transform Postman collections into .http and use them in the HTTP Client …
What’s New in IntelliJ IDEA 2023.1 for Spring Developers
The IntelliJ IDEA 2023.1 release came packed with updates for Spring. This blog post will highlight the most noticeable changes, including full support for Lombok, a reworked Spring tool window, navigation for Spring Security rules, Spring Security 6 support, and more. Remember that these featur…
‘Quick’ Features in IntelliJ IDEA
A few IntelliJ IDEA features or actions include the term ‘quick’. Do they speed up certain processes? Let’s find out. In this blog post, I’ll cover what these features are, why you need them, and how you can use them. 1. Quick Lists If you have actions that you use regularly but don’t have shortcut…
5 Best Features for Profiling Java Code In IntelliJ IDEA
When it comes to apps functioning efficiently, there is always room for improvement. Fast, lag-free, smooth operation – what else can a Java developer dream of? However, when you aim for this level of perfection in your app, you will need a comprehensive toolset to monitor performance and identif…