Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pycharm disable closing brackets and enable autoindent

Tags:

pycharm

Recently I've started using Pycharm (I've installed edu version, hoping there will be less "features you can't live without"). Currently I'm struggling with two problems:
1) when I'm typing [, pycharm autocomplete my bracket with []. No, if I want [] I type "[]", and if I want [ I wanna type just "[". Similar to any other 'brackets', like " ' [ { ( etc.

2) Typing if-else loop:

if something:
    something more  
    #now  want else, so I type...
    else

I wonder if Pycharm is smart enough to automatically put else in the previous indent, on the same level as if?
Maybe there are commonly known options, but English is not my mother language, so I don't know how to name them and find in the Internet. Or maybe I disabled those features somehow?

like image 812
Photon Light Avatar asked Nov 30 '15 11:11

Photon Light


1 Answers

Note: I'm using the Pro 5.0 version, not 100% sure you have the same in the Community version.

For #1, you can disable the automatic closing brackets/quotes in the Smart Keys settings, by default enabled:

smart keys settings

For #2 it indeed automatically indents the else properly when you add the final : (i.e. when you type the whole else:)

like image 55
Dan Cornilescu Avatar answered Nov 20 '22 16:11

Dan Cornilescu