Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/adriaanzon/vim-textobj-matchit
Vim text object for linewise matchit pairs
https://github.com/adriaanzon/vim-textobj-matchit
elixir laravel-blade latex lua ruby text-object vim
Last synced: about 2 months ago
JSON representation
Vim text object for linewise matchit pairs
- Host: GitHub
- URL: https://github.com/adriaanzon/vim-textobj-matchit
- Owner: adriaanzon
- Created: 2017-05-19T22:46:02.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-09-02T18:30:37.000Z (4 months ago)
- Last Synced: 2024-10-31T13:45:27.177Z (about 2 months ago)
- Topics: elixir, laravel-blade, latex, lua, ruby, text-object, vim
- Language: Vim Script
- Homepage:
- Size: 24.4 KB
- Stars: 10
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# vim-textobj-matchit
A Vim plugin that creates text objects from matchit pairs, to be used with:
* Ruby (`if…end`, `def…end`)
* Blade (`@section…@endsection`)
* Shell (`if…fi`, `for…done`)
* Vim script (`if…endif`, `for…endfor`)
* :man_shrugging: Any other filetype that defines similar matchit pairs## :package: Installation
Depends on [vim-textobj-user][textobj-user] and [matchit][matchit].
```vim
Plug 'kana/vim-textobj-user'
Plug 'adriaanzon/vim-textobj-matchit'runtime macros/matchit.vim
```It's likely that matchit is already enabled. You can check so by running
`:echo g:loaded_matchit`. It will return `1` when it's enabled.## :sparkles: Usage
Textobj-matchit maps 2 keystrokes: `am` and `im`. They work like any other text
object: `am` selects the _all_ of the matchit pair, `im` the _inner_ portion of
the matchit pair.See [`:h textobj-matchit`](doc/textobj-matchit.txt) for more details, including
instructions on how to define your own key mappings.## :man_teacher: History
This plugin derives from [vim-textobj-rubyblock][textobj-rubyblock] and
[vim-textobj-blade-directive][textobj-blade-directive]. I wanted something
similar that works for every filetype, so that is why I created this plugin.## :page_facing_up: License
Copyright © Adriaan Zonnenberg. Distributed under the same terms as Vim itself.
See `:help license`.[matchit]: http://www.vim.org/scripts/script.php?script_id=39
[textobj-blade-directive]: https://github.com/adriaanzon/vim-textobj-blade-directive
[textobj-rubyblock]: https://github.com/nelstrom/vim-textobj-rubyblock
[textobj-user]: https://github.com/kana/vim-textobj-user