How to move caret to console in pycharm?

那年仲夏 提交于 2021-02-10 06:48:55

问题


Is it possible to have a keyboard shortcut to move the caret from editor to console and back in pycharm? I can switch the focus between editor and console using CTRL+TAB, but that doesn't allow me to start typing in the console unless I click in it.

I am using the linux community distribution.


回答1:


I'm on MacOS and PyCharm 2018.2. Doing Ctrl+Tab+P opens up console and focuses on it so I can immediately start typing.

Update: You can also set your own key map: Tool Windows/Python Console. Hitting Esc will focus you back on the editor window.




回答2:


The key is to hit the TAB key once (potentially twice) after you move into the Python Console (via whatever shortcut you specify in the keymap).




回答3:


I think it also depends on whether the Python Console is docked - looks like it doesn't work if the Console is in another Window. So my current setup is having the Console docked:




回答4:


You can use Alt + 4 or Alt + 5 where the digit is the window number. And then to refocus back to the edit you press Enter.




回答5:


A couple of years later but i found my self in this situations, i believe the other answers are good enough for some but they lack some important information or at least i didn't found it.

You need to look for the term Python or debug console under tools if you want to focus to the console with the caret at it, add a keymap value for that (in my case i added ALT+2), do NOT use the python console under tool windows, for that it will focus on the python console but not the caret at it.

(done with pycharm 2020.1.1 in a ubuntu 20.04 lts machine)



来源:https://stackoverflow.com/questions/52944985/how-to-move-caret-to-console-in-pycharm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!