Notepad++ is a free application and unlike our regular Windows Notepad, this one is specially designed for developers because of the features it offers to ease coding. If you are working on Notepad++ for writing Python code and want to format it correctly to enhance the readability and maintainability of the code, then in this article we learn how to do that.
Here, we learn how to install the Python Indent plugin in Notepad++ to enable the auto-formatting of Python code in Notepad++ easily.
To follow this tutorial you should have Notepad++ installed on your Windows. However, If you are a Linux user and don’t have it, then see our tutorial to learn how to install Notepad++ in Ubuntu Linux.
#1 Method using the Default Auto Indent
Enable In-built Auto Indent in NotePad++
NotePad++ software offers auto-indent settings that although enabled by default, if not then here are the steps to make it.
- Open NotePad++
- From the software menu select “Settings” and then the Preferences option.
- From the left side menu select Auto-completion and check the box given for Auto-indent, if not already.
#2nd Method is using the Plugin, if the Auto-indent is not working for you.
Install Python Indent Plugin
Here are the steps that you need to follow for the installation of a plugin called Python Indent.
- On your Windows open Notepad++ and from the menu bar select the Plugins option.
- From the drop-down menu select the “Plugins Admin” option.
- In the following windows, you will see a search box their type- “Python Indent” and you will see it in the list of available plugins.
- Now, check the box given for “Python Indent” and hit the Install button present on the right side top corner.
- Follow the wizard and finish the installation process.
Enable Python Indent
- Go to “Plugins” in the menu bar
- Select “Python Indent” from the dropdown menu.
- Choose “Enable” and you are done
Select Python Language
To code in Python select it as the programming language in Notepad++. For that click on the Language menu and select the letter “P” and then Python.
Installing and utilizing the Python Indent plugin in Notepad++, you can easily format your Python code to increase overall development efficiency in your Python projects using Notepad++.