An extension for IdeaVim plugin that adds useful text objects to improve your productivity on JetBrains IDEs.
Text objects provide a more natural way to tell the editor what to edit, select or jump. Instead of working with characters, words, lines, or paragraphs, you can use the same concepts programmers use to think about code: classes, functions, arguments, loops, comments, quotes, brackets, subwords, and more.
| Text Object | Description | Default mapping | Inner/Outer motions | Jump | Count motions |
|---|---|---|---|---|---|
| AnyArgument | Function arguments, method parameters, and callable expressions | a |
✓ | ✓ | ✓ |
| AnyFunction | Functions, methods, and procedures | f |
✓ | ✓ | x |
| AnyClass | Class, interface, struct, and similar type definitions | c |
✓ | ✓ | x |
| AnyLoop | Loop statements (for, while, do, repeat, until, loop, etc.) |
l |
✓ | ✓ | x |
| AnyConditional | Conditional statements (if-else, switch, try-catch) |
y |
✓ | ✓ | x |
| AnyItem | Items within collections, tuples, lists, or arrays | i |
✓ | ✓ | ✓ |
| AnyQuote | Content enclosed between any type of quotes (single, double, backticks) | q |
✓ | ✗ | ✗ |
| AnyBracket | Content enclosed between any type of brackets (parentheses, square, curly, angle, etc.) | o |
✓ | ✗ | ✗ |
| AnySubword | Words nested in longer words (camelCase, snake_case, dash-case) |
u |
✓ | ✓ | ✓ |
| AnyDocument | Entire document content | d |
✓ | ✗ | ✗ |
| AnyBlockComment | Block comments across different programming languages (/* */, <!-- -->, etc.) |
k |
✓ | ✗ | ✗ |
| AnyIndentBlock | Code blocks based on indentation levels | n |
✓ | ✗ | ✗ |
- Inner/Outer: All text objects support both
i(inner) anda(around/outer) selection modes following standard Vim conventions - Jump: Text objects with jump support allow navigation using
](next) and[(previous) motions unless other mappings are specified (see Customization) - Count motions: Text objects with count support allow selecting multiple consecutive instances. For example
d2aawill delete two arguments including their separators
The plugin follows standard Vim text object conventions with i (inner) and a (around) modifiers
The plugin supports jumping to the next/previous text object using ] (next) and [ (previous)
dia- Delete argumentdaa- Delete argument and its separatord2ia- Deletes argument and the next without including separatorscia- Change argumentcaa- Change argument and its separatorc2aa- Change argument and next one including separatoryia- Yank/Copy argumentyaa- Yank/Copy argument and its separatorvia- Visually select argumentv3aa- Visually select three arguments including separatorv3ia- Visually select three arguments without including separator]a- Jump to next argument[a- Jump to previous argument
Nested words in different case styles:
| Case type | Example |
|---|---|
| Camel case | fooBar |
| Snake case | foo_bar |
| Dash case | foo-bar |
Content enclosed between any type of quotes:
| Quote Type | Example |
|---|---|
| Single quotes | 'text' |
| Double quotes | "text" |
| Backticks | `text` |
Content enclosed between any type of brackets:
| Bracket Type | Example | Description |
|---|---|---|
| Parentheses | (text) |
Function calls, grouping |
| Square brackets | [text] |
Arrays, indexing |
| Curly braces | {text} |
Objects, code blocks |
| Angle brackets | <text> |
Generics |
| HTML/XML brackets | <text/> |
HTML/XML tags, generics |
Entire document content.
Block comments across different programming languages:
| Comment Type | Languages | Example |
|---|---|---|
/* */ |
C, C++, Java, C#, JavaScript, TypeScript, Kotlin, Scala, Swift, Go, Rust, PHP, CSS, SQL | /* comment */ |
/** */ |
Java (Javadoc), Rust (doc comments) | /** documentation */ |
<!-- --> |
HTML, XML, XHTML, Markdown | <!-- comment --> |
""" """ |
Python (docstrings) | """comment""" |
''' ''' |
Python (docstrings) | '''comment''' |
--[[ ]] |
Lua | --[[ comment ]] |
--[=[ ]=] |
Lua (custom delimiters) | --[=[ comment ]=] |
#' to ' |
R (roxygen comments) | #' comment ' |
Items within collections, tuples, lists, or arrays:
| Structure Type | Example |
|---|---|
| Arrays | [item1, item2, item3] |
| List literals | (item1, item2, item3) |
- Inner selection (
ii): Selects only the item itself - Outer selection (
ai): Selects the entire item including the separator and the item itself
Multiple outer selections are supported. For example d2ai will delete the current item and the next one including separator
Function arguments, method parameters, and callable expressions.
- Inner selection (
ia): Selects only the argument itself - Outer selection (
ia): Selects the entire argument including the separator and the argument itself
Multiple outer selections are supported. For example d2aa will delete the current argument and the next one including separator
Functions, methods, and procedures.
- Inner selection (
if): Selects only the function body - Outer selection (
af): Selects the entire function including the function name, decorators and the body
Class, interface, struct, and similar type definitions.
- Inner selection (
ic): Selects only the class body - Outer selection (
ac): Selects the entire class including the name, decorators and the body
Loop statements and iterative constructs like for, foreach, while, until, do, repeat, until, loop, for, foreach, while, until, do, repeat, until,
loop.
- Inner Selection (
il): Selects only the statements within the current loop/iteration where the cursor is positioned - Outer Selection (
al): Selects the entire loop construct including all branches and control keywords
Conditional statements and expressions like if-else, switch or try-catch statements.
- Inner Selection (
iy): Selects only the statements within the current branch/case where the cursor is positioned - Outer Selection (
ay): Selects the entire conditional construct including all branches and control keywords
Code blocks based on indentation levels. This is particularly useful for indentation-based languages like Python, YAML, or Haskell, but also works with brace-based languages to select logical indentation blocks.
Configure which transformation groups to enable in your .ideavimrc:
" Activate plugin
set anyobjectDon't want to use all the provided text objects? Specify which ones to enable using anyobject_included variable in your .ideavimrc:
let g:anyobject_included = "anyDocument,anyFunction"If you prefer to specify which ones to exclude, use the anyobject_excluded variable instead:
let g:anyobject_excluded = "anyDocument,anyFunction"You can also customize the mappings by adding the following to your .ideavimrc. For example:
" Use 'm' instead of default 'f' for any function text object
let g:anyobject_map_anyfunction = "m"
" Use 's' instead of default 'd' for any document text object
let g:anyobject_map_anydocument = "s"In case of mapping conflicts, the custom mappings will take precedence and invalidate any other handler using the same mapping.
Jump motion can be also customized:
" Use '<' instead of default '[' for jumping to the previous text object
let g:anyobject_map_jump_prev = "<"
" Use '>' instead of default ']' for jumping to the next text object
let g:anyobject_map_jump_next = ">" diq- Delete text inside any quotesdaq- Delete text including the quotesciq- Change text inside any quotesyiq- Yank text inside any quotesviq- Visually select text inside any quotes
dio- Delete text inside any bracketsdao- Delete text including the bracketscio- Change text inside any bracketsyio- Yank text inside any bracketsvio- Visually select text inside any brackets
dia- Delete argumentdaa- Delete argument and its separatord2a- Deletes argument and the next one including separatorscia- Change argumentcaa- Change argument and its separatorc2a- Change argument and next one including separatorsyia- Yank/Copy argumentyaa- Yank/Copy argument and its separatorvia- Visually select argumentv3a- Visually select three arguments]a- Jump to next argument[a- Jump to previous argument
- Install the plugin from the IntelliJ IDEA Plugin Marketplace
- Ensure you have the IdeaVim plugin installed and enabled
- Activate the plugin in your
.ideavimrc - Restart IntelliJ IDEA
- Download the latest release
- Install manually using Settings/Preferences > Plugins > ⚙️ > Install plugin from disk...
Contributions are welcome! Please feel free to submit issues, feature requests, or pull requests.
This project is licensed under the MIT License - see the LICENSE file for details.
- Built on top of IdeaVim plugin
- Inspired by the super useful Neovim plugin nvim-various-textobjs
- Vim community for inspiring powerful text object concepts