LightEdit Mode

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.

Git integration

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.

The future

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!

Happy Developing!

This entry was posted in New Features. Bookmark the permalink.

44 Responses to LightEdit Mode

  1. Volodymyr says:

    How can I disable it? I want idea launcher script to open a file as it did in previous versions.

  2. GGC says:

    Having IDEA easily accessible from my terminal prompt is pretty sweet! I’m often wandering around in the terminal and want to open a file. That it chooses the already-open IDEA window is nice, too, as that’s probably where I’d want it anyway. (Granted, I was mislead by the “Already running” message. I assumed that meant it didn’t open the file. Perhaps say “Opening [foo.txt] in already-running workspace” or something?)

    Cool feature guys!

    • Eugene Morozov says:

      It’s not supposed to give you any warnings, so it must be a misconfiguration.
      What OS are you using and how exactly you created the script you are passing the file to?

  3. Joshua says:

    Have you considered compiling IntelliJ in Graal?

  4. Zy says:

    I’ve been hoping for a feature like this for a really long time! Look forward to code formatting features to be added. I think maybe a dedicated executable for launching the light version would be better. Great initial work on this, jetbrains team!

  5. MarTinazzI says:

    I’m tried this, but got a error:

    Traceback (most recent call last):
    File “/usr/local/bin/idea”, line 107, in
    start_new_instance(ide_args)
    File “/usr/local/bin/idea”, line 102, in start_new_instance
    os.execv(RUN_PATH, [bin_file] + args)
    FileNotFoundError: [Errno 2] No such file or directory

    • Eugene Morozov says:

      Try re-generating the command-line launcher script, it seems to be outdated.
      If that doesn’t help, please contact support (Help | Contact Support).

  6. t says:

    I have been wanting a JetBrains replacement for notepad++ for a while, this is the first step I have seen that that might actually happen. If I could open a whole version-controlled directory in light edit mode, so that I could text search the whole thing and bounce between files quickly, that would be all I want in it.

  7. Christian von Wendt-Jensen says:

    I’ve been wanting this for a long time. I just downloaded and tried it out on my mac (Version 2020.1 (IU-201.6668.121)) – it doesn’t work :-(

    I created a CommandLine Launcher, and tried to open different files. Idea is brought into focus, but the file is not opened.

  8. SM says:

    How can I submit a git messages/commits using this as my editor?

  9. antiloop222 says:

    Hello,

    Thanks for adding this excellent feature ! On my side, to definitively uninstall my second editor, I would also need the ability to open a directory in LightEdit mode (no interpretation of the content, no IDEA project creation, just the ability to select and update files located in this directory), just like SublimeText is doing for example.

    Keep up the good work !

  10. Fares says:

    Hey!
    How do I add the idea feature to my bash on Mac? Thanks!

  11. Jan Vondrouš says:

    Feature sounds great – considering that starting full idea take a really long time. – But I am afraid – it will have very very few users, because idea is not automatically on classpath after installation.
    I need to install IntelliJIdea, write “idea” and it must work like “code” does. Most of my colleagues will not do any additional configuration :(

  12. Lucian says:

    Too bad you can only edit existing files. Would be nice if you could start with a new file as well.

    • Ian Fieldhouse says:

      You can just touch a file before using the idea command. Slightly more convoluted but works fine.

      • Elliot Ford says:

        I’m on macOS, and have made my idea command line launcher touch its argument if it receives a single argument that isn’t already a file:

        idea() {
        # if there’s a single argument
        if test $# -eq 1
        then
        # and that argument isn’t an existing file
        if test ! -e $1
        then
        # touch it to create a new file
        touch $1
        fi
        fi

        open -na “IntelliJ IDEA CE.app” –args “$@”
        }

  13. pacm says:

    Installed this version today and found two annoying issues.
    1.) My Kotlin JUnit files are not recognised. I’m getting JUnit not found in module when I add the configuration.
    2.) My custom live template is broken. If I put the variable $END$ inside quotes, the cursor goes to the start of the line.

  14. pacm says:

    My apologies, kindly disregard my last comment. It was caused by a bad plugin. All good now.

  15. Ivan says:

    Windows. Opened file gt730.html from C:\Users\%USERNAME%\Desktop … No CSS highlighting ..

    NO! I’m NOT asked! Instead it just creates (as it has always done, taking lots of cpu and space in vain (in an endless loop maybe) ) project (.idea folder) in C:\Users\%USERNAME%\ opens it and starts indexing…

  16. Muhammet says:

    Thanks for the PyCharm editor. I have been using it for about 1 year for Python.

    I have just upgraded to 2020 version and disappointed. It opens single files in LightEdit by default.
    I would like to disable LightEdit, and open single files in the full editor, as before.
    In the 2019 release, I was able to use all the functions of the full editor AND was able to RUN the python files.

    Now, with the 2020 release, single files open in LightEdit by default.
    LightEdit is not different from a very simple text editor. What is the use?

    I would like to disable LightEdit, and use pycharm as before. How to do this?

    Thanks.

      • Muhammet says:

        I saw that, but did not understand how to do it. Is there a better explanation? Can someone explain it more clearly? Where do we do these? I cannot find them in PyCharm.

        “If you permanently want to go back to the previous behavior, you can do this by setting a registry key:

        Invoke Find Actions (or double shift/choose Actions tab)
        Search for “Registry…” action and select it.
        In the Registry dialog find light.edit.file.open.enabled key and set it to false (uncheck the box).”

        • Muhammet says:

          Found it! Here it is:

          1. Press Ctrl + Alt + Shift + /
          2. A popup menu will appear, click “Registry”
          3. You will see a long list of key-value pairs. Find “light.edit.file.open.enabled” and deselect it (it is selected by default).

          That is it. Now, when you open a file, it will open in the full PyCharm where you can also run your file, not the poor LightEdit! :)

          Thanks

  17. Jamie Echlin says:

    Would be good if it auto-saved on switching frame like regular idea.

    I expected this behaviour, and accidentally ran a shell script that didn’t have my edits because it hadn’t auto-saved.

  18. Sayed Mostafa says:

    Bad option!
    How can i disable it?

  19. Virelo says:

    I love it but I find it pretty useless. As I always have an IntelliJ running, it’s always going to open into one of the editors.
    What I would have loved is a real standalone process (regardless if IntelliJ is open or not). Something maybe executed from another command like “ideal” (l for light) or whatever.

  20. Great function!!. Thank you.
    If the LightEdit mode supports some plugins like ideavim, it would be great for many users.
    (Maybe, I can finally uninstall vim after that…)

  21. Slavko Stojadinvoci says:

    This is totali stupid, i need to fast open some file like ~/.bashrc and i need to open in same intellij windows. When you work on Mac OS you use Full Screen, when i open new file it open i different windows i must to swich windows. Please back on preview option, or give us option to disable this “amazing feature”. If I need lightedit i open VS Code. :(

  22. Andrew says:

    What’s the point of this when we have existing lightweight code editors: Vim, Emacs, Notepad++, Gedit, jEdit, Sublime Text, VS Code and so on?

  23. Andrey says:

    It definetely needs diff tool enabled

  24. Aleksei Lesnov says:

    1. The Shift-Shift menu, and the key combinations like Next tab, Previous tab are unavailable (and the access to the settings, too – those things are probably related). So, some key features are not yet available.
    2. How to open IDEA right in the Light Edit mode? Without opening an existing file?
    3. I opened a couple of files that belong to a Git repository, but haven’t seen either a branch icon or any other indication of Git support (e.g. context menu items).

    Anyway, good luck with the development of this feature!

Leave a Reply

Your email address will not be published. Required fields are marked *