SlickEdit Community

SlickEdit Product Discussion => SlickEdit® => Did you know? => Topic started by: Lisa on April 01, 2008, 02:24:46 pm

Title: Wrap It Up With "Surround With"
Post by: Lisa on April 01, 2008, 02:24:46 pm
If you need to wrap a selection with a structure or any other text, use the Surround With feature. For example, in C/C++, you may want to surround a code block with braces, or in HTML, you may want to wrap a selection with start and end tags. Common wrappers for each supported language are predefined. To use Surround With, first select the text that you want to surround. Then, right-click and select Surround Selection With from the context menu (or use the surround_with command). The Surround With dialog is displayed. Select the structure you want to wrap around your selection, line, or code block, and click OK.

Bonus tip: If you find yourself using Surround With a lot, bind surround_with to a key or key sequence. I use it so much in HTML and DocBook that I bind the command to Ctrl+W, which is an otherwise unused sequence for me and easy to remember and use. See "key bindings: creating" in the Help > Index for instructions on binding commands to keys.