罗泽轩 edited this page Mar 14, 2017 · 64 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-backticks fvictorio a`/i` for a region between backticks, and ii` for excluding inner whitespace
vim-textobj-between thinca af{char}/if{char} for a region between {char}s
vim-textobj-blanklines zandrmartin a<Space>/i<Space> for groups of blank (only whitespace) lines
vim-textobj-brace Julian aj/ij for the closest region between any of () [] or {}.
vim-textobj-chunk Chun-Yang ac/ic for all the lines contain one of {}, [], or () pairs
vim-textobj-comment glts ac/ic for a comment
vim-textobj-continuous-line rhysd 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-keyvalue vimtaku ak/iv for key / value
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-blade-directive adriaanzon For Laravel Blade: ad / id for directives
vim-textobj-clang libclang-vim For C and C++ blocks, etc.: i;f / a;c
vim-textobj-css jasonlong For CSS, Sass, Less, etc.: ic / ac
vim-textobj-elixir andyl ae / ie for Elixir blocks
vim-textobj-haskell gilligan For Haskell: ih for a function
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
vim-textobj-lua spacewander For Lua: a/i for function, al/il for a block, and ac/ic for a condition