Use tab for indent and code completion

Answered

Hi all, 

when I set "tab" as the character in Keymap -> Main Menu -> Code -> Completion -> Basic, 

tab stops working for me for normal indenting, 

even though I choose to leave "tab" as the key for Indent in Editor actions, and Indent Selection.

My ideal behavior would be that Tab acts normally as an indent (or indent selection), except when the code complete menu is up, and then tab is used to use code completion.

How can I do this?

I also have the PyCharm IDEAVim plugin enabled, if that is relevant. 

 

Thank you!

0
3 comments

Indent works if you make a selection. Unfortunately, PyCharm doesn't have a feature that allows doing exactly what you mentioned. There is a relevant feature request in our issue tracker https://youtrack.jetbrains.com/issue/PY-13489

0

PyCharm really should be able to use tab more cleverly. Jupyter Labs have great 'tab' functionality whereby it will indent if at start of line (or multi-lines selected), or will bring up code-complete if the cursor is at a relevant point in the line.

PyCharm can't even seem to work out the indentation as if I multi-select lines and press tab, my code is replaced by a single tab gap. Crazy stupid!

1

I recently found some success by enabling “Insert selected suggestion by pressing space, dot, or other context-dependent keys” from code completion settings.

 

0

Please sign in to leave a comment.