<div id="cnblogs\_post\_body" class="blogpost-body cnblogs-markdown"><h3 id="ideavim简介">IdeaVim简介</h3> <p>IdeaVim是IntelliJ IDEA的一款插件,他提高了我们写代码的速度,对代码的跳转,查找也很友好。</p> <ul> <li>安装位置</li> </ul> <p><img src="https://images2015.cnblogs.com/blog/917807/201701/917807-20170118162122953-1924953775.png"></p> <p>安装之后它在 Tools > Vim Emulator</p> <h3 id="具体操作">具体操作</h3> <ul> <li>关闭vim模式</li> </ul> <ul> <p>i菜单栏:tools->vim emulator</p> </ul> <ul> <li>i模式</li> </ul> <p>i模式即为编辑模式,按下字母i开启就可以打字。</p> <ul> <li>Esc</li> </ul> <p>从i模式切换为Vim,按下键盘的Esc键切回Vim。</p> <ul> <li>方向键</li> </ul> <p>上:<strong>k</strong> , 下:<strong>j</strong> , 左: <strong>h</strong> , 右:<strong>l</strong></p> <ul> <li>词组正向跳转(以空格和符号作为分割)-- <strong>小写的w</strong></li> </ul> <p>例如:“hello world,I'm wrting”,当光标在h时,连按w光标依次显示为:w > , > I > ' > m > w > "</p> <ul> <li>词组正向跳转(以空格为分割) -- <strong>大写的W</strong></li> </ul> <p>例如:“hello world,I'm wrting”,当光标在h时,连按大写的W光标依次显示为:w > I > w</p> <ul> <li>词组反向跳转-- <strong>小写的b和大写的B</strong></li> </ul> <p>情况与w类似。</p> <ul> <li>正向跳转到指定字符-- <strong>小写的f</strong></li> </ul> <p>例如:“hello world,I'm wrting”,当光标在<strong>h</strong>时,输入fw,光标跳转到字符world的w字符处。</p> <ul> <li>反向跳转到指定字符-- <strong>大写的F</strong></li> </ul> <p>例如:“hello world,I'm wrting”,当光标在<strong>d</strong>时,输入Fw,光标跳转到字符world的w字符处。</p> <ul> <li>正向跳转到指定字符的上一个位置(空格也算)-- <strong>小写的t</strong></li> </ul> <p>例如:“hello world,I'm wrting”,当光标在<strong>h</strong>时,输入td,光标跳转到字符world的l字符处。</p> <ul> <li>反向跳转到指定字符的下一个位置(空格也算)-- <strong>大写的T</strong></li> </ul> <p>例如:“hello world,I'm wrting”,当光标在<strong>d</strong>时,输入Tw,光标跳转到字符world的o字符处。</p> <ul> <li><p>复制当前行-- <strong>yy</strong></p></li> <li><p>粘贴-- <strong>p</strong></p></li> </ul> <p>粘贴至光标的下一行,例如:“hello world,I'm wrting”,当光标在此行时,输入yyp,当前行复制并粘贴,下面又多出一行。</p> <ul> <li>10p</li> </ul> <p>粘贴10次</p> <ul> <li>跳转至下一个与当前光标相同字符的位置(可以跨行跳转)-- \*</li> </ul> <p>例如:“hello world,I'm wrting”,当光标在hello的最后一个l字符处,输入 \* ,跳转到world的l字符处。</p> <ul> <li>跳转至上一个与当前光标相同字符的位置(可以跨行跳转)-- #</li> </ul> <p>情况如上。</p> <ul> <li>选中(再通过上下左右进行区域选中)-- <strong>v</strong></li> </ul> <p>例如:当光标在第一行hello的h字符处,输入vjj<br> <img src="https://images2015.cnblogs.com/blog/917807/201701/917807-20170118171916234-1112423646.png"></p> <ul> <li><p>删除当前行-- <strong>dd</strong></p></li> <li><p>5dd</p></li> </ul> <p>删除当前行在内以下的5行。</p> <ul> <li>删除选中区域-- <strong>d</strong></li> </ul> <p>例如上面的例子中,可以输入vjjd进行区域删除。</p> <ul> <li><p>撤销 -- <strong>u</strong></p></li> <li><p>正向按字符单位进行删除-- <strong>x</strong></p></li> </ul> <p>从光标所在位置处逐个正向删除</p> <ul> <li><p>反向从光标上一个位置处进行删除-- <strong>大写的X</strong></p></li> <li><p>从光标处删除至指定字符-- <strong>df指定字符</strong></p></li> </ul> <p>例如:“hello world,I'm wrting”,当光标在<strong>h</strong>时,输入dfw,结果为“orld,I'm wrting”。</p> <ul> <li>删除引号内的内容-- <strong>di"</strong></li> </ul> <p>例如:“hello world,I'm wrting”,当光标在此行时,输入di",结果为“”。</p> <ul> <li><p>删除包含引号在内的内容-- <strong>da"</strong></p></li> <li><p>跳转至文件头-- <strong>gg</strong></p></li> <li><p>跳转至文件尾-- <strong>G</strong></p></li> <li><p>跳转至指定行的开头-- <strong>行号G</strong></p></li> </ul> <hr> </div> 原文地址:https://www.cnblogs.com/zhaozihan/p/6297217.html