Skip to content

ddrscott/vim-textobj-anyblock

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Make Quotes, Parenthesis, Braces as the Same Text Object

Build Status

This plugin make a text object mappings i. and a..

  • i. is a union of i(, i{, i[, i', i" and i<.
  • a. is a union of a(, a{, a[, a', a" and a<.

i. and a. match all of them.

Add the following to your $MYVIMRC

call textobj#user#plugin('anyblock', {
    \ '-' : {
    \      'select-a' : 'a.', '*select-a-function*' : 'textobj#anyblock#select_a',
    \      'select-i' : 'i.', '*select-i-function*' : 'textobj#anyblock#select_i',
    \   },
    \ })

This plugin depends on vim-textobj-user. Please install it in advance.

If you want to change the blocks which i. and a. match, define g:textobj#anyblock#blocks. For example, if you install vim-textobj-between and want to match `...`, set [ '(', '{', '[', '"', "'", '<' , 'f`'] to it.

If you want to define buffer local blocks, set them to b:textobj_anyblock_buffer_local_blocks as list of string.

License

Copyright (c) 2013 rhysd MIT License.

About

A text object for any of '', "", (), {}, [] and <>.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Vim Script 71.5%
  • Ruby 28.5%