Reputation: 351
It doesn't act like Python's IDLE.
Example:
else:
name = 'World'
print 'Howdy', name
print 'yay'
but in Notepad++
else: # i press enter and this is what it does
lands me here
But I want to be able to do it like in IDLE: after the :
I can just press enter and keep on going.
I have my file type set to Python and my format to unix.
Upvotes: 35
Views: 96271
Reputation: 63
In Notepad++ version v8.4.4
The Auto Indent is located in Settings->Preferences->Auto-Completion
and no longer in MISC.
However, for Python indentation it didn't work for me.
What worked is to use the Python Indent plugin (set to Enable).
Upvotes: 2
Reputation: 974
None of the above solutions worked for me but this worked:
Install latest version of notepad++ (as of Feb 2022)
Goto Settings -> Preferences -> Language -> Tab Settings -> Select Python -> Uncheck (Default Value) and make sure that the 'Replace by space' is selected with 4 as the count
Next, goto Settings -> Preferences -> Auto-Completion -> Enable Auto-Indent (if it's not already enabled)
This should work as expected as it's working for me.
Upvotes: 3
Reputation: 11
This is for Notepad++ version v8.1.9.3 (the latest as of today)
Before starting this, save your work... but no need to close any open tab
Plugins > Plugins Admin > Search: Python Indent > Python Indent (check box) > Install > Yes
Notepad++ will restart... it will take 10 seconds or so
Plugins > Python Indent > Enable
Do a test... and let me know
Upvotes: 1
Reputation: 181
-- For Newer Versions , Goto Settings>>Preferences>>Auto-Completion>>Auto-Indent(checkbox)
-- For Older Versions , Goto Settings > Preferences > MISC. > Auto-Indent (checkbox)
By the time of this post, The newest Version of Notepad++ is v7.8.7.(tested)
Upvotes: 0
Reputation: 149
Go to Settings > Preferences > Language
Then on the "Tab Settings" box select "python" and tick the "Use default value" checkbox.
You're welcome.
P.S. Yeah, I know this a little old. I really just couldn't help it. Anyway, this is for version v7.3.2.
Upvotes: 3
Reputation: 85
After that, you should be fine.
Upvotes: 0
Reputation: 1177
I played a bit with python in Notepad++ and I had a problem with the tab. Since in python your indentation is really important but notepad ++ put space instead of a tab.
So to change to tab you need to go in notepad ++ Menu Settings > Preferences... then select Tab Settings Then select python in the Tab Settings box and uncheck Use default value and check Replace by space.
Like the other answer, you might want to consider another ide. I personally use eclipse with the pydev plugin and django plungin. Erik is nice too.
Upvotes: 38
Reputation: 625
I found the Python Indent plugin on the official plugin page, and it worked fine!
http://docs.notepad-plus-plus.org/index.php/Plugin_Central#P
Upvotes: 20
Reputation: 151
Well, here is a updated answer:
Notepad++ >> Plugins >> plugin manager >> show plugin manager >> find (python indent) click install >> should be downloaded you need to reach to enable again from Plugins>>python indent>>enable
Upvotes: 12
Reputation: 519
This is what you want:
Settings > Preferences > MISC. > Auto-Indent (checkbox)
--
Sometimes people ask, "How can I do x in program y?"
I have a dream that one day "Use program z instead" will not be the most popular response.
Upvotes: 51
Reputation: 300
Emacs has python-mode which (also) does it. Grab it and prepare for life-time enjoyment.
Upvotes: -4
Reputation: 41496
I've found Notepad++ to live up to the task of being a better basic text editor than Notepad, but it isn't really designed to be as smart as a proper programming IDE.
It might be possible to get it to do what you're asking for, but I certainly don't know how to set it up that way.
Upvotes: -3