LightEdit mode
When you need to edit just one file without creating or loading the whole project in CLion, you can use the LightEdit mode.
Keep in mind that the LightEdit mode works as a text-like editor, and it doesn't support the usual IDE editor features such as code completion, or code navigation. However, you can navigate to a specific line of code (Ctrl0G), fold or unfold parts of code, check, and change file encoding.
You can use several ways to open a file in the LightEdit mode.
note
By default, CLion opens txt and json files in full mode. If you need to open such files in the Light Edit mode, make sure to add the
-e
prefix as described below.
Depending on your OS, open the file from the command line:
WindowsmacOSLinuxclion.bat -e README.md
You can find the executable for running CLion in the installation directory under bin. To use this executable as the command-line launcher, add it to your system
PATH
as described in Command-line interface.clion -e README.md
By default, CLion does not provide a command-line launcher. For more information about creating a launcher script for CLion, refer to Command-line interface.
clion.sh -e README.md
You can find the script for running CLion in the installation directory under bin. To use this script as the command-line launcher, add it to your system
PATH
as described in Command-line interface.
note
When you open a file that doesn't belong to any project with the
clion
command, CLion displays a dialog where you can choose whether to stay in the LightEdit mode or open the file in a project.
You can interrupt a process in the command line and put terminal on hold until you're done editing a file in the LightEdit mode. For example, when you work in the command line and run a commit process to Git, you can pause the terminal and use a text editor in the LightEdit mode to quickly write a commit message.
Depending on your OS, open the file adding the
-e
and--wait
commands before the name of your file.WindowsmacOSLinuxclion.bat -e --wait README.md
You can find the executable for running CLion in the installation directory under bin. To use this executable as the command-line launcher, add it to your system
PATH
as described in Command-line interface.clion -e --wait README.md
By default, CLion does not provide a command-line launcher. For more information about creating a launcher script for CLion, refer to Command-line interface.
clion.sh -e --wait README.md
You can find the script for running CLion in the installation directory under bin. To use this script as the command-line launcher, add it to your system
PATH
as described in Command-line interface.CLion opens the file in the LightEdit mode, and displays a notification indicating that the command line is waiting for the opened file to close.
Click one of the notification's options or close the file to release the command line.
Even though the LightEdit mode doesn't support all of the CLion editor coding assistance, you can still use basic editing features and basic menu options.
Use the main menu to open recent files, show the line numbers, whitespaces, extend the code selection, and so on.
When you select File | Open, CLion opens the Open File or Project dialog where you can quickly navigate to the opened file in the project's root directory. Click the Select opened file icon on the toolbar. Note that for macOS, the native dialog will open.
When you edit a file, the blue color indication on the tab shows that the file content was changed.
When external changes are made to the file you are working on, you can update it by selecting File | Reload from Disk from the main menu.
Use the context menu for pasting or folding your code as well as switching to column selection mode.
Use the status bar to go to the line you need, check the VCS, or toggle the Autosave mode.
Click Autosave: off on the Status bar and select the Save changes automatically in the popup that opens.
You can quit the LightEdit mode and switch from editing a single file to working on the entire project. To do so, use one of the following ways:
Thanks for your feedback!