sponsor Vim development Vim logo Vim Book Ad

textobj-indent : Text objects for indented blocks of lines

 script karma  Rating 45/17, Downloaded by 2668  Comments, bugs, improvements  Vim wiki

created by
Kana Natsuno
 
script type
utility
 
description
*textobj-indent* is a Vim plugin to provide text objects to select a block of
lines which are similarly indented to the current line.

For example, if the content of a buffer as follows:
(here ">" means the current line under the cursor,
and "_" means a space to indent)

  if some_condition_is_satisfied
> __if another_condition_is_satisfied
  ____call s:do_x()
  __endif

  __...
  __endif
  else
  __...
  endif

|<Plug>(textobj-indent-a)| will select lines as follows:
(here "|" indicates the selected line)

  if some_condition_is_satisfied
>|__if another_condition_is_satisfied
|____call s:do_x()
|__endif
|
|__...
|__endif
  else
  __...
  endif

|<Plug>(textobj-indent-i)| will select lines as follows:

  if some_condition_is_satisfied
>|__if another_condition_is_satisfied
|____call s:do_x()
|__endif

  __...
  __endif
  else
  __...
  endif

More variants are also available.  See |textobj-indnet-mapping| for the
details.


Requirements:
- Vim 7.2 or later
- |textobj-user| 0.3.8 or later (vimscript#2100)

Latest version:
http://github.com/kana/vim-textobj-indent

Document in HTML format:
http://kana.github.com/config/vim/textobj-indent.html
 
install details
...
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
vim-textobj-indent-0.0.3.zip 0.0.3 2009-08-30 7.0 Kana Natsuno Incompatible changes:
- Requrie |textobj-user| 0.3.8 or later.

Major improvements:
- Add |<Plug>(textobj-indent-same-a)| and |<Plug>(textobj-indent-same-i)|.

Minor improvements:
- Revise the document a bit.
- Add tests.
- Fix a minor bug.
- Revise to be autoloaded.
vim-textobj-indent-0.0.2.zip 0.0.2 2009-04-17 7.0 Kana Natsuno - Fix the bug to calculate indentation levels.  Now these text objects target a set of lines with the same indentation as you see.
vim-textobj-indent-0.0.1.zip 0.0.1 2009-02-27 7.0 Kana Natsuno - Add |<Plug>(textobj-indent-a)| and |<Plug>(textobj-indent-i)|.
- Remove |<Plug>(textobj-indent)|.  Use |<Plug>(textobj-indent-a)| instead.
vim-textobj-indent-0.0.0.zip 0.0.0 2008-12-13 7.0 Kana Natsuno Initial upload
ip used for rating: 142.132.191.50

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github