mirror of
https://github.com/chylex/IntelliJ-IdeaVim.git
synced 2026-09-25 21:19:25 +02:00
Allow to disbale char-ise block comments. Original plugin doesn't support comment part of line. Here we add `commentary_block_comments` variable to allow to disable it
1265 lines
46 KiB
Markdown
1265 lines
46 KiB
Markdown
IdeaVim Plugins
|
|
--------------------
|
|
|
|
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](https://github.com/junegunn/vim-plug) or [vundle](https://github.com/VundleVim/Vundle.vim).
|
|
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>abolish: Case-aware substitute and coercion mappings between case styles</h2></summary>
|
|
|
|
Original plugin: [vim-abolish](https://github.com/tpope/vim-abolish).
|
|
|
|
### Summary:
|
|
Coercion mappings (`crs`/`cr_`, `crm`/`crp`, `crc`, `cru`/`crU`, `cr-`/`crk`, `cr.`, `cr<Space>`, `crt`)
|
|
recase the word under the cursor between snake_case, MixedCase, camelCase, UPPER_SNAKE, kebab-case,
|
|
dot.case, space case and Title Case. `:Subvert` (alias `:S`) is a case-aware `:substitute` that
|
|
handles all case variants and `{a,b,c}` brace alternatives in a single command. With only a pattern
|
|
(`:S/foo/` or `:S?foo?`) it does a case-aware forward or backward search instead.
|
|
|
|
### Setup:
|
|
- Add the following command to `~/.ideavimrc`: `Plug 'tpope/vim-abolish'`
|
|
<details>
|
|
<summary>Alternative syntax</summary>
|
|
<code>Plugin 'tpope/vim-abolish'</code>
|
|
<br/>
|
|
<code>Plug 'https://github.com/tpope/vim-abolish'</code>
|
|
<br/>
|
|
<code>Plug 'vim-abolish'</code>
|
|
<br/>
|
|
<code>set abolish</code>
|
|
</details>
|
|
|
|
### Instructions
|
|
|
|
https://github.com/tpope/vim-abolish/blob/master/doc/abolish.txt
|
|
|
|
`:Abolish` (insert-mode auto-correcting abbreviations) is not supported.
|
|
|
|
By default each `cr<x>` mapping recases the inner word under the cursor.
|
|
To get tpope-style motion support (`crsiw`, `crsap`, `crs2w`, …) remap to the
|
|
per-style operator `<Plug>` mappings:
|
|
|
|
```
|
|
nmap crs <Plug>(abolish-coerce-snake)
|
|
nmap crm <Plug>(abolish-coerce-pascal)
|
|
nmap crc <Plug>(abolish-coerce-camel)
|
|
nmap cru <Plug>(abolish-coerce-upper_snake)
|
|
nmap cr- <Plug>(abolish-coerce-kebab)
|
|
nmap cr. <Plug>(abolish-coerce-dot)
|
|
nmap cr<Space> <Plug>(abolish-coerce-space)
|
|
nmap crt <Plug>(abolish-coerce-title)
|
|
```
|
|
|
|
To bind extra trigger characters, set `g:abolish_coercions` *before* enabling
|
|
the plugin. Each entry maps a single character to the name of a built-in case
|
|
style (case-insensitive: `snake`, `pascal`, `camel`, `upper_snake`, `kebab`,
|
|
`dot`, `space`, `title`).
|
|
|
|
```
|
|
let g:abolish_coercions = {'q': 'kebab', 'x': 'upper_snake'}
|
|
```
|
|
|
|
After this, `crq` recases to kebab-case and `crx` to UPPER_SNAKE.
|
|
|
|
</details>
|
|
|
|
<details>
|
|
<summary><h2>anyobject: Useful text objects like functions, arguments, classes, loops, list items, block comments, and more.</h2></summary>
|
|
|
|
### 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
|
|
|
|
### Setup
|
|
|
|
- Install [Vim AnyObject](https://plugins.jetbrains.com/plugin/28333-vim-anyobject)
|
|
- Add `set anyobject` to your `~/.ideavimrc` file, then run `:source ~/.ideavimrc`
|
|
or restart the IDE.
|
|
|
|
### Instructions
|
|
|
|
[https://plugins.jetbrains.com/plugin/28333-vim-anyobject](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](https://www.vim.org/scripts/script.php?script_id=2699).
|
|
|
|
### Summary:
|
|
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.
|
|
|
|
### Setup:
|
|
- Add the following command to `~/.ideavimrc`: `Plug 'vim-scripts/argtextobj.vim'`
|
|
<details>
|
|
<summary>Alternative syntax</summary>
|
|
<code>Plugin 'vim-scripts/argtextobj.vim'</code>
|
|
<br/>
|
|
<code>Plug 'https://github.com/vim-scripts/argtextobj.vim'</code>
|
|
<br/>
|
|
<code>Plug 'argtextobj.vim'</code>
|
|
<br/>
|
|
<code>Plug 'https://www.vim.org/scripts/script.php?script_id=2699'</code>
|
|
<br/>
|
|
<code>set argtextobj</code>
|
|
</details>
|
|
|
|
### Instructions
|
|
|
|
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>CamelCaseMotion: Motions through CamelCase and snake_case words</h2></summary>
|
|
|
|
Original plugin: [CamelCaseMotion](https://github.com/bkad/CamelCaseMotion).
|
|
|
|
### Summary:
|
|
Adds `w`, `b`, `e`, `ge` style motions and `iw`/`ib`/`ie`/`ige` inner "word" text objects that move
|
|
and select by sub-word boundaries — uppercase letters in `CamelCase` and `_`/`-` delimiters in
|
|
`snake_case`/`kebab-case` — instead of whole words. For example, with the leader as the key,
|
|
`<leader>w` jumps `Camel|CaseWord` → `Camel[C]aseWord`, and `ci<leader>w` changes a single chunk of
|
|
an identifier. The motions honour `[count]`, work in normal, visual and operator-pending modes, and
|
|
respect the `'iskeyword'` option.
|
|
|
|
### Setup:
|
|
- Add the following command to `~/.ideavimrc`: `Plug 'bkad/CamelCaseMotion'`
|
|
<details>
|
|
<summary>Alternative syntax</summary>
|
|
<code>Plugin 'bkad/CamelCaseMotion'</code>
|
|
<br/>
|
|
<code>Plug 'https://github.com/bkad/CamelCaseMotion'</code>
|
|
<br/>
|
|
<code>Plug 'CamelCaseMotion'</code>
|
|
<br/>
|
|
<code>set CamelCaseMotion</code>
|
|
</details>
|
|
- No mappings are created until you choose a key. The most common setup is to add this to your
|
|
`~/.ideavimrc` (before the `Plug`/`set` line):
|
|
|
|
```
|
|
let g:camelcasemotion_key = '<leader>'
|
|
```
|
|
|
|
which creates `<leader>w`, `<leader>b`, `<leader>e`, `<leader>ge` and the inner objects
|
|
`i<leader>w`, `i<leader>b`, `i<leader>e`, `i<leader>ge`.
|
|
|
|
### Instructions
|
|
|
|
https://github.com/bkad/CamelCaseMotion/blob/master/README.markdown
|
|
|
|
With `g:camelcasemotion_key` set to `<leader>` (the default leader is `\`):
|
|
|
|
| Mapping | Description |
|
|
|---------|-------------|
|
|
| `<leader>w` | Move forward to the next start of a sub-word |
|
|
| `<leader>b` | Move backward to the previous start of a sub-word |
|
|
| `<leader>e` | Move forward to the next end of a sub-word |
|
|
| `<leader>ge` | Move backward to the previous end of a sub-word |
|
|
| `i<leader>w` | Inner sub-word (e.g. `ci<leader>w`, `vi<leader>w`) |
|
|
| `i<leader>b` | Inner sub-word, extends backward with a count |
|
|
| `i<leader>e` | Inner sub-word, excludes a trailing delimiter |
|
|
| `i<leader>ge` | Inner sub-word, backward to the previous word end |
|
|
|
|
Instead of (or in addition to) `g:camelcasemotion_key`, you can map the motion `<Plug>` targets
|
|
directly, for example to replace the built-in `w`/`b`/`e`:
|
|
|
|
```
|
|
map <silent> w <Plug>CamelCaseMotion_w
|
|
map <silent> b <Plug>CamelCaseMotion_b
|
|
map <silent> e <Plug>CamelCaseMotion_e
|
|
map <silent> ge <Plug>CamelCaseMotion_ge
|
|
```
|
|
|
|
</details>
|
|
|
|
<details>
|
|
<summary><h2>classtextobj: Provides a text object for class definitions</h2></summary>
|
|
|
|
### Summary:
|
|
Adds the `ac` text object that selects "a class definition" — the entire class declaration and body. Works in any language whose PSI tree provides a class element (Java, Kotlin, Python, JavaScript/TypeScript, Go, Dart, PHP, Ruby, Rust).
|
|
|
|
### Setup:
|
|
- Add the following command to `~/.ideavimrc`: `set classtextobj`
|
|
|
|
### Instructions
|
|
|
|
| Mapping | Description |
|
|
|---------|-------------|
|
|
| `ac` | A class definition (e.g. `vac`, `dac`, `cac`, `yac`) |
|
|
|
|
When classes are nested, the innermost enclosing class is selected.
|
|
|
|
</details>
|
|
|
|
<details>
|
|
<summary><h2>commentary: Adds mapping for quickly commenting stuff out</h2></summary>
|
|
|
|
By [Daniel Leong](https://github.com/dhleong)
|
|
Original plugin: [commentary.vim](https://github.com/tpope/vim-commentary).
|
|
|
|
### Summary:
|
|
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.
|
|
|
|
### Setup:
|
|
- Add the following command to `~/.ideavimrc`: `Plug 'tpope/vim-commentary'`
|
|
<details>
|
|
<summary>Alternative syntax</summary>
|
|
<code>Plugin 'tpope/vim-commentary'</code>
|
|
<br/>
|
|
<code>Plug 'https://github.com/tpope/vim-commentary'</code>
|
|
<br/>
|
|
<code>Plug 'vim-commentary'</code>
|
|
<br/>
|
|
<code>Plug 'tcomment_vim'</code>
|
|
<br/>
|
|
<code>set commentary</code>
|
|
</details>
|
|
|
|
### Instructions
|
|
|
|
https://github.com/tpope/vim-commentary/blob/master/doc/commentary.txt
|
|
|
|
Unlike vim-commentary, IdeaVim uses a block comment when the range is not linewise, so `gciw` can
|
|
comment out a single argument. Set `let g:commentary_block_comments = 0` to always comment whole lines.
|
|
|
|
</details>
|
|
|
|
<details>
|
|
<summary><h2>dial: Advanced text increment and decrement functionality.</h2></summary>
|
|
|
|
### 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
|
|
|
|
### Setup
|
|
|
|
- Install [Vim Dial](https://plugins.jetbrains.com/plugin/28237-vim-dial)
|
|
- Add `set dial` to your `~/.ideavimrc` file, then run `:source ~/.ideavimrc`
|
|
or restart the IDE.
|
|
|
|
### Instructions
|
|
|
|
[https://plugins.jetbrains.com/plugin/28237-vim-dial](https://plugins.jetbrains.com/plugin/28237-vim-dial)
|
|
</details>
|
|
|
|
|
|
<details>
|
|
<summary><h2>easymotion: Simplifies some motions</h2></summary>
|
|
|
|
Original plugin: [vim-easymotion](https://github.com/easymotion/vim-easymotion).
|
|
|
|
### Summary:
|
|
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.
|
|
|
|
### Setup:
|
|
- Install [IdeaVim-EasyMotion](https://plugins.jetbrains.com/plugin/13360-ideavim-easymotion/)
|
|
and [AceJump](https://plugins.jetbrains.com/plugin/7086-acejump/) plugins.
|
|
- Add the following command to `~/.ideavimrc`: `Plug 'easymotion/vim-easymotion'`
|
|
<details>
|
|
<summary>Alternative syntax</summary>
|
|
<code>Plugin 'easymotion/vim-easymotion'</code>
|
|
<br/>
|
|
<code>Plug 'https://github.com/easymotion/vim-easymotion'</code>
|
|
<br/>
|
|
<code>Plug 'vim-easymotion'</code>
|
|
<br/>
|
|
<code>set easymotion</code>
|
|
</details>
|
|
|
|
### Instructions
|
|
|
|
All commands with the mappings are supported. See the [full list of supported commands](https://github.com/AlexPl292/IdeaVim-EasyMotion#supported-commands).
|
|
|
|
</details>
|
|
|
|
<details>
|
|
<summary><h2>exchange: Easy text exchange operator</h2></summary>
|
|
|
|
By [fan-tom](https://github.com/fan-tom)
|
|
Original plugin: [vim-exchange](https://github.com/tommcdo/vim-exchange).
|
|
|
|
### Summary:
|
|
Easy text exchange operator for Vim.
|
|
|
|
### Setup:
|
|
- Add the following command to `~/.ideavimrc`: `Plug 'tommcdo/vim-exchange'`
|
|
<details>
|
|
<summary>Alternative syntax</summary>
|
|
<code>Plugin 'tommcdo/vim-exchange'</code>
|
|
<br/>
|
|
<code>Plug 'https://github.com/tommcdo/vim-exchange'</code>
|
|
<br/>
|
|
<code>Plug 'vim-exchange'</code>
|
|
<br/>
|
|
<code>set exchange</code>
|
|
</details>
|
|
|
|
### Instructions
|
|
|
|
https://github.com/tommcdo/vim-exchange/blob/master/doc/exchange.txt
|
|
|
|
</details>
|
|
|
|
<details>
|
|
<summary><h2>functextobj: Provides text objects for method/function definitions</h2></summary>
|
|
|
|
Inspired by [vim-textobj-function](https://github.com/kana/vim-textobj-function).
|
|
|
|
### Summary:
|
|
Adds text objects for selecting methods/functions. Three variants distinguish what is included: the signature and body, the same with JavaDoc and annotations, or just the inner body content. Works in any language whose PSI tree provides a function/method element (Java, Kotlin, Python, JavaScript/TypeScript, Go, Dart, PHP, Ruby, Rust).
|
|
|
|
### Setup:
|
|
- Add the following command to `~/.ideavimrc`: `set functextobj`
|
|
<details>
|
|
<summary>Alternative syntax</summary>
|
|
<code>Plug 'kana/vim-textobj-function'</code>
|
|
<br/>
|
|
<code>Plug 'vim-textobj-function'</code>
|
|
</details>
|
|
|
|
### Instructions
|
|
|
|
| Mapping | Description |
|
|
|---------|-------------|
|
|
| `am` | A method definition (signature + body, excluding JavaDoc and annotations) |
|
|
| `aM` | A Method definition (same as `am`, but including JavaDoc and annotations) |
|
|
| `im` | Inner method definition (only the contents between the body braces) |
|
|
|
|
Use with operators (`d`, `c`, `y`) or in visual mode — e.g. `dam`, `cim`, `vaM`. When methods are nested, the innermost enclosing method is selected.
|
|
|
|
</details>
|
|
|
|
<details>
|
|
<summary><h2>FunctionTextObj: Adds text objects for manipulating functions/methods</h2></summary>
|
|
|
|
By Julien Phalip
|
|
|
|
### Summary:
|
|
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
|
|
|
|
### Setup
|
|
|
|
Add `set functiontextobj` to your `~/.ideavimrc` file, then run `:source ~/.ideavimrc`
|
|
or restart the IDE.
|
|
|
|
### Instructions
|
|
|
|
https://plugins.jetbrains.com/plugin/25897-vim-functiontextobj
|
|
</details>
|
|
|
|
<details>
|
|
<summary><h2>highlightedyank: Highlights the yanked region</h2></summary>
|
|
|
|
By [KostkaBrukowa](https://github.com/KostkaBrukowa)
|
|
Original plugin: [vim-highlightedyank](https://github.com/machakann/vim-highlightedyank).
|
|
|
|
### Summary:
|
|
Make the yanked region apparent!
|
|
|
|
### Setup:
|
|
- Add the following command to `~/.ideavimrc`: `Plug 'machakann/vim-highlightedyank'`
|
|
<details>
|
|
<summary>Alternative syntax</summary>
|
|
<code>Plugin 'machakann/vim-highlightedyank'</code>
|
|
<br/>
|
|
<code>Plug 'https://github.com/machakann/vim-highlightedyank'</code>
|
|
<br/>
|
|
<code>Plug 'vim-highlightedyank'</code>
|
|
<br/>
|
|
<code>set highlightedyank</code>
|
|
</details>
|
|
|
|
### Instructions
|
|
|
|
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](https://github.com/sharat87)
|
|
Original plugin: [vim-indent-object](https://github.com/michaeljsmith/vim-indent-object).
|
|
|
|
### Summary:
|
|
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).
|
|
|
|
### Setup:
|
|
- Add the following command to `~/.ideavimrc`: `Plug 'michaeljsmith/vim-indent-object'`
|
|
<details>
|
|
<summary>Alternative syntax</summary>
|
|
<code>Plugin 'michaeljsmith/vim-indent-object'</code>
|
|
<br/>
|
|
<code>Plug 'https://github.com/michaeljsmith/vim-indent-object'</code>
|
|
<br/>
|
|
<code>Plug 'vim-indent-object'</code>
|
|
<br/>
|
|
<code>set textobj-indent</code>
|
|
</details>
|
|
|
|
### Instructions
|
|
|
|
https://github.com/michaeljsmith/vim-indent-object/blob/master/doc/indent-object.txt
|
|
|
|
</details>
|
|
|
|
<details>
|
|
<summary><h2>indentwise: Motions based on indentation depth and indent blocks</h2></summary>
|
|
|
|
Original plugin: [vim-indentwise](https://github.com/jeetsukumaran/vim-indentwise).
|
|
|
|
### Summary:
|
|
Adds motions that navigate by the indentation level of lines rather than by their content. You can
|
|
jump to the previous/next line of lesser, greater or equal indentation relative to the current line,
|
|
and jump to the beginning/end of the current indentation block. Blank and whitespace-only lines are
|
|
skipped, so the motions follow the visible structure of the code. The motions take a `[count]`, and
|
|
work in normal, visual and operator-pending modes (e.g. `d]-`, `v[%`). Operator-pending and visual
|
|
moves are line-wise.
|
|
|
|
### Setup:
|
|
- Add the following command to `~/.ideavimrc`: `Plug 'jeetsukumaran/vim-indentwise'`
|
|
<details>
|
|
<summary>Alternative syntax</summary>
|
|
<code>Plugin 'jeetsukumaran/vim-indentwise'</code>
|
|
<br/>
|
|
<code>Plug 'https://github.com/jeetsukumaran/vim-indentwise'</code>
|
|
<br/>
|
|
<code>Plug 'vim-indentwise'</code>
|
|
<br/>
|
|
<code>set indentwise</code>
|
|
</details>
|
|
|
|
### Instructions
|
|
|
|
https://github.com/jeetsukumaran/vim-indentwise/blob/master/doc/indentwise.txt
|
|
|
|
| Mapping | Description |
|
|
|---------|-------------|
|
|
| `[-` | Move to the previous line of **lesser** indent |
|
|
| `]-` | Move to the next line of **lesser** indent |
|
|
| `[+` | Move to the previous line of **greater** indent |
|
|
| `]+` | Move to the next line of **greater** indent |
|
|
| `[=` | Move to the previous line of **equal** indent |
|
|
| `]=` | Move to the next line of **equal** indent |
|
|
| `[%` | Move to the **beginning** of the current indent block |
|
|
| `]%` | Move to the **end** of the current indent block |
|
|
|
|
For the block-scope motions, a `[count]` repeats outward through enclosing blocks (e.g. `2[%`). The
|
|
absolute-indent motions (`[_`, `]_`) from the original plugin are not currently supported.
|
|
|
|
</details>
|
|
|
|
<details>
|
|
<summary><h2>matchit.vim: Extends the % key functionality</h2></summary>
|
|
|
|
By [Martin Yzeiri](https://github.com/myzeiri)
|
|
Original plugin: [matchit.vim](https://github.com/chrisbra/matchit).
|
|
|
|
### Summary:
|
|
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...
|
|
|
|
### Setup:
|
|
- Add the following command to `~/.ideavimrc`: `packadd matchit`
|
|
<details>
|
|
<summary>Alternative syntax</summary>
|
|
<code>Plug 'vim-matchit'</code>
|
|
<br/>
|
|
<code>Plug 'chrisbra/matchit'</code>
|
|
<br/>
|
|
<code>set matchit</code>
|
|
</details>
|
|
|
|
### Instructions
|
|
|
|
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>
|
|
|
|
### Summary:
|
|
Extend and create a/i textobjects
|
|
|
|
### Features:
|
|
Provides additional text object motions for handling quotes and brackets. The following motions are included:
|
|
|
|
- aq: Around any quotes.
|
|
- iq: Inside any quotes.
|
|
- ab: Around any parentheses, curly braces, and square brackets.
|
|
- ib: Inside any parentheses, curly braces, and square brackets.
|
|
|
|
Original plugin: [mini.ai](https://github.com/echasnovski/mini.ai).
|
|
|
|
### Setup:
|
|
- Add the following command to `~/.ideavimrc`: `set mini-ai`
|
|
|
|
</details>
|
|
|
|
<details>
|
|
<summary><h2>multiple-cursors: Extends multicursor support</h2></summary>
|
|
|
|
Original plugin: [vim-multiple-cursors](https://github.com/terryma/vim-multiple-cursors).
|
|
|
|
### Setup:
|
|
- Add the following command to `~/.ideavimrc`: `Plug 'terryma/vim-multiple-cursors'`
|
|
<details>
|
|
<summary>Alternative syntax</summary>
|
|
<code>Plugin 'terryma/vim-multiple-cursors'</code>
|
|
<br/>
|
|
<code>Plug 'https://github.com/terryma/vim-multiple-cursors'</code>
|
|
<br/>
|
|
<code>Plug 'vim-multiple-cursors'</code>
|
|
<br/>
|
|
<code>set multiple-cursors</code>
|
|
</details>
|
|
|
|
### Instructions
|
|
|
|
The default key bindings match the original terryma/vim-multiple-cursors plugin:
|
|
|
|
| Action | Shortcut |
|
|
|---------------------------------------------------|-----------|
|
|
| Start / add next occurrence (whole word) | `<C-n>` |
|
|
| Start / add next occurrence (not whole word) | `g<C-n>` |
|
|
| Select all occurrences in file (whole word) | `<A-n>` |
|
|
| Select all occurrences in file (not whole word) | `g<A-n>` |
|
|
| Skip current and select next (during selection) | `<C-x>` |
|
|
| Remove current selection (during selection) | `<C-p>` |
|
|
|
|
These map to the following `<Plug>` mappings:
|
|
|
|
```
|
|
nmap <C-n> <Plug>NextWholeOccurrence
|
|
xmap <C-n> <Plug>NextWholeOccurrence
|
|
nmap g<C-n> <Plug>NextOccurrence
|
|
xmap g<C-n> <Plug>NextOccurrence
|
|
nmap <A-n> <Plug>AllWholeOccurrences
|
|
xmap <A-n> <Plug>AllWholeOccurrences
|
|
nmap g<A-n> <Plug>AllOccurrences
|
|
xmap g<A-n> <Plug>AllOccurrences
|
|
xmap <C-x> <Plug>SkipOccurrence
|
|
xmap <C-p> <Plug>RemoveOccurrence
|
|
```
|
|
|
|
### Custom mappings
|
|
|
|
To use your own mappings instead of the defaults, set `g:multi_cursor_use_default_mapping` to `0` and bind the
|
|
`<Plug>` mappings yourself. This is also how you restore the old IdeaVim `<A-n>` based mappings:
|
|
|
|
```
|
|
let g:multi_cursor_use_default_mapping = 0
|
|
|
|
" Note that the <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. ñ
|
|
nmap <A-n> <Plug>NextWholeOccurrence
|
|
xmap <A-n> <Plug>NextWholeOccurrence
|
|
nmap g<A-n> <Plug>NextOccurrence
|
|
xmap g<A-n> <Plug>NextOccurrence
|
|
xmap <A-x> <Plug>SkipOccurrence
|
|
xmap <A-p> <Plug>RemoveOccurrence
|
|
```
|
|
|
|
</details>
|
|
|
|
<details>
|
|
<summary><h2>NERDTree: Adds NERDTree navigation to the project panel</h2></summary>
|
|
|
|
Original plugin: [NERDTree](https://github.com/preservim/nerdtree).
|
|
|
|
### Summary:
|
|
Adds NERDTree navigation to the project panel.
|
|
|
|
### Setup:
|
|
- Add the following command to `~/.ideavimrc`: `Plug 'preservim/nerdtree'`
|
|
<details>
|
|
<summary>Alternative syntax</summary>
|
|
<code>Plugin 'preservim/nerdtree'</code>
|
|
<br/>
|
|
<code>Plug 'https://github.com/preservim/nerdtree'</code>
|
|
<br/>
|
|
<code>Plug 'nerdtree'</code>
|
|
<br/>
|
|
<code>set NERDTree</code>
|
|
</details>
|
|
|
|
### Instructions
|
|
|
|
[See here](NERDTree-support.md).
|
|
|
|
</details>
|
|
|
|
<details>
|
|
<summary><h2>paragraph-motion: Extends the { and } motions to ignore whitespace on otherwise empty lines</h2></summary>
|
|
|
|
Original plugin: [vim-paragraph-motion](https://github.com/dbakker/vim-paragraph-motion).
|
|
|
|
### Summary:
|
|
Normally the { and } motions only match completely empty lines.
|
|
With this plugin lines that only contain whitespace are also matched.
|
|
|
|
### Setup:
|
|
- Add the following command to `~/.ideavimrc`: `Plug 'dbakker/vim-paragraph-motion'`
|
|
<details>
|
|
<summary>Alternative syntax</summary>
|
|
<code>Plugin 'dbakker/vim-paragraph-motion'</code>
|
|
<br/>
|
|
<code>Plug 'https://github.com/dbakker/vim-paragraph-motion'</code>
|
|
<br/>
|
|
<code>Plug 'vim-paragraph-motion'</code>
|
|
<br/>
|
|
<code>Plug 'https://github.com/vim-scripts/Improved-paragraph-motion'</code>
|
|
<br/>
|
|
<code>Plug 'vim-scripts/Improved-paragraph-motion'</code>
|
|
<br/>
|
|
<code>Plug 'Improved-paragraph-motion'</code>
|
|
<br/>
|
|
<code>set vim-paragraph-motion</code>
|
|
</details>
|
|
|
|
### Instructions
|
|
|
|
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](https://github.com/junegunn/vim-peekaboo).
|
|
|
|
### Summary:
|
|
Peekaboo extends " and @ in normal mode and <CTRL-R> in insert mode so you can see the contents of the registers.
|
|
|
|
### Setup
|
|
|
|
Add `set peekaboo` to your `~/.ideavimrc` file, then run `:source ~/.ideavimrc`
|
|
or restart the IDE.
|
|
|
|
### Instructions
|
|
|
|
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](https://github.com/unblevable/quick-scope).
|
|
|
|
### Summary:
|
|
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>).
|
|
|
|
### Setup:
|
|
- Install [IdeaVim-Quickscope](https://plugins.jetbrains.com/plugin/19417-ideavim-quickscope) plugin.
|
|
- Add the following command to `~/.ideavimrc`: `set quickscope`
|
|
|
|
### Instructions
|
|
|
|
https://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](https://github.com/igrekster)
|
|
Original plugin: [ReplaceWithRegister](https://github.com/vim-scripts/ReplaceWithRegister).
|
|
|
|
### Summary:
|
|
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.)
|
|
|
|
### Setup:
|
|
- Add the following command to `~/.ideavimrc`: `Plug 'vim-scripts/ReplaceWithRegister'`
|
|
<details>
|
|
<summary>Alternative syntax</summary>
|
|
<code>Plugin 'vim-scripts/ReplaceWithRegister'</code>
|
|
<br/>
|
|
<code>Plug 'ReplaceWithRegister'</code>
|
|
<br/>
|
|
<code>Plug 'https://github.com/inkarkat/vim-ReplaceWithRegister'</code>
|
|
<br/>
|
|
<code>Plug 'inkarkat/vim-ReplaceWithRegister'</code>
|
|
<br/>
|
|
<code>Plug 'vim-ReplaceWithRegister'</code>
|
|
<br/>
|
|
<code>Plug 'https://www.vim.org/scripts/script.php?script_id=2703'</code>
|
|
<br/>
|
|
<code>set ReplaceWithRegister</code>
|
|
</details>
|
|
|
|
### Instructions
|
|
|
|
https://github.com/vim-scripts/ReplaceWithRegister/blob/master/doc/ReplaceWithRegister.txt
|
|
|
|
</details>
|
|
|
|
<details>
|
|
<summary><h2>signature: Shows the local marks in the gutter and adds mark commands</h2></summary>
|
|
|
|
Original plugin: [vim-signature](https://github.com/kshenoy/vim-signature).
|
|
|
|
### Summary:
|
|
Draws a gutter icon for every local mark `a`-`z` of the file, so you can see where your marks are
|
|
instead of having to remember, and adds commands to place, clear and walk through them. Global marks
|
|
`A`-`Z` are not drawn: with the default `ideamarks` they are IDE bookmarks, which the IDE already
|
|
shows in the gutter itself.
|
|
|
|
### Setup:
|
|
- Add the following command to `~/.ideavimrc`: `Plug 'kshenoy/vim-signature'`
|
|
<details>
|
|
<summary>Alternative syntax</summary>
|
|
<code>Plug 'https://github.com/kshenoy/vim-signature'</code>
|
|
<br/>
|
|
<code>Plug 'vim-signature'</code>
|
|
<br/>
|
|
<code>set signature</code>
|
|
</details>
|
|
|
|
### Instructions
|
|
|
|
| Mapping | Description |
|
|
|------------|-------------------------------------------------------------------|
|
|
| `m,` | Place the next available mark |
|
|
| `m-` | Delete all marks of the current line |
|
|
| `m<Space>` | Delete all marks of the current buffer |
|
|
| `]'` | To the next line holding a mark, on its first non-blank |
|
|
| `['` | To the previous line holding a mark, on its first non-blank |
|
|
| `']` | To the next mark by letter, on the first non-blank of its line |
|
|
| `'[` | To the previous mark by letter, on the first non-blank of its line |
|
|
| `` `] `` | To the next mark by letter, on its exact position |
|
|
| `` `[ `` | To the previous mark by letter, on its exact position |
|
|
|
|
All of them take a count, and jumping to a mark is a jump, so `''` and `<C-O>` bring you back.
|
|
|
|
Note that `']`, `'[`, `` `] `` and `` `[ `` stop being Vim's marks of the last change or yank, as with
|
|
the original plugin. Every key above is a mapping to a `<Plug>(Signature*)` name, so to keep a key,
|
|
map your own in `~/.ideavimrc`, which suppresses the default:
|
|
|
|
```
|
|
nmap <Leader>m <Plug>(SignaturePlaceNextMark)
|
|
nmap gn <Plug>(SignatureGotoNextSpotAlpha)
|
|
```
|
|
|
|
Unlike the original, `` ]` `` and `` [` `` are left alone: IdeaVim implements them itself as real
|
|
motions, with a count and with Vim's behaviour of stopping rather than wrapping at the last mark.
|
|
|
|
Not implemented yet: `m.`, `dm{mark}`, the markers (`m<BS>`, `]-`, `[-`, `]=`, `[=`), the `m/` and
|
|
`m?` listings, and the `g:Signature*` options.
|
|
|
|
https://github.com/kshenoy/vim-signature/blob/master/doc/signature.txt
|
|
|
|
</details>
|
|
|
|
<details>
|
|
<summary><h2>sneak: Jump to any location specified by two characters</h2></summary>
|
|
|
|
<img src="images/sneakIcon.svg" width="80" height="80" alt="icon"/>
|
|
|
|
By [Mikhail Levchenko](https://github.com/Mishkun)
|
|
Original repository with the plugin: https://github.com/Mishkun/ideavim-sneak
|
|
Original plugin: [vim-sneak](https://github.com/justinmk/vim-sneak).
|
|
|
|
### Summary:
|
|
Jump to any location specified by two characters.
|
|
|
|
### Setup:
|
|
- Add the following command to `~/.ideavimrc`: `Plug 'justinmk/vim-sneak'`
|
|
|
|
### Instructions
|
|
|
|
* Type `s` and two chars to start sneaking in forward direction
|
|
* Type `S` and two chars to start sneaking in backward direction
|
|
* Type `;` or `,` to proceed with sneaking just as if you were using `f` or `t` commands
|
|
|
|
</details>
|
|
|
|
<details>
|
|
<summary><h2>surround: Adds provides mappings to easily delete, change, and add surroundings in pairs</h2></summary>
|
|
|
|
Original plugin: [vim-surround](https://github.com/tpope/vim-surround).
|
|
|
|
### Summary:
|
|
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.
|
|
|
|
### Setup:
|
|
- Add the following command to `~/.ideavimrc`: `Plug 'tpope/vim-surround'`
|
|
<details>
|
|
<summary>Alternative syntax</summary>
|
|
<code>Plugin 'tpope/vim-surround'</code>
|
|
<br/>
|
|
<code>Plug 'https://www.vim.org/scripts/script.php?script_id=1697'</code>
|
|
<br/>
|
|
<code>Plug 'vim-surround'</code>
|
|
<br/>
|
|
<code>set surround</code>
|
|
</details>
|
|
|
|
### Instructions
|
|
|
|
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](https://github.com/AndrewRadev/switch.vim).
|
|
|
|
### Summary:
|
|
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.
|
|
|
|
### Setup
|
|
|
|
Add `set switch` to your `~/.ideavimrc` file, then run `:source ~/.ideavimrc`
|
|
or restart the IDE.
|
|
|
|
### Instructions
|
|
|
|
https://plugins.jetbrains.com/plugin/25899-vim-switch
|
|
|
|
</details>
|
|
|
|
<details>
|
|
<summary><h2>targets: Adds many seeking text objects for pairs, quotes, separators, arguments and tags</h2></summary>
|
|
|
|
Original plugin: [targets.vim](https://github.com/wellle/targets.vim).
|
|
|
|
### Summary:
|
|
Targets.vim expands on the built-in text objects (`di(`, `ci"`, …) to give you more targets to
|
|
operate on and the ability to reach them without moving the cursor there first. It adds text objects
|
|
for pairs (`( ) { } [ ] < >`, plus `b` for "any block"), quotes (`' " \``, plus `q` for "any quote"),
|
|
separators (`, . ; : + - = ~ _ * # / | \ & $`), arguments (`a`) and tags (`t`), each available with
|
|
four modifiers and the `n`/`l` next/last qualifiers:
|
|
|
|
- `i` — inside the object (e.g. `ci(`)
|
|
- `a` — a whole object, including its delimiters (e.g. `da,` deletes one list item and a separator)
|
|
- `I` — inside, excluding surrounding whitespace
|
|
- `A` — around, including adjacent whitespace
|
|
- `in`/`il` (and `an`, `In`, `Al`, …) — operate on the next / last object without moving there, e.g.
|
|
`cin)` changes inside the next parentheses; a `[count]` skips further (`c2in)`).
|
|
|
|
When the cursor is not inside an object, the plain commands seek to the nearest one. Quotes are
|
|
paired by counting from the start of the line, so `ci"` skips the gap between two strings and changes
|
|
the real one. Re-issuing a text object in visual mode grows the selection outward (`vi(i(`).
|
|
|
|
### Setup:
|
|
- Add the following command to `~/.ideavimrc`: `Plug 'wellle/targets.vim'`
|
|
<details>
|
|
<summary>Alternative syntax</summary>
|
|
<code>Plugin 'wellle/targets.vim'</code>
|
|
<br/>
|
|
<code>Plug 'https://github.com/wellle/targets.vim'</code>
|
|
<br/>
|
|
<code>Plug 'targets.vim'</code>
|
|
<br/>
|
|
<code>set targets</code>
|
|
</details>
|
|
|
|
### Instructions
|
|
|
|
https://github.com/wellle/targets.vim/blob/master/README.md
|
|
(see also the [cheat sheet](https://github.com/wellle/targets.vim/blob/master/cheatsheet.md)).
|
|
|
|
The settings (`g:targets_aiAI`, `g:targets_nl`, `g:targets_seekRanges`, `targets#mappings#extend`, …)
|
|
and forced motions (`dVi-`, `d<C-V>i-`) are not currently supported.
|
|
|
|
</details>
|
|
|
|
<details>
|
|
<summary><h2>textobj-entire: Adds mapping for selecting entire contents of file regardless of cursor position</h2></summary>
|
|
|
|
By [Alexandre Grison](https://github.com/agrison)
|
|
Original plugin: [vim-textobj-entire](https://github.com/kana/vim-textobj-entire).
|
|
|
|
### Summary:
|
|
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).
|
|
|
|
### Setup:
|
|
- Add the following command to `~/.ideavimrc`: `Plug 'kana/vim-textobj-entire'`
|
|
<details>
|
|
<summary>Alternative syntax</summary>
|
|
<code>Plugin 'kana/vim-textobj-entire'</code>
|
|
<br/>
|
|
<code>Plug 'vim-textobj-entire'</code>
|
|
<br/>
|
|
<code>Plug 'https://www.vim.org/scripts/script.php?script_id=2610'</code>
|
|
<br/>
|
|
<code>set textobj-entire</code>
|
|
</details>
|
|
|
|
### Instructions
|
|
|
|
https://github.com/kana/vim-textobj-entire/blob/master/doc/textobj-entire.txt
|
|
|
|
</details>
|
|
|
|
<details>
|
|
<summary><h2>textobj-line: Adds text objects for selecting the current line</h2></summary>
|
|
|
|
Original plugin: [vim-textobj-line](https://github.com/kana/vim-textobj-line).
|
|
|
|
### Summary:
|
|
vim-textobj-line provides two text objects for the current line:
|
|
|
|
- `al` selects all characters in the current line, without the end of line character. Same as `0v$h`.
|
|
- `il` selects the same, but without the leading and trailing whitespace. Same as `^vg_`.
|
|
|
|
For example, with the line ` foo bar baz ` (where `_` would be spaces), `dil` deletes `foo bar baz`
|
|
and keeps the surrounding whitespace, while `dal` deletes the whole line content and leaves an empty line.
|
|
|
|
Nothing is selected on an empty line, and `il` also selects nothing on a line that contains whitespace
|
|
only, because there is no text to select in the current line.
|
|
|
|
### Setup:
|
|
- Add the following command to `~/.ideavimrc`: `Plug 'kana/vim-textobj-line'`
|
|
<details>
|
|
<summary>Alternative syntax</summary>
|
|
<code>Plugin 'kana/vim-textobj-line'</code>
|
|
<br/>
|
|
<code>Plug 'https://github.com/kana/vim-textobj-line'</code>
|
|
<br/>
|
|
<code>Plug 'vim-textobj-line'</code>
|
|
<br/>
|
|
<code>set textobj-line</code>
|
|
</details>
|
|
|
|
To skip the default `al` and `il` mappings, set `g:textobj_line_no_default_key_mappings` before the
|
|
plugin is enabled, and map the `<Plug>` mappings yourself:
|
|
|
|
```
|
|
let g:textobj_line_no_default_key_mappings = 1
|
|
xmap aL <Plug>(textobj-line-al)
|
|
omap aL <Plug>(textobj-line-al)
|
|
xmap iL <Plug>(textobj-line-il)
|
|
omap iL <Plug>(textobj-line-il)
|
|
```
|
|
|
|
### Instructions
|
|
|
|
https://github.com/kana/vim-textobj-line/blob/master/doc/textobj-line.txt
|
|
|
|
</details>
|
|
|
|
<details>
|
|
<summary><h2>textobj-user: Framework for defining your own text objects</h2></summary>
|
|
|
|
Original plugin: [vim-textobj-user](https://github.com/kana/vim-textobj-user).
|
|
|
|
### Summary:
|
|
A framework that lets you declaratively define your own text objects from your `~/.ideavimrc`, without
|
|
writing any plugin code. You describe each object with a Vim pattern and the keys that should select
|
|
it, and `textobj-user` creates the mappings for you. For example, define `ad`/`id` to select an
|
|
ISO date such as `2013-03-16`:
|
|
|
|
```
|
|
call textobj#user#plugin('datetime', {
|
|
\ 'date': {
|
|
\ 'pattern': '\<\d\d\d\d-\d\d-\d\d\>',
|
|
\ 'select': ['ad', 'id'],
|
|
\ },
|
|
\ })
|
|
```
|
|
|
|
After this, `dad` deletes the date under (or ahead of) the cursor, `vad` selects it, and so on.
|
|
|
|
### Setup:
|
|
- Add the following command to `~/.ideavimrc`: `Plug 'kana/vim-textobj-user'`
|
|
<details>
|
|
<summary>Alternative syntax</summary>
|
|
<code>Plugin 'kana/vim-textobj-user'</code>
|
|
<br/>
|
|
<code>Plug 'https://github.com/kana/vim-textobj-user'</code>
|
|
<br/>
|
|
<code>Plug 'vim-textobj-user'</code>
|
|
<br/>
|
|
<code>set textobj-user</code>
|
|
</details>
|
|
|
|
### Instructions
|
|
|
|
https://github.com/kana/vim-textobj-user/blob/master/doc/textobj-user.txt
|
|
|
|
Define text objects by calling `textobj#user#plugin({name}, {specs})`, where `{specs}` maps an object
|
|
name to a dictionary of properties. The following properties are supported:
|
|
|
|
| Property | Description |
|
|
|----------|-------------|
|
|
| `pattern` | The Vim regexp for the object. A single string selects the whole match; a `[head, tail]` pair selects the region between the two delimiter patterns. |
|
|
| `select` | Key(s) that select a single-`pattern` object (string or list of strings). |
|
|
| `select-a` | Key(s) that select "a" region of a `[head, tail]` pair — including the delimiters. |
|
|
| `select-i` | Key(s) that select the "inner" region of a `[head, tail]` pair — excluding the delimiters. |
|
|
| `region-type` | Selection type: `'v'` (charwise, the default), `'V'` (linewise) or `"\<C-v>"` (blockwise). |
|
|
| `move-n` / `move-p` | Key(s) that move the cursor to the **beginning** of the next / previous object. |
|
|
| `move-N` / `move-P` | Key(s) that move the cursor to the **end** of the next / previous object. |
|
|
|
|
Selecting objects works with operators (`d`, `c`, `y`) and in visual mode; the `move-*` mappings also
|
|
work in normal, visual and operator-pending modes.
|
|
|
|
A `[head, tail]` pair example — `aA` selects `<<…>>` including the markers, `iA` only the text between
|
|
them:
|
|
|
|
```
|
|
call textobj#user#plugin('braces', {
|
|
\ 'angle': {
|
|
\ 'pattern': ['<<', '>>'],
|
|
\ 'select-a': 'aA',
|
|
\ 'select-i': 'iA',
|
|
\ },
|
|
\ })
|
|
```
|
|
|
|
Each operation also gets a remappable `<Plug>` interface mapping named
|
|
`<Plug>(textobj-{plugin}-{object}-{operation})`, where `{operation}` is the mapping-property suffix
|
|
(`a`, `i`, `n`, `p`, `N`, `P`, or omitted for a plain `select`). For the datetime example above that
|
|
is `<Plug>(textobj-datetime-date)`, so you can choose your own keys:
|
|
|
|
```
|
|
omap gd <Plug>(textobj-datetime-date)
|
|
xmap gd <Plug>(textobj-datetime-date)
|
|
```
|
|
|
|
`textobj#user#map({name}, {specs})` binds additional keys to an already-defined plugin's `<Plug>`
|
|
names (reading only the `select` / `select-a` / `select-i` / `move-*` properties):
|
|
|
|
```
|
|
call textobj#user#map('datetime', {'date': {'select': 'gd'}})
|
|
```
|
|
|
|
The following features of the original plugin are **not** currently supported:
|
|
- `select-function`, `select-a-function`, `select-i-function` and the `move-*-function` variants
|
|
(custom objects computed by a Vim function). This also means `[count]` support, which the original
|
|
plugin only offers through such functions, is unavailable.
|
|
- The `scan` property (configurable search direction).
|
|
- Blockwise `region-type` (`"\<C-v>"`) only takes effect in visual mode; an operator (e.g. `dad`)
|
|
over a blockwise object acts charwise.
|
|
|
|
</details>
|
|
|
|
<details>
|
|
<summary><h2>VimEverywhere: Keyboard-driven IDE navigation outside the editor</h2></summary>
|
|
|
|
### Summary:
|
|
Brings vim-style keyboard navigation to the rest of the IDE. Enabling `VimEverywhere` turns on three
|
|
behaviors:
|
|
|
|
- **Hints overlay.** Press `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.
|
|
- **NERDTree-style mappings everywhere.** NERDTree file-opening mappings (`o`, `t`, `T`, `s`, `i`,
|
|
`go`, `gs`, `gi`) work in any focused tree, not just the Project tool window.
|
|
- **Tool window navigation.** Vim-style window-motion keys work inside tool windows, so you can move
|
|
between split panes without leaving the keyboard.
|
|
|
|
### Setup:
|
|
- Install the [AceJump](https://plugins.jetbrains.com/plugin/7086-acejump/) plugin.
|
|
- Add the following command to `~/.ideavimrc`: `set VimEverywhere`
|
|
|
|
### Instructions
|
|
|
|
Press `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.
|
|
|
|
</details>
|
|
|
|
<details>
|
|
<summary><h2>visual-star-search: Makes * and # search for the selected text</h2></summary>
|
|
|
|
Original plugin: [vim-visual-star-search](https://github.com/bronson/vim-visual-star-search).
|
|
|
|
### Summary:
|
|
In visual mode, `*` and `#` search forwards and backwards for the selected text instead of the word
|
|
under the caret. The selection is searched for literally, without word boundaries, so it also matches
|
|
inside longer words. `n` and `N` repeat the search as usual, and `gv` reselects the text you searched for.
|
|
|
|
### Setup:
|
|
- Add the following command to `~/.ideavimrc`: `Plug 'bronson/vim-visual-star-search'`
|
|
<details>
|
|
<summary>Alternative syntax</summary>
|
|
<code>Plugin 'bronson/vim-visual-star-search'</code>
|
|
<br/>
|
|
<code>Plug 'https://github.com/bronson/vim-visual-star-search'</code>
|
|
<br/>
|
|
<code>Plug 'vim-visual-star-search'</code>
|
|
<br/>
|
|
<code>set visual-star-search</code>
|
|
</details>
|
|
|
|
### Instructions
|
|
|
|
https://github.com/bronson/vim-visual-star-search#vim-visual-star-search
|
|
|
|
</details>
|
|
|
|
<details>
|
|
<summary><h2>Which-Key: Displays available keybindings in popup</h2></summary>
|
|
|
|
Original plugin: [vim-which-key](https://github.com/liuchengxu/vim-which-key).
|
|
|
|
### Summary:
|
|
vim-which-key is vim port of emacs-which-key that displays available keybindings in popup.
|
|
|
|
### Setup:
|
|
- Install [Which-Key](https://plugins.jetbrains.com/plugin/15976-which-key) plugin.
|
|
- Add the following command to `~/.ideavimrc`: `set which-key`
|
|
|
|
### Instructions
|
|
|
|
https://github.com/TheBlob42/idea-which-key?tab=readme-ov-file#installation
|
|
|
|
</details>
|
|
|
|
<details>
|
|
<summary><h2>yankring: Keeps a history of yanks, deletes and changes to paste from</h2></summary>
|
|
|
|
Original plugin: [YankRing.vim](https://www.vim.org/scripts/script.php?script_id=1234).
|
|
|
|
### Summary:
|
|
Vim keeps a history of deletes in `"1`-`"9`, but a yank always overwrites the last one. The yank ring
|
|
adds the missing history - the Emacs kill ring - over yanks, deletes and changes alike. Paste with
|
|
`p`, then press `<C-P>` to swap what you just pasted for the entry before it, and keep pressing to
|
|
walk further back. `<C-N>` walks forward again, and a count like `2<C-P>` skips.
|
|
|
|
### Setup:
|
|
- Add the following command to `~/.ideavimrc`: `Plug 'vim-scripts/YankRing.vim'`
|
|
<details>
|
|
<summary>Alternative syntax</summary>
|
|
<code>Plugin 'vim-scripts/YankRing.vim'</code>
|
|
<br/>
|
|
<code>Plug 'https://github.com/vim-scripts/YankRing.vim'</code>
|
|
<br/>
|
|
<code>Plug 'YankRing'</code>
|
|
<br/>
|
|
<code>set yankring</code>
|
|
</details>
|
|
|
|
### Instructions
|
|
|
|
Cycling replaces the text of the last paste, so it works while the caret is still on the line you
|
|
pasted onto and you have not edited the buffer since; otherwise it tells you to paste first. `p`,
|
|
`P`, `gp`, `gP`, `]p`, `[p`, `]P` and `[P` are all tracked, in normal and visual mode, counts
|
|
included. One `u` undoes the paste and the cycling together.
|
|
|
|
`:YRShow` lists the ring newest first, `:YRClear` empties it, and `:YRReplace {offset} {p|P}` is what
|
|
the keys call - a negative offset steps to an older entry, a positive one to a newer one.
|
|
|
|
`let g:yankring_max_history = 100` caps how many entries are kept.
|
|
|
|
Note that `<C-P>` and `<C-N>` stop being `k` and `j` in normal mode, as with the original plugin.
|
|
Visual, operator-pending, insert and command-line mode are untouched. To keep the keys, map your own
|
|
in `~/.ideavimrc`, which suppresses the defaults:
|
|
|
|
```
|
|
nmap <A-p> <Plug>YankRingReplacePrevious
|
|
nmap <A-n> <Plug>YankRingReplaceNext
|
|
```
|
|
|
|
Not implemented yet: the ring window (`:YRShow` prints the listing instead), the other `:YR*`
|
|
commands, every `g:yankring_*` option but the one above, persistence across restarts, and clipboard
|
|
monitoring. Behaviour with multiple carets is undefined.
|
|
|
|
https://github.com/vim-scripts/YankRing.vim/blob/master/doc/yankring.txt
|
|
|
|
</details>
|
|
|
|
<details>
|
|
<summary><h2>youcompleteme: Cycle through code completion with Tab</h2></summary>
|
|
|
|
Inspired by [YouCompleteMe](https://github.com/ycm-core/YouCompleteMe) / [SuperTab](https://github.com/ervandew/supertab).
|
|
|
|
### Summary:
|
|
Makes `<Tab>` cycle through the IDE's code completion popup, SuperTab style. While the completion
|
|
popup (lookup) is open, `<Tab>` selects the next item and `<S-Tab>` the previous one — the same as
|
|
the native `<C-N>`/`<C-P>` insert-mode completion keys. When no popup is open, `<Tab>` falls back to
|
|
its normal behaviour (indentation), so ordinary tabbing is unaffected.
|
|
|
|
### Setup:
|
|
- Add the following command to `~/.ideavimrc`: `set youcompleteme`
|
|
|
|
### Instructions
|
|
|
|
Enabling the plugin removes `<Tab>` and `<S-Tab>` from the [`idealookupkeys`](https://github.com/JetBrains/ideavim/wiki/set-commands)
|
|
option so that IdeaVim — rather than the IDE — handles them while the completion popup is open. If
|
|
you want to keep Vim's default insert-mode completion keys as well, they continue to work alongside
|
|
Tab:
|
|
|
|
| Mapping | Description |
|
|
|---------|-------------|
|
|
| `<Tab>` | Select the next item in the completion popup (or insert a tab when none is open) |
|
|
| `<S-Tab>` | Select the previous item in the completion popup |
|
|
|
|
</details>
|