P-Gn
P-Gn

Reputation: 24641

Stop PyCharm's completion from replacing word right of the cursor when tab completing

In PyCharm, tab completion replaces the word right of the cursor by default. This happens to me often when I insert some function into existing code. For example, if I want to add a call to foobar around an existing x+1 expression, I would type

enter image description here

which brings up the completion options. The result after tab-completing is

enter image description here

with x having been overwritten. Is there a way to make PyCharm's completion stop removing words right to the cursor?

Upvotes: 3

Views: 225

Answers (2)

Tom B
Tom B

Reputation: 539

At least in my version of Pycharm, the option can be changed under Settings->Keymap in "Choose Lookup Item" and "Choose Lookup Item Replace"

enter image description here

I don't ever expect to see text replaced when doing tab completion, so I've moved "Tab" to "Choose Lookup Item."

Upvotes: 3

grundic
grundic

Reputation: 4921

Have you tried pressing Enter instead of Tab? It should do exactly what you want: put corresponding function after cursor without replacing other code.

By the way, recently other guy was asking how to do opposite thing :)

Upvotes: 2

Related Questions