Pycharm tutorial (6) Use Pycharm as the Vim editor and pycharmvim
Pycharm is used as the Vim editor. The specific content is as follows:
1. Subject
If you are a fan of Vim and do not plan to use other types of editors, this tutorial will be more suitable for you. Here we will detail howIdeaVimDownload, install, and use Vim with the help of plug-ins. For details about Python programming and Vim usage, see official website and Vim documentation.
2. Preparations
Install Python 2.7 or later
3. download and install the IdeaVim plug-in
Click the Settings button in the main toolbar of Pycharm.IDE SettingsSelect the Plugins page. All plug-ins installed on the current platform are displayed. However, IdeaVim is not in it. You need to clickBrowse JetBrainsClick the plugins button and type vim in the search bar to find the corresponding plug-in:
Install plug-ins:
Restart Pycharm to use it:
4. Changes After restart
Vim and Pycharm are both text editing software based on keyboard input. The shortcut key settings of the response IdeaVim plug-in may conflict with those of Pycharm, this is why Pycharm needs to recreate a set of Vim shortcut keys based on the existing shortcut key configuration.
After Pycharm is restarted, you will seeVim Keymap settingsIn the dialog box, select a shortcut key configuration scheme as the shortcut key scheme in the current Vim environment:
Select the default configuration here and click OK. You can see that Pycharm has created a new shortcut key Configuration:
Next, view the shortcut key settings page. Click set to enterSettingsDialog box, inIDE SettingsClick the Keymap page. In the corresponding shortcut key configuration drop-down list, a solution name named Vim is displayed, which defines some default shortcut key combinations, for example, Ctrl + V stands for pasting:
However, there is also a more important Pycharm interface setting. In the main toolbar, clickTools,SelectVim EmulatorCommand:
After you install the IdeaVim plug-in, this command is selected by default (with a check mark in front), which means that the current Vim simulator is available. Deselect the check box, And the Pycharm returns to the normal shortcut key. If you check it again, Pycharm reloads the Vim shortcut key configuration scheme:
5. editing mode
Now we can edit it in Vim mode. At this time, the input cursor is a small black block, which means that we are in Normal mode:
If you want to change to Insert mode, press the I key and the cursor will change to a vertical line:
In this mode, you can enter new code or modify the current code. You can also select another mode, for example, press the r key to enter the Replace input mode.
By the way, to quickly enter the Vim simulation, you can view the Status bar prompts: Status bar
Press Esc to return to normal editing mode.
IdeaVim has many VIm editor features, such as abbreviations, shortcut keys, and various commands. For details, see a lot more.
The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.