doc/IdeaVim Plugins.md
IdeaVim plugins work like the original Vim plugins. If you want to turn any of them on, you have to enable it via this command in your ~/.ideavimrc:
Plug '<plugin-github-reference>'
If you reuse your existing .vimrc file using source ~/.vimrc, IdeaVim can parse and enable plugins that are defined
using vim-plug or vundle.
No additional set commands in ~/.ideavimrc are required.
If you'd like to disable some plugin that's enabled in .vimrc, you can use set no<extension-name>
in ~/.ideavimrc. E.g. set nosurround.
Available plugins:
<details> <summary><h2>anyobject: Useful text objects like functions, arguments, classes, loops, list items, block comments, and more.</h2></summary>An extension for IdeaVim plugin that adds useful text objects to improve your productivity on JetBrains IDEs.
Text objects allow a more efficient way of communicating edition or selection actions in the editor. Instead of thinking in terms of characters, words, lines, or paragraphs, use more advance text constructs like quoted text, text between brackets, items in a collection, or programming language constructs like arguments, classes, functions, loops, or comments.
By Ricardo Rodriguez
set anyobject to your ~/.ideavimrc file, then run :source ~/.ideavimrc
or restart the IDE.https://plugins.jetbrains.com/plugin/28333-vim-anyobject
</details> <details> <summary><h2>argtextobj: Provides a text-object 'a' argument</h2></summary>Original plugin: argtextobj.vim.
This plugin provides a text-object 'a' (argument). You can d(elete), c(hange), v(select)... an argument or inner argument in familiar ways.
That is, such as 'daa'(delete-an-argument) 'cia'(change-inner-argument) 'via'(select-inner-argument). What this script does is more than just typing
F,dt,
because it recognizes inclusion relationship of parentheses.
Add the following command to ~/.ideavimrc: Plug 'vim-scripts/argtextobj.vim'
<code>Plug 'https://github.com/vim-scripts/argtextobj.vim'</code>
<code>Plug 'argtextobj.vim'</code>
<code>Plug 'https://www.vim.org/scripts/script.php?script_id=2699'</code>
<code>set argtextobj</code>
</details>
By default, only the arguments inside parenthesis are considered. To extend the functionality
to other types of brackets, set g:argtextobj_pairs variable to a comma-separated
list of colon-separated pairs (same as VIM's matchpairs option), like
let g:argtextobj_pairs="(:),{:},<:>". The order of pairs matters when
handling symbols that can also be operators: func(x << 5, 20) >> 17. To handle
this syntax parenthesis, must come before angle brackets in the list.
https://www.vim.org/scripts/script.php?script_id=2699
</details> <details> <summary><h2>commentary: Adds mapping for quickly commenting stuff out</h2></summary>By Daniel Leong
Original plugin: commentary.vim.
Comment stuff out. Use gcc to comment out a line (takes a count), gc to comment out the target of a motion (for example, gcap to comment out a paragraph), gc in visual mode to comment out the selection, and gc in operator pending mode to target a comment. You can also use it as a command, either with a range like :7,17Commentary, or as part of a :global invocation like with :g/TODO/Commentary. That's it.
Add the following command to ~/.ideavimrc: Plug 'tpope/vim-commentary'
<code>Plug 'https://github.com/tpope/vim-commentary'</code>
<code>Plug 'vim-commentary'</code>
<code>Plug 'tcomment_vim'</code>
<code>set commentary</code>
</details>
https://github.com/tpope/vim-commentary/blob/master/doc/commentary.txt
</details> <details> <summary><h2>dial: Advanced text increment and decrement functionality.</h2></summary>IdeaVim extension with advanced text increment and decrement functionality. It enhances the standard increment/decrement functionality found in Vim editors by adding support for complex text patterns beyond simple numbers.
Cycle through related values from various text elements, including numbers, dates, boolean values, operators, and programming language-specific keywords.
By Ricardo Rodriguez
set dial to your ~/.ideavimrc file, then run :source ~/.ideavimrc
or restart the IDE.https://plugins.jetbrains.com/plugin/28237-vim-dial
</details> <details> <summary><h2>easymotion: Simplifies some motions</h2></summary>Original plugin: vim-easymotion.
EasyMotion provides a much simpler way to use some motions in vim. It takes the <number> out of <number>w or <number>f{char} by highlighting all possible choices and allowing you to press one key to jump directly to the target.
Install IdeaVim-EasyMotion and AceJump plugins.
Add the following command to ~/.ideavimrc: Plug 'easymotion/vim-easymotion'
<code>Plug 'https://github.com/easymotion/vim-easymotion'</code>
<code>Plug 'vim-easymotion'</code>
<code>set easymotion</code>
</details>
All commands with the mappings are supported. See the full list of supported commands.
</details> <details> <summary><h2>exchange: Easy text exchange operator</h2></summary>By fan-tom
Original plugin: vim-exchange.
Easy text exchange operator for Vim.
Add the following command to ~/.ideavimrc: Plug 'tommcdo/vim-exchange'
<code>Plug 'https://github.com/tommcdo/vim-exchange'</code>
<code>Plug 'vim-exchange'</code>
<code>set exchange</code>
</details>
https://github.com/tommcdo/vim-exchange/blob/master/doc/exchange.txt
</details> <details> <summary><h2>FunctionTextObj: Adds text objects for manipulating functions/methods</h2></summary>By Julien Phalip
An extension for IdeaVim that adds text objects for manipulating functions/methods in your code. Similar to how iw operates on words or i" operates on quoted strings, this plugin provides if and af to operate on functions
Add set functiontextobj to your ~/.ideavimrc file, then run :source ~/.ideavimrc
or restart the IDE.
https://plugins.jetbrains.com/plugin/25897-vim-functiontextobj
</details> <details> <summary><h2>highlightedyank: Highlights the yanked region</h2></summary>By KostkaBrukowa
Original plugin: vim-highlightedyank.
Make the yanked region apparent!
Add the following command to ~/.ideavimrc: Plug 'machakann/vim-highlightedyank'
<code>Plug 'https://github.com/machakann/vim-highlightedyank'</code>
<code>Plug 'vim-highlightedyank'</code>
<code>set highlightedyank</code>
</details>
If you want to optimize highlight duration, assign a time in milliseconds:
let g:highlightedyank_highlight_duration = "1000"
A negative number makes the highlight persistent.
If you want to change background color of highlight you can provide the rgba of the color you want e.g.
let g:highlightedyank_highlight_color = "rgba(160, 160, 160, 155)"
If you want to change text color of highlight you can provide the rgba of the color you want e.g.
let g:highlightedyank_highlight_foreground_color = "rgba(0, 0, 0, 255)"
https://github.com/machakann/vim-highlightedyank/blob/master/doc/highlightedyank.txt
</details> <details> <summary><h2>indent-object: Adds text objects for manipulating sentences/paragraphs/etc...</h2></summary>By Shrikant Sharat Kandula
Original plugin: vim-indent-object.
Vim text objects provide a convenient way to select and operate on various types of objects. These objects include regions surrounded by various types of brackets and various parts of language (ie sentences, paragraphs, etc).
Add the following command to ~/.ideavimrc: Plug 'michaeljsmith/vim-indent-object'
<code>Plug 'https://github.com/michaeljsmith/vim-indent-object'</code>
<code>Plug 'vim-indent-object'</code>
<code>set textobj-indent</code>
</details>
https://github.com/michaeljsmith/vim-indent-object/blob/master/doc/indent-object.txt
</details> <details> <summary><h2>matchit.vim: Extends the % key functionality</h2></summary>By Martin Yzeiri Original plugin: matchit.vim.
In Vim, as in plain vi, the percent key, |%|, jumps the cursor from a brace, bracket, or paren to its match. This can be configured with the 'matchpairs' option. The matchit plugin extends this in several ways...
Add the following command to ~/.ideavimrc: packadd matchit
<code>Plug 'chrisbra/matchit'</code>
<code>set matchit</code>
</details>
https://github.com/adelarsq/vim-matchit/blob/master/doc/matchit.txt
</details> <details> <summary><h2>Mini.ai: Extend and create a/i textobjects (IMPORTANT: The plugin is not related with artificial intelligence)</h2></summary>Extend and create a/i textobjects
Provides additional text object motions for handling quotes and brackets. The following motions are included:
Original plugin: mini.ai.
~/.ideavimrc: set mini-aiOriginal plugin: vim-multiple-cursors.
Add the following command to ~/.ideavimrc: Plug 'terryma/vim-multiple-cursors'
<code>Plug 'https://github.com/terryma/vim-multiple-cursors'</code>
<code>Plug 'vim-multiple-cursors'</code>
<code>set multiple-cursors</code>
</details>
At the moment, the default key binds for this plugin do not get mapped correctly in IdeaVim (see VIM-2178). To enable the default key binds, add the following to your .ideavimrc file...
" Remap multiple-cursors shortcuts to match terryma/vim-multiple-cursors
nmap <C-n> <Plug>NextWholeOccurrence
xmap <C-n> <Plug>NextWholeOccurrence
nmap g<C-n> <Plug>NextOccurrence
xmap g<C-n> <Plug>NextOccurrence
xmap <C-x> <Plug>SkipOccurrence
xmap <C-p> <Plug>RemoveOccurrence
" Note that the default <A-n> and g<A-n> shortcuts don't work on Mac due to dead keys.
" <A-n> is used to enter accented text e.g. ñ
" Feel free to pick your own mappings that are not affected. I like to use <leader>
nmap <leader><C-n> <Plug>AllWholeOccurrences
xmap <leader><C-n> <Plug>AllWholeOccurrences
nmap <leader>g<C-n> <Plug>AllOccurrences
xmap <leader>g<C-n> <Plug>AllOccurrences
Original plugin: NERDTree.
Adds NERDTree navigation to the project panel.
Add the following command to ~/.ideavimrc: Plug 'preservim/nerdtree'
<code>Plug 'https://github.com/preservim/nerdtree'</code>
<code>Plug 'nerdtree'</code>
<code>set NERDTree</code>
</details>
Original plugin: vim-paragraph-motion.
Normally the { and } motions only match completely empty lines. With this plugin lines that only contain whitespace are also matched.
Add the following command to ~/.ideavimrc: Plug 'dbakker/vim-paragraph-motion'
<code>Plug 'https://github.com/dbakker/vim-paragraph-motion'</code>
<code>Plug 'vim-paragraph-motion'</code>
<code>Plug 'https://github.com/vim-scripts/Improved-paragraph-motion'</code>
<code>Plug 'vim-scripts/Improved-paragraph-motion'</code>
<code>Plug 'Improved-paragraph-motion'</code>
<code>set vim-paragraph-motion</code>
</details>
https://github.com/dbakker/vim-paragraph-motion#vim-paragraph-motion
</details> <details> <summary><h2>Peekaboo: Extends " @ CTRL-r to show a popup of the register contents</h2></summary>By Julien Phalip
Original plugin: vim-peekaboo.
Peekaboo extends " and @ in normal mode and <CTRL-R> in insert mode so you can see the contents of the registers.
Add set peekaboo to your ~/.ideavimrc file, then run :source ~/.ideavimrc
or restart the IDE.
https://plugins.jetbrains.com/plugin/25776-vim-peekaboo
</details> <details> <summary><h2>quick-scope: Always-on highlight for a unique character in every word on a line to help use f, F, etc.</h2></summary>Original plugin: quick-scope.
An always-on highlight for a unique character in every word on a line to help you use f, F, and family.
This plugin should help you get to any word on a line in two or three keystrokes with Vim's built-in f<char> (which moves your cursor to <char>).
~/.ideavimrc: set quickscopehttps://plugins.jetbrains.com/plugin/19417-ideavim-quickscope
</details> <details> <summary><h2>ReplaceWithRegister: Adds two-in-one command that replaces text with the contents of a register.</h2></summary>By igrekster
Original plugin: ReplaceWithRegister.
This plugin offers a two-in-one command that replaces text covered by a {motion}, entire line(s) or the current selection with the contents of a register; the old text is deleted into the black-hole register, i.e. it's gone. (But of course, the command can be easily undone.)
Add the following command to ~/.ideavimrc: Plug 'vim-scripts/ReplaceWithRegister'
<code>Plug 'ReplaceWithRegister'</code>
<code>Plug 'https://github.com/inkarkat/vim-ReplaceWithRegister'</code>
<code>Plug 'inkarkat/vim-ReplaceWithRegister'</code>
<code>Plug 'vim-ReplaceWithRegister'</code>
<code>Plug 'https://www.vim.org/scripts/script.php?script_id=2703'</code>
<code>set ReplaceWithRegister</code>
</details>
https://github.com/vim-scripts/ReplaceWithRegister/blob/master/doc/ReplaceWithRegister.txt
</details> <details> <summary><h2>sneak: Jump to any location specified by two characters</h2></summary>By Mikhail Levchenko
Original repository with the plugin: https://github.com/Mishkun/ideavim-sneak
Original plugin: vim-sneak.
Jump to any location specified by two characters.
~/.ideavimrc: Plug 'justinmk/vim-sneak's and two chars to start sneaking in forward directionS and two chars to start sneaking in backward direction; or , to proceed with sneaking just as if you were using f or t commandsOriginal plugin: vim-surround.
Surround.vim is all about "surroundings": parentheses, brackets, quotes, XML tags, and more. The plugin provides mappings to easily delete, change, and add such surroundings in pairs.
Add the following command to ~/.ideavimrc: Plug 'tpope/vim-surround'
<code>Plug 'https://www.vim.org/scripts/script.php?script_id=1697'</code>
<code>Plug 'vim-surround'</code>
<code>set surround</code>
</details>
https://github.com/tpope/vim-surround/blob/master/doc/surround.txt
</details> <details> <summary><h2>Switch: Switch some text under the cursor based on regex patterns</h2></summary>By Julien Phalip
Original plugin: switch.vim.
The purpose of the plugin is to switch some text under the cursor based on regex patterns. The main entry point is a single command, :Switch. When the command is executed, the plugin looks for one of a few specific patterns under the cursor and performs a substitution depending on it.
Add set switch to your ~/.ideavimrc file, then run :source ~/.ideavimrc
or restart the IDE.
https://plugins.jetbrains.com/plugin/25899-vim-switch
</details> <details> <summary><h2>textobj-entire: Adds mapping for selecting entire contents of file regardless of cursor position</h2></summary>By Alexandre Grison
Original plugin: vim-textobj-entire.
vim-textobj-entire is a Vim plugin to provide text objects (ae and ie by default) to select the entire content of a buffer. Though these are trivial operations (e.g. ggVG), text object versions are more handy, because you do not have to be conscious of the cursor position (e.g. vae).
Add the following command to ~/.ideavimrc: Plug 'kana/vim-textobj-entire'
<code>Plug 'vim-textobj-entire'</code>
<code>Plug 'https://www.vim.org/scripts/script.php?script_id=2610'</code>
<code>set textobj-entire</code>
</details>
https://github.com/kana/vim-textobj-entire/blob/master/doc/textobj-entire.txt
</details> <details> <summary><h2>VimEverywhere: Keyboard-driven IDE navigation outside the editor</h2></summary>Brings vim-style keyboard navigation to the rest of the IDE. Enabling VimEverywhere turns on three
behaviors:
Ctrl+Shift+\ (Ctrl+Cmd+\ on macOS) to display hint labels over
interactive UI components — buttons, tool window tabs, tree nodes, text fields, scroll panes, and
so on. Type the letters next to a target to focus or click it without touching the mouse.o, t, T, s, i,
go, gs, gi) work in any focused tree, not just the Project tool window.~/.ideavimrc: set VimEverywherePress Ctrl+Shift+\ (Ctrl+Cmd+\ on macOS) to toggle the hints overlay. Type the letters shown
next to a target to activate it, or press Esc to dismiss the overlay without activating anything.
NERDTree-style and window-nav mappings are active automatically whenever the corresponding
component has focus.
Original plugin: vim-which-key.
vim-which-key is vim port of emacs-which-key that displays available keybindings in popup.
~/.ideavimrc: set which-keyhttps://github.com/TheBlob42/idea-which-key?tab=readme-ov-file#installation
</details>