Browse files

Braid: Update mirror 'bundle/surround' to '489a1e8'

  • Loading branch information...
1 parent 1eb0d50 commit b9a99d7a59a25462b183f736a836883935b429ef BigCat committed Jun 6, 2012
Showing with 150 additions and 119 deletions.
  1. +2 −2 .braids
  2. +1 −0 bundle/surround/.gitignore
  3. +97 −0 bundle/surround/README.markdown
  4. +8 −19 bundle/surround/doc/surround.txt
  5. +42 −98 bundle/surround/plugin/surround.vim
@@ -36,8 +36,8 @@ bundle/snipmate:
url: git://
branch: master
- remote: braid/bundle/surround
- revision: d9e6bfdd902fc661c8fd58ede248ccfc3b3039d7
+ remote: master/braid/bundle/surround
+ revision: 489a1e8c676ad47dd358dbf883bfaf492148d38b
squashed: true
type: git
url: git://
@@ -0,0 +1 @@
@@ -0,0 +1,97 @@
+Surround.vim is all about "surroundings": parentheses, brackets, quotes,
+XML tags, and more. The plugin provides mappings to easily delete,
+change and add such surroundings in pairs.
+It's easiest to explain with examples. Press `cs"'` inside
+ "Hello world!"
+to change it to
+ 'Hello world!'
+Now press `cs'<q>` to change it to
+ <q>Hello world!</q>
+To go full circle, press `cst"` to get
+ "Hello world!"
+To remove the delimiters entirely, press `ds"`.
+ Hello world!
+Now with the cursor on "Hello", press `ysiw]` (`iw` is a text object).
+ [Hello] world!
+Let's make that braces and add some space (use `}` instead of `{` for no
+space): `cs]{`
+ { Hello } world!
+Now wrap the entire line in parentheses with `yssb` or `yss)`.
+ ({ Hello } world!)
+Revert to the original text: `ds{ds)`
+ Hello world!
+Emphasize hello: `ysiw<em>`
+ <em>Hello</em> world!
+Finally, let's try out visual mode. Press a capital V (for linewise
+visual mode) followed by `S<p class="important">`.
+ <p class="important">
+ <em>Hello</em> world!
+ </p>
+This plugin is very powerful for HTML and XML editing, a niche which
+currently seems underfilled in Vim land. (As opposed to HTML/XML
+*inserting*, for which many plugins are available). Adding, changing,
+and removing pairs of tags simultaneously is a breeze.
+The `.` command will work with `ds`, `cs`, and `yss` if you install
+If you don't have a preferred installation method, I recommend
+installing [pathogen.vim](, and
+then simply copy and paste:
+ cd ~/.vim/bundle
+ git clone git://
+Once help tags have been generated, you can view the manual with
+`:help surround`.
+See the contribution guidelines for
+Like surround.vim? Follow the repository on
+[GitHub]( and vote for it on
+[]( And if
+you're feeling especially charitable, follow [tpope]( on
+[Twitter]( and
+Copyright (c) Tim Pope. Distributed under the same terms as Vim itself.
+See `:help license`.
@@ -1,6 +1,6 @@
*surround.txt* Plugin for deleting, changing, and adding "surroundings"
-Author: Tim Pope <> *surround-author*
+Author: Tim Pope <>
License: Same terms as Vim itself (see |license|)
This plugin is only available if 'compatible' is not set.
@@ -20,7 +20,7 @@ examples. An asterisk (*) is used to denote the cursor position.
[123+4*56]/2 cs]) (123+456)/2
"Look ma, I'm *HTML!" cs"<q> <q>Look ma, I'm HTML!</q>
if *x>3 { ysW( if ( x>3 ) {
- my $str = *whee!; vlllls' my $str = 'whee!';
+ 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.
@@ -65,28 +65,19 @@ whitespace.
There is also *yS* and *ySS* which indent the surrounded text and place it
on a line of its own.
-In visual mode, a simple "s" with an argument wraps the selection. This is
+In visual mode, a simple "S" with an argument wraps the selection. This is
referred to as the *vS* mapping, although ordinarily there will be
-additional keystrokes between the v and s. In linewise visual mode, the
+additional keystrokes between the v and S. In linewise visual mode, the
surroundings are placed on separate lines and indented. In blockwise visual
mode, each line is surrounded.
A "gS" in visual mode, known as *vgS* , behaves similarly. In linewise visual
-mode, the automatic indenting is surpressed. In blockwise visual mode, this
-enables surrounding past the end of the like with 'virtualedit' set (there
+mode, the automatic indenting is suppressed. In blockwise visual mode, this
+enables surrounding past the end of the line with 'virtualedit' set (there
seems to be no way in Vim Script to differentiate between a jagged end of line
selection and a virtual block selected past the end of the line, so two maps
were needed).
-Additionally, there is a legacy "s" or *vs* mapping which is basically the
-same as |vS|. Due to popular demand of wanting to use "s" as Vim does to mean
-replacing the selection (also available as "c"), this mapping is going away.
-If you were one of these people and would like to disable "s" with the current
-release, indicate this to surround.vim by assigning the "s" mapping to
-something else.
- xmap <Leader>s <Plug>Vsurround
*i_CTRL-G_s* *i_CTRL-G_S*
Finally, there is an experimental insert mode mapping on <C-G>s and <C-S>.
Beware that the latter won't work on terminals with flow control (if you
@@ -100,9 +91,7 @@ TARGETS *surround-targets*
The |ds| and |cs| commands both take a target as their first argument. The
possible targets are based closely on the |text-objects| provided by Vim.
-In order for a target to work, the corresponding text object must be
-supported in the version of Vim used (Vim 7 adds several text objects, and
-thus is highly recommended). All targets are currently just one character.
+All targets are currently just one character.
Eight punctuation marks, (, ), {, }, [, ], <, and >, represent themselves
and their counterparts. If the opening mark is used, contained whitespace is
@@ -128,7 +117,7 @@ however, newlines are sometimes added and/or removed.
REPLACEMENTS *surround-replacements*
A replacement argument is a single character, and is required by |cs|, |ys|,
-and |vs|. Undefined replacement characters (with the exception of alphabetic
+and |vS|. Undefined replacement characters (with the exception of alphabetic
characters) default to placing themselves at the beginning and end of the
destination, which can be useful for characters like / and |.
Oops, something went wrong.

0 comments on commit b9a99d7

Please sign in to comment.