PyCharm: Switch between Code and Run/Terminal with CapsLock-u and CapsLock-n

你。 提交于 2019-12-02 07:10:59

问题


I would like to switch between Code and Run/Terminal with CapsLock-u and CapsLock-n in PyCharm.

On my keyboard u is at the top, and n is at the bottom, this gives me a good way to memorize this.

I have no clue how to configure my Ubuntu 16.04 (unity) desktop like this.


回答1:


I have a solution that utilizes the pycharm's switcher.

Note that in my current window setup, I have the terminal as the 5th window on screen, that maybe different on your case. Also this is relevant to Pycharm 2016.3

  1. Go to Edit > Macros > Start Macro Recording.
  2. Now pycharm will record your keystrokes.
  3. Press Ctrl + Tab. Go to Edit > Macros > Stop Macro Recording. Give it a name, ex: switch to code
  4. To record the second macro: repeat steps 1 through 3 but now record: Ctrl + Tab, release Tab without releasing Ctrl and press 5 (or whatever the number is for your terminal in the switcher screen).
  5. Go to File > settings > keymap scroll down to the folder named Macros. Left click on the title > add keyboard shortcut > Record your shortcut ex: Caps Lock + u

Now you can use your key bindings to playback the macro on pycharm. If you ever change the layout of your window, remember to update the macros as well!

Good luck :)



来源:https://stackoverflow.com/questions/42436719/pycharm-switch-between-code-and-run-terminal-with-capslock-u-and-capslock-n

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