LightEdit mode
When you need to edit one file without creating or loading the whole project in PyCharm, you can use the LightEdit mode.
Keep in mind that the LightEdit mode works as a text-like editor, and it does not support the usual IDE editor features such as code completion, or code navigation. However, you can navigate to a specific line of code (Ctrl+G), fold or unfold parts of code, check, change file encoding, and reformat your code.
Open a file in LightEdit
You can use several ways to open a file in the LightEdit mode.
Open a file from the local file system
Locate the file you need in your file system, right-click it and select Open With.
Select the version of PyCharm with which you want to open a file and click Open.
Open a file from the command line
Open the file from the command line using the short
-e
or long--edit
option before the file name:pycharm.bat -e README.mdYou can find the executable for running PyCharm 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.pycharm -e README.mdBy default, PyCharm does not provide a command-line launcher. For more information about creating a launcher script for PyCharm, refer to Command-line interface.
pycharm.sh -e README.mdYou can find the script for running PyCharm 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.
Open and edit a file with the wait switch
You can interrupt a process in the command line and put the terminal on hold until you are done editing a file in the LightEdit mode. For example, when working in the command line and running a Git commit process, you can pause the terminal and use the LightEdit mode to write the commit message.
Open the file from the command line using the the
-e
(or--edit
) and--wait
options before the name of your file.pycharm.bat -e --wait README.mdYou can find the executable for running PyCharm 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.pycharm -e --wait README.mdBy default, PyCharm does not provide a command-line launcher. For more information about creating a launcher script for PyCharm, refer to Command-line interface.
pycharm.sh -e --wait README.mdYou can find the script for running PyCharm 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.PyCharm opens the file in LightEdit mode and displays a notification indicating that the command line is waiting for the file to be closed.
Open an empty IDE window in LightEdit
You can open an empty IDE window in the LightEdit mode. From there, you can open the files you want to edit using the
option in the main menu.Depending on your OS, start the IDE by using the
-e
(or--edit
) option.pycharm.bat -eYou can find the executable for running PyCharm 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.pycharm -eBy default, PyCharm does not provide a command-line launcher. For more information about creating a launcher script for PyCharm, refer to Command-line interface.
pycharm.sh -eYou can find the script for running PyCharm 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.
Work with code in LightEdit
Even though the LightEdit mode does not support all the PyCharm editor coding assistance, you can still use basic editing features and menu options.
Use the main menu to open recent files, show the line numbers, whitespaces, reformat code, extend the code selection, and so on.
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
from the main menu.Use the status bar to go to the line you need, check the current branch if the file is under version control, or enable the Autosave mode.
Use the context menu for pasting or folding your code as well as switching to column selection mode.
Turn on autosave
Click Autosave: off on the status bar and select the Save changes automatically in the popup that opens.
Exit the LightEdit mode
You can quit the LightEdit mode and switch from editing a single file to working on the entire project.
If the file is already part of a project, that project will open. If the file is not associated with any project, you will be prompted to select a project in which to open the file. If you select a folder that is not a project, the IDE will create a new project in that folder.
On the status bar of the LightEdit mode, click Access full IDE and select Open the Current File in Project.
Press Alt+Enter and select Open file in project.
Select
from the main menu.