- Notifications
You must be signed in to change notification settings - Fork8
rhysd/vim-operator-surround
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
This plugin provides Vim operator mappings to deal with surrounds like(),"" and so on.In addition, both end of the text object are the same character, vim-operator-surround recognizesthem as a surround (this behavior is customizable with some variables).
It can
- surround a text object with a specified block.
- replace a surround in a text object with a specified block.
- delete a surround in a text object.
This plugin would be more useful withvim-textobj-between orvim-textobj-anyblock.And you can customize and add surround definitions in global and filetype specific scope.
Policy of This Plugin (or The Reason Why I Don't Usevim-surround)
- Simplicity : All should be done with operator mappings.
- Extensibility : The behavior should be highly customizable with
g:operator#surround#blocksand text objects likevim-textobj-multiblock,vim-textobj-between orvim-textobj-anyblock. - Well-tested
This plugin usesvim-operator-user.Please install it in advance.
Set your favorite blocks tog:operator#surround#blocks. And control the behavior with some variables.Please readdoc for more details.
" operator mappingsmap<silent>sa<Plug>(operator-surround-append)map<silent>sd<Plug>(operator-surround-delete)map<silent>sr<Plug>(operator-surround-replace)" delete or replace most inner surround" if you use vim-textobj-multiblocknmap<silent>sdd<Plug>(operator-surround-delete)<Plug>(textobj-multiblock-a)nmap<silent>srr<Plug>(operator-surround-replace)<Plug>(textobj-multiblock-a)" if you use vim-textobj-anyblocknmap<silent>sdd<Plug>(operator-surround-delete)<Plug>(textobj-anyblock-a)nmap<silent>srr<Plug>(operator-surround-replace)<Plug>(textobj-anyblock-a)" if you use vim-textobj-betweennmap<silent>sdb<Plug>(operator-surround-delete)<Plug>(textobj-between-a)nmap<silent>srb<Plug>(operator-surround-replace)<Plug>(textobj-between-a)
vim-operator-surround is distributed under MIT license.
Copyright (c) 2013-2017 rhysd
Permission is hereby granted, free of charge, to any person obtaininga copy of this software and associated documentation files (the"Software"), to deal in the Software without restriction, includingwithout limitation the rights to use, copy, modify, merge, publish,distribute, sublicense, and/or sell copies of the Software, and topermit persons to whom the Software is furnished to do so, subject tothe following conditions:The above copyright notice and this permission notice shall beincluded 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 OFMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANYCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THESOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
About
Vim operator mapping to enclose text objects with surrounds like paren, quote and so on.
Topics
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors6
Uh oh!
There was an error while loading.Please reload this page.