Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Michael Mior edited this page · 45 revisions
Clone this wiki locally

vim-textobj-user is a library plugin for Vim to define your own text objects without handling many edge cases and complex stuffs.

To avoid reinventing wheels, please add links to plugins to the following tables when you write your own text objects or find text objects written by somebody:

General purpose text objects

Plugin name Author Summary
vim-textobj-between thinca af{char}/if{char} for a region between {char}s
vim-textobj-brace Julian aj/ij for the closest region between any of () [] or {}.
vim-textobj-comment glts ac/ic for a comment
vim-textobj-continuous-line rhysde av/iv for lines continued by \ in C++, sh, and others
vim-textobj-datetime kana ada/ida and others for date and time such as 2013-03-13, 19:51:45, 2013-03-13T19:51:50, and more
vim-textobj-diff kana adh/idh and others for various elements in diff(1) output
vim-textobj-entire kana ae/ie for the entire region of the current buffer
vim-textobj-erb whatyouhide aE/iE for erb tags
vim-textobj-fold kana az/iz for a block of folded lines
vim-textobj-function kana af/if and aF/iF for a function / extensible for any language
vim-textobj-gitgutter gilligan ih for a changed hunk marked by vim-gitgutter
vim-textobj-indblock glts ao/io for a block of indentation (i.e. spaces)
vim-textobj-indent kana ai/ii for a block of similarly indented lines / aI/iI for a block of lines with the same indentation
vim-textobj-jabraces kana aj{X}/ij{X} for a block surrounded by various Japanese braces such as 「foo」 and 【bar】
vim-textobj-lastpat kana a//i/ for a region matched to the last search pattern
vim-textobj-line kana al/il for the current line
vim-textobj-parameter sgur a,/i, for an argument to a function
vim-textobj-pastedtext saaguero gb for last pasted text
vim-textobj-path paulhybryant ap/ip for next file path (w/o basename), aP/iP for the previous file path (w/o basename)
vim-textobj-punctuation beloglazov au/iu for the text between the cursor position and the closest punctuation in front
vim-textobj-quote reedes aq/iq aQ/iQ for “typographic-quoted” strings
vim-textobj-quotes beloglazov aq/iq for the closest pairs of quotes of any type
vim-textobj-sentence reedes as/is for a sentence of prose (overrides hard-coded native object & motion)
vim-textobj-signify-hunk killphi ih for a changed hunk marked by vim-signify (fork from vim-textobj-gitgutter)
vim-textobj-space saihoooooooo aS/iS for a region filled with various space characters
vim-textobj-syntax kana ay/iy for a syntax-highlighted item
vim-textobj-underscore lucapette a_/i_ for a region between _s such as bar in foo_bar_baz
vim-textobj-uri jceb au/iu for a URI, also includes URI handlers and is easy to extend
vim-textobj-url mattn au/iu for a URL
vim-textobj-variable-segment Julian av/iv for a region between either _s or camelCaseVariables
vim-textobj-xmlattr whatyouhide ax/ix for XML/HTML attributes

For specific languages

Plugin name Author Summary
vim-textobj-help kana For Vim :help documents
vim-textobj-latex rbonvall For LaTeX: a$/i$ for an $equation$, and more
vim-textobj-php akiyan For PHP: aP/iP for a range between the PHP delimiters such as <?php and ?>
vim-textobj-python bps For Python: af/if for a function, ac/ic for a class
vim-textobj-ruby tek For Ruby: a/i function, class, and r for a block. an for a Scoped::Name.
vim-textobj-rubyblock nelstrom For Ruby: ar/ir for a block
vim-textobj-sigil vimtaku For Perl: ig for a variable such as $foo / ag for a more complex expression
Something went wrong with that request. Please try again.