Easily surround code selections with language constructs.
This package provides a simple utility function that can be used when coding: to surround a selection with a code construct (that is, a control loop or a conditional statement).
When there is an active selection in the current buffer, the package will provide a list of constructs that match the current buffer grammar. Once a construct is pick from the select view, the selection in the buffer will be surrounded with the construct, and the overall text will be properly indented.
There is no default binding for the package. The user can either call the
package from the command palette as surround-with:surround
, or a new entry can
be placed in the keymap.cson
file:
'atom-workspace atom-text-editor:not([mini])':
'ctrl-alt-o': 'surround-with:surround'
- C/C++
- Java
- JavaScript
- CoffeeScript
- C#
- Go
- Objective-C
- Perl
- PHP
- Python
- Ruby
This package is available in the Atom package repository, still it is under heavy development, thus not recommended for production usage. Any help is heavily appreciated, as well as issues and suggestions!