Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PyCharm: How to skip over closing braces / brackets / parentheses?

Tags:

python

pycharm

I can't get the auto-indentations to work properly unless I use the automatic closing of braces, et al (which I don't like), and I see no option allowing one to skip over/out.

Eclipse has a configuration option for this, and Visual Studio doesn't auto-close everything by default, but rather formats the code block after manually entering the closing brace (which I rather prefer).

Surely there's something apart from going all the way over to the "End" key?

Edit / update:

As I consider it bad form to leave a question without a marked answer, would someone with more recent experience with PyCharm (I haven't used it in quite some time) weigh in with a recommendation for the best among the below solutions? Perhaps there's a newer configuration option or simple solution not yet listed?

like image 990
Withnail Avatar asked Jul 01 '11 07:07

Withnail


Video Answer


2 Answers

Press Ctrl-Shift-Enter to close the missing braces on the current line (if any), add the missing colon (if missing) and put the caret into the correctly indented position on the next line.

like image 127
yole Avatar answered Sep 26 '22 00:09

yole


Shift + Enter will jump past completions and drop you onto the next line.

Ctrl + ] will jump to the end of the current element.

This seems to work in most cases to skip past auto-completions. I find it the most versatile of the options.

Ctrl + [ will jump you to the start of whatever code block you are in.

As previously mentioned Ctrl + Shift + Enter will add any extra auto-completions you might need and drop onto a new line.

like image 30
Marlen T. B. Avatar answered Sep 22 '22 00:09

Marlen T. B.