Home > Backend Development > Python Tutorial > Basic shortcut key settings for getting started with Pycharm

Basic shortcut key settings for getting started with Pycharm

Y2J
Release: 2017-05-12 10:46:17
Original
4790 people have browsed it

This article mainly introduces in detail the fifth part of the most complete Pycharm learning tutorial, Python shortcut key related settings, which has certain reference value. Interested friends can refer to it

Python shortcut key related settings, the specific content is as follows

1. Theme

There is no doubt that Pycharm is an IDE with a powerful shortcut key system, which means that you are in Pycharm Any operation in , such as opening a file, switching editing areas, etc., can be achieved through shortcut keys. Using shortcut keys not only speeds up operations, but also looks really cool. However, if you are used to using some shortcut key schemes, your fingers will become accustomed to them and it will be more difficult to change. This part of the tutorial introduces how to tailor Pycharm shortcut key settings according to your habits, so that you can use them easily.

I won’t go into details about the basic shortcut key combinations and usage here. For details, please refer to Configuring keyboard shortcuts or Keymap.

2. Select a shortcut key configuration scheme

This step is very simple. Click the Settings button in the main toolbar and click Keymap in the Settings dialog box.

Select a shortcut key configuration scheme from the drop-down list on the corresponding page:

Click Apply to save the changes. For example, we have chosen the Eclipse solution here, so the shortcut key for deleting a line is the Ctrl+D we are used to.

 3. Change the shortcut key configuration scheme.

Here we introduce how to change the configuration scheme of shortcut keys.

Imagine the situation: you choose the shortcut key configuration of the Emacs scheme, but this configuration scheme does not pre-define how to delete a line through the shortcut keys:

Suppose you want to assign the shortcut key for this function to Ctrl+D, the operation is as follows:

(1) Click the Settings button in the main toolbar, and in the Settings dialog box Click Keymap.

  (2) Select Emacs in the corresponding list.

 (3) In the shortcut key function list below, expand the Editor Actions node and locate the Delete Line function.

 (4) Right-click and select Add Keyboard Shortcut in the shortcut menu

## (5) In the open Enter Keyboard Shortcut window, click

First Enter the shortcut key combination you want in Stroke:

One thing to note is that when entering the expected shortcut key, all input from the keyboard will be Identified as the user's shortcut key setting. For example, if you want to set a shortcut key combination

Ctrl+D, you need to press the Ctrl and D keys at once.

If you press the wrong key, you can only use the mouse pointer to delete the wrong input, because the input Backspace from the keyboard will also be recognized by the system as a shortcut key setting.

(6) Next, you need to pay attention to the system warning: this Ctrl+D shortcut key combination already exists, indicating that Pycharm has associated this shortcut key combination with other settings. Fortunately, the previous The setting is not commonly used and can be replaced, so click OK to confirm.

Pycharm will give a warning when replacing:

(7) Browse the set shortcut key scheme again:

You will find that the configuration plan at this time is automatically renamed to Emacs

copy. This is because Pycharm does not allow users to change its predefined shortcut key configuration scheme, only its copied files. Click Apply and close the dialog box.

Finally test whether our changes take effect. Open a py file, position the cursor on the line to be deleted, and press Ctrl+D. The line of code is successfully deleted and the settings are changed successfully.

【Related Recommendations】

1.

Free Python Video Tutorial

2.

Application of Python in Data Science

3. Python basic introductory tutorial

The above is the detailed content of Basic shortcut key settings for getting started with Pycharm. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template