lilydjwg/dotvim

Subversion checkout URL

You can clone with
or
.
Fetching contributors…

Cannot retrieve contributors at this time

223 lines (180 sloc) 10.1 KB
 *surround.txt* Plugin for deleting, changing, and adding "surroundings" Author: Tim Pope *surround-author* License: Same terms as Vim itself (see |license|) This plugin is only available if 'compatible' is not set. INTRODUCTION *surround* This plugin is a tool for dealing with pairs of "surroundings." Examples of surroundings include parentheses, quotes, and HTML tags. They are closely related to what Vim refers to as |text-objects|. Provided are mappings to allow for removing, changing, and adding surroundings. Details follow on the exact semantics, but first, consider the following examples. An asterisk (*) is used to denote the cursor position. Old text Command New text ~ "Hello *world!" ds" Hello world! [123+4*56]/2 cs]) (123+456)/2 "Look ma, I'm *HTML!" cs" Look ma, I'm HTML! if *x>3 { ysW( if ( x>3 ) { my $str = *whee!; vlllls' my$str = 'whee!'; While a few features of this plugin will work in older versions of Vim, Vim 7 is recommended for full functionality. MAPPINGS *surround-mappings* Delete surroundings is *ds* . The next character given determines the target to delete. The exact nature of the target is explained in |surround-targets| but essentially it is the last character of a |text-object|. This mapping deletes the difference between the "i"nner object and "a"n object. This is easiest to understand with some examples: Old text Command New text ~ "Hello *world!" ds" Hello world! (123+4*56)/2 ds) 123+456/2
Yo!*
dst Yo! Change surroundings is *cs* . It takes two arguments, a target like with |ds|, and a replacement. Details about the second argument can be found below in |surround-replacements|. Once again, examples are in order. Old text Command New text ~ "Hello *world!" cs"' 'Hello world!' "Hello *world!" cs" Hello world! (123+4*56)/2 cs)] [123+456]/2 (123+4*56)/2 cs)[ [ 123+456 ]/2
Yo!*
cst

Yo!