Permalink
Browse files

update surround

  • Loading branch information...
bleything committed Sep 23, 2011
1 parent 2d9d803 commit ff727e601670c475ce81ca1932b85e1e0b56c3e8
@@ -0,0 +1 @@
+/doc/tags
@@ -0,0 +1,97 @@
+surround.vim
+============
+
+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
+[repeat.vim](https://github.com/tpope/vim-repeat).
+
+Installation
+------------
+
+If you don't have a preferred installation method, I recommend
+installing [pathogen.vim](https://github.com/tpope/vim-pathogen), and
+then simply copy and paste:
+
+ cd ~/.vim/bundle
+ git clone git://github.com/tpope/vim-surround.git
+
+Once help tags have been generated, you can view the manual with
+`:help surround`.
+
+Contributing
+------------
+
+See the contribution guidelines for
+[pathogen.vim](https://github.com/tpope/vim-pathogen#readme).
+
+Self-Promotion
+--------------
+
+Like surround.vim? Follow the repository on
+[GitHub](https://github.com/tpope/vim-surround) and vote for it on
+[vim.org](http://www.vim.org/scripts/script.php?script_id=1697). And if
+you're feeling especially charitable, follow [tpope](http://tpo.pe/) on
+[Twitter](http://twitter.com/tpope) and
+[GitHub](https://github.com/tpope).
+
+License
+-------
+
+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 <vimNOSPAM@tpope.org> *surround-author*
+Author: Tim Pope <http://tpo.pe/>
License: Same terms as Vim itself (see |license|)
This plugin is only available if 'compatible' is not set.
@@ -78,15 +78,6 @@ 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
View
@@ -3,7 +3,6 @@ ds surround.txt /*ds*
i_CTRL-G_S surround.txt /*i_CTRL-G_S*
i_CTRL-G_s surround.txt /*i_CTRL-G_s*
surround surround.txt /*surround*
-surround-author surround.txt /*surround-author*
surround-customizing surround.txt /*surround-customizing*
surround-issues surround.txt /*surround-issues*
surround-mappings surround.txt /*surround-mappings*
@@ -12,7 +11,6 @@ surround-targets surround.txt /*surround-targets*
surround.txt surround.txt /*surround.txt*
vS surround.txt /*vS*
vgS surround.txt /*vgS*
-vs surround.txt /*vs*
yS surround.txt /*yS*
ySS surround.txt /*ySS*
ys surround.txt /*ys*
Oops, something went wrong.

0 comments on commit ff727e6

Please sign in to comment.