转载自https://www.jetbrains.com/help/idea/using-intellij-idea-as-the-vim-editor.html

This feature is only supported in the Ultimate edition.

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

Before you start

Make sure that:

  • You are working with IntelliJ IDEA version 15.0.0 or higher. If you still do not have IntelliJ IDEA, download it from 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 Plugins settings.

You see 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... you can type the word "vim" in the search field to narrow 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 IntelliJ IDEA restart, this check command is selected. You can disable Vim by clearing this check command.

Second, in Settings/Preferences dialog, an additional page Vim Emulation appears after restart.

Configuring shortcuts

Both Vim and IntelliJ IDEA are keyboard-centric. With IdeaVim plugin, it is quite possible that IntelliJ IDEA's keymap runs into a conflict with the Vim keymap. That's why IntelliJ IDEA allows you 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 you want to configure. Next, in the Handler column, click the corresponding cell, and see the drop-down list of three possible options (Undefined, IDE, Vim):

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

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

You can choose to redefine this shortcut as an IDE shortcut and thus accept the IntelliJ IDEA's keymap. To do so, click the link IDE shortcut.

If you click the down arrow and then the link Vim Emulation, then IntelliJ IDEA will show the Vim Emulation page of the Settings/Preferences dialog.

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

Editing modes

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

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

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

By the way, as soon as you enter Vim emulation, it is also reported in the Status bar.

To return to the Normal mode, press Escape.

Last modified: 22 January 2018
 

SEE ALSO

Using IntelliJ IDEA as the Vim Editor的更多相关文章

  1. spf13-vim – The Ultimate Distribution for Vim Editor

    spf13-vim is a cross platform and highly customizable assortment of vim plugins and various resource ...

  2. Amazon.com: NEW VI AND VIM EDITOR KEYBOARD STICKER: Office Products

    Amazon.com: NEW VI AND VIM EDITOR KEYBOARD STICKER: Office Products NEW VI AND VIM EDITOR KEYBOARD S ...

  3. 在IntelliJ IDEA中使用VIM

    IdeaVim(下载)插件可以让你在IntelliJ IDEA中键盘敲的飞起. 安装 打开IDEA的设置,在Plugins里,你可以选择在线搜索Vim安装,当然如果不行,就可以选择单独下载后安装,以下 ...

  4. 教你在 IntelliJ IDEA 中使用 VIM!

    Java技术栈 www.javastack.cn 优秀的Java技术公众号 IdeaVim(下载)插件可以让你在IntelliJ IDEA中键盘敲的飞起. 安装 打开IDEA的设置,在Plugins里 ...

  5. 高效编程:在IntelliJ IDEA中使用VIM

    硬核干货分享,欢迎关注[Java补习课]成长的路上,我们一起前行 ! <高可用系列文章> 已收录在专栏,欢迎关注! 概述 Vim是一个功能强大.高度可定制的文本编辑器; 具体有多强大,我现 ...

  6. Solarized Colorscheme for IntelliJ IDEA

    Solarized Colorscheme for IntelliJ IDEA Original Solarized color scheme developed by Ethan Schoonove ...

  7. Vim ide for shell development

    Source : This article is part of the ongoing Vi / Vim Tips and Tricks Series. As a Linux sysadmin or ...

  8. CentOS安装vim

    VMware下CentOS安装成功后,默认自带vi,但vi功能没vim丰富.以下为CentOS中安装vim: 用yum产看源中的vim安装包: [xi@localhost ~]$ yum search ...

  9. vi/vim使用指北 ---- Learning the vi and Vim Editors 读书 笔记

    vi/vim作为liux系统下最强大,最流行的文本编辑器之一.边看<Learning the vi and vim Editor>边学习vim,顺便做写简单的笔记,供以后查询. 没看这本书 ...

随机推荐

  1. JavaEE 要懂的小事:二、图解 Cookie(小甜饼)

    Writer      :BYSocket(泥沙砖瓦浆木匠) 微         博:BYSocket 豆         瓣:BYSocket FaceBook:BYSocket Twitter   ...

  2. 区块链--Ubuntu上搭建以太坊私有链

    1.搭建私链所需环境 操作系统:ubuntu16.04,开虚拟机的话要至少4G,否则会影响测试挖矿时的速度 软件: geth客户端 Mist和Ethereum Wallet:https://githu ...

  3. Go基础系列:简单数据类型

    每一个变量都有数据类型,Go中的数据类型有: 简单数据类型:int.float.complex.bool和string 数据结构或组合(composite):struct.array.slice.ma ...

  4. Hystrix降级逻辑中如何获取触发的异常

    通过之前Spring Cloud系列教程中的<Spring Cloud构建微服务架构:服务容错保护(Hystrix服务降级)>一文,我们已经知道如何通过Hystrix来保护自己的服务不被外 ...

  5. RNN入门(4)利用LSTM实现整数加法运算

      本文将介绍LSTM模型在实现整数加法方面的应用.   我们以0-255之间的整数加法为例,生成的结果在0到510之间.为了能利用深度学习模型模拟整数的加法运算,我们需要将输入的两个加数和输出的结果 ...

  6. [转]ASP.NET Core: Static Files cache control using HTTP Headers

    本文转自:https://www.ryadel.com/en/asp-net-core-static-files-cache-control-using-http-headers/ Every sea ...

  7. [转]php 图片验证码生成 前后台验证

    本文转自:https://www.cnblogs.com/xiaoyezi/p/3541195.html 自己从前一段时间做了个php小项目,关于生成图片验证码生成和后台的验证,把自己用到的东西总结一 ...

  8. C# 只开启一个程序,如果第二次打开则自动将第一个程序显示到桌面

    using System; using System.Collections.Generic; using System.Windows.Forms; using System.Runtime.Int ...

  9. C# Winform打包部署时添加注册表信息实现开机自启动

    1.原理:需要开机自启动的程序,需要将其启动程序的路径写到注册表中指定的文件夹下 2. 写入注册表的方式有两种 a.在生成安装程序时配置 b.在程序运行时,动态配置 方法一:使用VS2010自带的打包 ...

  10. react学习(二)之通信篇

    react性能提升原理:虚拟DOM react把真是的DOM tree,转化成virtual DOM,每次数据更新后,重新计算virtual DOM并与上一次的作对比,然后对发生改变的部分进行批量更新 ...