How to enable Alt+Left click for column selection in PyCharm 如何在PyCharm 里设置Alt加左键实现列选中

Many of you are probably used to using Alt + left click to make column selections in editors like Atom, and if you are also using PyCharm you might be having a hard time finding where to set this up. Here, let me show you.

First of all, go to Preferences -> Keymap -> Editor Actions, find Create Rectangular Selection on Mouse Drag.
第一步,去Preferences -> Keymap -> Editor Actions,找到Create Rectangular Selection on Mouse Drag 选项。 Find the Editor Actions

Then you will find you won’t be able to directly add Alt + left click because it’s already occupied by another action: Add or Remove Caret. Personally I don’t use this much, so I just removed it.
然后你会发现你没法直接给其添加Add mouse shortcut, 因为Alt + left click 快捷方式已经被Add or Remove Caret 占用了。我个人不怎么用这个功能所以我直接在Add or Remove Caret把它删除了。如图所示。
Remove AltButton1 click from add or remove caret

Now you can add the mouse shortcut Alt + left click (in PyCharm the left click is called Button1 click) to Create Rectangular Selection on Mouse Drag.
现在你可以添加Alt left click (在PyCharm里left click是Button1 click).
Add Alt Button click

You should be able to see that in the menu now. Click on OK then you are ready to use Alt + left click to make column selections!
现在你应该能在菜单里看到这个快捷方式了。单击OK确定后,你就可以用Alt 加 左键来实现列选中啦!