https://github.com/rhysd/vim-textobj-anyblock
A text object for any of '', "", (), {}, [] and <>.
https://github.com/rhysd/vim-textobj-anyblock
text-object vim-plugin
Last synced: 6 months ago
JSON representation
A text object for any of '', "", (), {}, [] and <>.
- Host: GitHub
- URL: https://github.com/rhysd/vim-textobj-anyblock
- Owner: rhysd
- Created: 2013-09-15T22:46:53.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2019-12-02T22:16:05.000Z (over 6 years ago)
- Last Synced: 2025-02-02T01:15:03.787Z (over 1 year ago)
- Topics: text-object, vim-plugin
- Language: Vim script
- Size: 24.4 KB
- Stars: 82
- Watchers: 3
- Forks: 4
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
One Text Object for Quotes, Parentheses and Braces
==================================================
[![Build Status][]][Travis CI]
This plugin provides text object mappings `ib` and `ab`.
- `ib` is a union of `i(`, `i{`, `i[`, `i'`, `i"` and `i<`.
- `ab` is a union of `a(`, `a{`, `a[`, `a'`, `a"` and `a<`.
`ib` and `ab` match any of the text objects. If multiple text objects are matched, it selects one
covering the most narrow region. For example, when the current line is `['abc', 'def']` and the
cursor is at `e`, `vib` selects `def`.
This plugin depends on [vim-textobj-user](https://github.com/kana/vim-textobj-user).
Please install it in advance.
If you want to change the blocks which `ib` and `ab` match, define `g:textobj#anyblock#blocks`.
For example, if you install [vim-textobj-between](https://github.com/thinca/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 on `FileType` autocmd event.
### License
Distributed under [MIT License](http://opensource.org/licenses/MIT).
```
Copyright (c) 2013 rhysd
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
THE USE OR OTHER DEALINGS IN THE SOFTWARE.
```
[Build Status]: https://travis-ci.org/rhysd/vim-textobj-anyblock.png?branch=master
[Travis CI]: https://travis-ci.org/rhysd/vim-textobj-anyblock