PracticalVim Tip51 - yszheda/wiki GitHub Wiki

Tip 51: Trace Your Selection with Precision Text Objects

Return to the top: <>

References

  • text objects prefixed with `i` (inside): select inside the delimiters
  • text objects prefixed with `a` (around/all): select everything including the delimiters

| Text Object | Selection | | `a)` or `ab` | A pair of (parentheses) | | `i)` or `ib` | Inside of (parentheses) | | `a}` or `aB` | A pair of {braces} | | `i}` or `iB` | Inside of {braces} | | `a]`/`a[`]`/`i[`]| Inside of [brackets] | | `a>`/`a<` | A pair of <angle></angle> | | `i>`/`i<` | Inside of <angle></angle> | | `a'` | A pair of 'single quotes' | | `i'` | Inside of 'single quotes' | | `a"` | A pair of "double quotes" | | `i"` | Inside of "double quotes" | | a` | A pair of `backticks` | | i` | Inside of `backticks` | | `at` | A pair of <xml>tags</xml> | | `it` | Inside of <xml>tags</xml> |

Performing Operations with Text Objects

As a mnemonic:

  • `ci"`: change inside the double quotes
  • `cit`: change inside the tag
⚠️ **GitHub.com Fallback** ⚠️