What are the possible uses of the inner-something command in vim? For example, the following three items work:

  • ci) in ("hello")
  • ci' in 'hello'
  • ci] in ([var])

But the following two do not:

  • ci# in # TODO #
  • ci" in:
This is a python docstring.

What are the various limitations then or possibilities in using the i (as in "inner") command?


All of the text-objects are documented under :help text-objects.

Excerpted from :help objects:

|v_iquote|  i"         double quoted string without the quotes
|v_i'|      i'         single quoted string without the quotes
|v_i(|      i(         same as ib
|v_i)|      i)         same as ib
|v_i<|      i<         "inner <>" from '<' to the matching '>'
|v_i>|      i>         same as i<
|v_iB|      iB         "inner Block" from "[{" and "]}"
|v_iW|      iW         "inner WORD"
|v_i[|      i[         "inner []" from '[' to the matching ']'
|v_i]|      i]         same as i[
|v_i`|      i`         string in backticks without the backticks
|v_ib|      ib         "inner block" from "[(" to "])"
|v_ip|      ip         "inner paragraph"
|v_is|      is         "inner sentence"
|v_it|      it         "inner tag block"
|v_iw|      iw         "inner word"
|v_i{|      i{         same as iB
|v_i}|      i}         same as iB
  • 1
    These are the ones built-in to Vim, but you can typically extend that list with mappings and you'll find plug-ins that do that. For example, targets.vim. You'll also find plug-ins that help you define your own, such as vim-textobj-user. And text objects for specific languages, such as vim-textobj-python for Python functions or classes, or vim-pythonsense which also has one for Python docstrings.
    – filbranden
    Apr 23 '20 at 1:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.