Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Vim operator mapping to enclose text objects with surrounds like paren, quote and so on.

NotificationsYou must be signed in to change notification settings

rhysd/vim-operator-surround

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

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)

Requirements

This plugin usesvim-operator-user.Please install it in advance.

Customize

Set your favorite blocks tog:operator#surround#blocks. And control the behavior with some variables.Please readdoc for more details.

Example ofvimrc

" 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)

License

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

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors6


[8]ページ先頭

©2009-2025 Movatter.jp