Using IntelliJ idea as the Vim Editor

Source: Internet
Author: User
Tags swiftype

Reprinted from Https://www.jetbrains.com/help/idea/using-intellij-idea-as-the-vim-editor.html

This feature was only supported in the Ultimate edition.

The following is only valid when Ideavim Plugin is installed and enabled!

Before you start

Make sure:

    • You is working with IntelliJ idea version 15.0.0 or higher. If you still does not has IntelliJ idea, the download it from the This page. To install IntelliJ idea, follow the instructions, depending on your platform.
Downloading and installing Ideavim plugin

On the toolbar of the IntelliJ Idea main window, press Ctrl+Alt+S to open the Settings/preferences dialog, and then click Plugi NS settings.

The list of plugins currently installed on you computer. However, the Ideavim plugin is not among them. Click the button Browse jetbrains plugins. IntelliJ idea shows the contents of the huge jetbrains repository ... can type the word "vim" in the search field to NA Rrow down the list:

After installing the plugin, it actually becomes available after IntelliJ idea restart.

What happens to IntelliJ idea's UI after restart?

First, on the Tools menu, a check command Vim Emulator appears:

After the IntelliJ idea restart, the This check command is selected. You can disable Vim by clearing this check command.

Second, in settings/preferences dialog, a additional page Vim Emulation appears after restart.

Configuring shortcuts

Both Vim and IntelliJ idea is keyboard-centric. with Ideavim plugin, it's quite possible that IntelliJ Idea's keymap runs into a conflict with the Vim keymap. That's why IntelliJ idea allows-choosing which keyboard shortcut you prefer for a certain action. This is how it's done.

Open settings/preferences dialog, and click Vim Emulation:

in the Shortcut column, select the Shortcut your want to configure. Next, in the Handler column, click the corresponding cell, and see the Drop-down list of three possible options (Undef ined, IDE, Vim):

If you choose IDE, it means the IntelliJ idea's shortcut for this particular action is enabled. When you press, say, Ctrl+Z and IntelliJ idea silently performs its action.

If you leave the handler undefined, then, on pressing the shortcut, say, Ctrl+B and IntelliJ idea shows the banner.

You can choose to redefine this shortcut as a IDE shortcut and thus accept the IntelliJ idea ' s keymap. To doing so, click the link IDE shortcut.

If you click the "down arrow" and then the "link Vim Emulation, then IntelliJ idea would show the vim Emulation page o f the settings/preferences dialog.

For the purposes of this tutorial, click the link Vim Emulation. Then if you press Ctrl+B , IntelliJ idea would perform the Vim action for this keyboard shortcut.

Editing modes

OK, now so you had Vim enabled, you see that the cursor had changed its shape-now it was a block, which means that is in the Normal mode:

If you want to enter the Insert mode, press i , and the cursor would turn into a line:

In this mode you can type new or change the existing code. Same, you can enter the various Vim modes:for example, press for r thereplace mode.

By the to, as soon as you enter VIM emulation, it's also reported in the Status bar.

To return to the Normal mode, press Escape .

Last modified:22 January 2018 Using Emacs as an External editorsee alsoexternal LINKS:
    • http://vimdoc.sourceforge.net/htmldoc/

Using IntelliJ idea as the Vim Editor

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.