1 # Vim Surround for Atom [![Build Status](https://travis-ci.org/gepoch/vim-surround.svg?branch=master)](https://travis-ci.org/gepoch/vim-surround)
3 Surround is an implementation of vim-surround for the [atom](http://atom.io)
4 editor, creating a vim-surround with the power of Atom!
6 You should definitely have [vim-mode](https://atom.io/packages/vim-mode) for
7 this package to function properly, of course.
9 Inspiration from and kudos to the wonderful [vim-surround for
10 vim](https://github.com/tpope/vim-surround)
12 See vim-surround on [github](https://github.com/gepoch/vim-surround) or
13 [atom.io](https://atom.io/packages/vim-surround).
17 * This package supports visual mode's `s )` set of commands for a configurable
20 * Next on the roadmap are pair deletions with `d )` and friends.
22 * New in 0.4: Multiple cursors are now supported, and conveniently work just
23 like you think they do.
25 * New in 0.5: Stable configuration changes and configurable surround key!
27 * New in 0.7: Change surround and delete surround added.
29 * New in 0.8: Tentative support for
30 [vim-mode-next](https://atom.io/packages/vim-mode-next). See
31 [#28](https://github.com/gepoch/vim-surround/issues/28).
33 ### Muscle Memory Compatability Note
35 vim-surround uses a lowercase `s` instead of `S` for surround commands! This is
36 configurable in the package settings, if you would like to set it to the
39 ## How to use Surround
43 For double quotes, highlight the string in visual mode and enter `s "`.
46 Hello world -> "Hello world"
49 For parentheses there are two options. `s )` will surround as normal. `s (`
50 will pad with a space. All asymmetrical pairs have the secondary space-padded
58 Hello world -> (Hello world)
64 Hello world -> ( Hello world )
67 ### Changing Surrounding Pairs
69 Suppose I want to make double quotes into single quotes. To do this, I should
70 put my cursor inside the double quotes in question and enter `c s " '`
73 "Hello world" -> 'Hello world'
76 ### Deleting Surrounding Pairs
78 To delete the single quotes, place your cursor inside of them and enter `d s '`
81 'Hello world' -> Hello world
85 Currently, the following pairs work out of the box!:
93 You can add to the available pairs in atom's settings, and the commands will
94 be dynamically added to your keybindings.
96 For example if I'm working on Jinja templates, and I want to add the ability to
97 surround using `{%` and `%}` I would add this in my settings:
100 (), [], {}, "", '', {%%}
108 Hello world -> {%Hello world%}
114 Hello world -> {% Hello world %}
119 - [x] Implement deleting surrounding pairs with `d s`
120 - [x] Implement changing surrounding pairs with `c s`
121 - [ ] Intelligent tag surrounding/deleting/replacing with `s <q>` and friends.