Code completion versatility


Is there a way to disable certain classes of suggestions in code completion? In particular, suggesting Python keywords like “if”, “import” or “while” is never useful to me, and is very distracting, so I'd like to disable them. Often times I would start typing in the console a statement I've typed before, intending to press the Up arrow to recall it from history, but PyCharm would “helpfully” try to suggest something silly like “while” and “with”, and pressing the Up arrow is now cycling through those silly suggestions, whereby I now need to press Escape before I press the Up arrow to do what I wanted to do. I doubt anyone ever code completed “if” or “with”, that's just too short of a word to mentally context switch between “I'm typing a keyword" to “I'm now selecting the continuation of ‘with’ from a dropdown menu” to be useful.

Any suggestions, hopefully more useful than the ones PyCharm's autocomplete gives me?


Some configurations can be enabled or disabled at Settings | Editor | General | Code Completion and  Settings | Editor | General | Postfix Completion in case you want to customize it as you feel fit. Have you tried it?


I can only completely disable suggestions as a type from Code Completion, but I can't disable only Python keyword suggestions. Postfix Completion is an altogether different thing which I find useful because it's so specific that it's hard to trigger it unwanted.


Please sign in to leave a comment.