Documentation Index
Fetch the complete documentation index at: https://mintlify.com/chrisgrieser/nvim-various-textobjs/llms.txt
Use this file to discover all available pages before exploring further.
nvim-various-textobjs supports two approaches to keybindings. You can enable the full default set by passing useDefaults = true in your setup() call and optionally suppressing individual mappings with disabledDefaults. Or you can skip the defaults entirely and define every binding yourself, giving you complete control over which keys are used and how inner and outer variants are split. This page covers both approaches in detail.
How keymaps work
Text object keymaps are registered in two modes simultaneously:o(operator-pending) — activated after an operator liked,c, ory. For example,diideletes the inner indented block.x(visual) — activated from visual mode to extend or shrink the current selection to the text object’s boundaries.
Simple objects (no parameters)
For text objects that take no arguments, the Ex command string is straightforward. For objects that take ascope argument, create two mappings — one for "inner" and one for "outer" — following the standard i/a prefix convention.
Indentation text object (two parameters)
Theindentation text object is unique: it takes two separate border parameters rather than a single scope. The first parameter controls whether the line above the indented block is included; the second controls the line below. This lets you mix inner and outer independently for the top and bottom borders.
ii and iI for inner-inner indentation, matching the behaviour of vim-indent-object.
Column text object (direction parameter)
Thecolumn text object takes a direction instead of a scope. The three valid values are "down" (default), "up", and "both".
Default keymap table
WhenuseDefaults = true is set, the following keymaps are registered automatically. The Inner and Outer columns show the keys for inner and outer variants respectively. Single shows the key used for text objects that have no inner/outer distinction.
| Text Object | Inner | Outer | Single |
|---|---|---|---|
indentation | ii, iI | ai, aI | — |
greedyOuterIndentation | ig | ag | — |
subword | iS | aS | — |
anyBracket | io | ao | — |
anyQuote | iq | aq | — |
value | iv | av | — |
key | ik | ak | — |
number | in | an | — |
chainMember | im | am | — |
lineCharacterwise | i_ | a_ | — |
closedFold | iz | az | — |
notebookCell | iN | aN | — |
filepath | iF | aF | — |
color | i# | a# | — |
doubleSquareBrackets | iD | aD | — |
argument | i, | a, | — |
restOfIndentation | — | — | R |
nearEoL | — | — | n |
toNextClosingBracket | — | — | C |
toNextQuotationMark | — | — | Q |
restOfParagraph | — | — | r |
entireBuffer | — | — | gG |
visibleInWindow | — | — | gw |
restOfWindow | — | — | gW |
diagnostic | — | — | ! |
column | — | — | | |
url | — | — | L |
lastChange | — | — | g; |
emoji | — | — | . |
Disabling specific defaults
If you want most defaults but need to reclaim a handful of keys for other purposes, usedisabledDefaults to suppress individual mappings by key. The rest of the defaults remain active.
If you lazy-load this plugin (e.g. with
event = "VeryLazy" in lazy.nvim), the default keymaps cannot be registered at startup. To use useDefaults = true with lazy.nvim you must also set lazy = false in your plugin spec so the plugin loads unconditionally on startup.