Vim 插件
IdeaVim 插件集合
官网:https://github.com/JetBrains/ideavim/wiki/IdeaVim-Plugins
vim-easymotion
IDEA need Install IdeaVim-EasyMotion and AceJump plugins
https://github.com/easymotion/vim-easymotion
let mapleader=","
set easymotion
NERDTree
https://github.com/JetBrains/ideavim/wiki/NERDTree-support
Key | Description | Map Setting |
---|---|---|
o | Open files, directories and bookmarks | g:NERDTreeMapActivateNode |
go | Open selected file, but leave cursor in the NERDTree | g:NERDTreeMapPreview |
t | Open selected node/bookmark in a new tab | g:NERDTreeMapOpenInTab |
T | Same as 't' but keep the focus on the current tab | g:NERDTreeMapOpenInTabSilent |
i | Open selected file in a split window | g:NERDTreeMapOpenSplit |
gi | Same as i, but leave the cursor on the NERDTree | g:NERDTreeMapPreviewSplit |
s | Open selected file in a new vsplit | g:NERDTreeMapOpenVSplit |
gs | Same as s, but leave the cursor on the NERDTree | g:NERDTreeMapPreviewVSplit |
O | Recursively open the selected directory | g:NERDTreeMapOpenRecursively |
x | Close the current nodes parent | g:NERDTreeMapCloseDir |
X | Recursively close all children of the current node | g:NERDTreeMapCloseChildren |
P | Jump to the root node | g:NERDTreeMapJumpRoot |
p | Jump to current nodes parent | g:NERDTreeMapJumpParent |
K | Jump up inside directories at the current tree depth | g:NERDTreeMapJumpFirstChild |
J | Jump down inside directories at the current tree depth | g:NERDTreeMapJumpLastChild |
<C-J> | Jump down to next sibling of the current directory 向下跳转到当前目录的下一个同级目录 | g:NERDTreeMapJumpNextSibling |
<C-K> | Jump up to previous sibling of the current directory 跳转到当前目录的上一个同级目录 | g:NERDTreeMapJumpPrevSibling |
r | Recursively refresh the current directory | g:NERDTreeMapRefresh |
R | Recursively refresh the current root | g:NERDTreeMapRefreshRoot |
m | Display the NERDTree menu | g:NERDTreeMapMenu |
q | Close the NERDTree window - 关闭文件树 | g:NERDTreeMapQuit |
A | Zoom (maximize/minimize) the NERDTree window - 放大/缩小 | g:NERDTreeMapToggleZoom |
d | Delete file or directory | g:NERDTreeMapDelete |
n | Create File | g:NERDTreeMapNewFile |
N | Create Directory | g:NERDTreeMapNewDir |
vim-surround
官网:vim-surround
快捷键 | From | to |
---|---|---|
cs"' | "Hello world!" | 'Hello world!' |
cs'<q> | Hello world! | <q>Hello world!</q> |
cst" | <q>Hello world!</q> | "Hello world!" |
ds" | "Hello world!" | Hello world! |
ysiw] | Hello world! (the cursor on "Hello") | [Hello] world! |
cs]{ | [Hello] world! | { Hello } world! |
yssb | { Hello } world! | ({ Hello } world!) |
ds{ds) | ({ Hello } world!) | Hello world! |
ysiw<em> | Hello world! | <em>Hello</em> world! |
S<p class="important"></p> | <em>Hello</em> world! | <p class="important"> Hello world! </p> |
argTexttobj - 参数操作插件
快捷键 | 描述 | 意义 |
---|---|---|
via | ||
cia |
IdeaVimMulticursor
官网:https://plugins.jetbrains.com/plugin/19162-ideavimmulticursor
Usage
Type mc (multicursor) and a vim command to create cursors
Type ms (multiselect) and a vim command to select multiple items
If you previously selected some text, then the commands work only in the selected text
Supported vim commands: /, f, t, w, W, b, B, e, E, ~, 0, $, ^, gu, gU, ge, gE
Example: type ms/print to select all prints in selected text
- Type mcv (multicursor add virtual) to add (or remove) a virtual caret
- Type mcr (multicursor insert real) to insert real carets instead of virtual
- Type mcd (multicursor delete) to remove all virtual carets
Text objects
m{c|s}{i|a}
Example:
type mci( to create two carets at surrounded brackets.
Setup
Install plugin from Intellij Idea Marketplace and add the following option on top of your ./ideavimrc:
set multicursor
also you can map commands, for example:
map q <Plug>(multicursor-ms/) map z <Plug>(multicursor-mcv) map Z <Plug>(multicursor-mcr)
After IdeaVim reboot you can use this plugin
Getting started
Install plugin from Intellij Idea Marketplace and add the following option on top of your ./ideavimrc: "set multicursor". After IdeaVim reboot you can use this plugin. Also you can map commands, for example: "map q (multicursor-ms/)"
ReplaceWithRegister
nmap <leader>rs <Plug>ReplaceWithRegisterOperator
nmap <leader>rss <Plug>ReplaceWithRegisterLine
xmap <leader>rs <Plug>ReplaceWithRegisterVisual
# 用法
<leader>rs {motion}