An Atom package to edit rectangular areas; supports short lines.
Box-edit provides for selecting and editing a box (rectangular area) of text in the Atom editor. When in box mode the Atom cursors disappear and a new red box cursor takes over. You can cut, paste, insert, etc., on a box instead of character strings. Box-edit supports virtual spaces to the right of lines which solves a problem found in rectangular selection tools that use Atom cursors/selections.
Installation Install box-edit using
apm install box-edit.
Entering/Exiting Box Mode The command to toggle box mode on and off is
box-edit:toggle which by default is bound to
Alt-S. You can tell you are in box mode when the Atom selections disappear and a red box appears (unless it is outside of the visible area). The mouse cursor changes into a cross-hair.
Selecting When in box mode you can create a box by clicking and dragging the mouse. The box will be shown as a red rectangle. The support of arrow keys is planned for the future. You may select anywhere in the editor pane including to the right of line endings.
Single Clicking If you click without dragging then a zero-width box will be created. This is useful before inserting a box. You can also extend it to a bigger box using shift-click.
Extending Selection Shift-click will move the second corner of a box to the new point. This allows extending/shrinking a selection. If you wish to create a box that is taller/wider than the current screen then you must select one corner with a single-click, scroll the pane, and then shift-click to set the second corner.
Atom Selection Matching When you enter box-mode a new box will be created that surrounds all existing Atom selections. When exiting box mode the box will be converted into multiple Atom selections that match the box. This makes it easy to toggle back and forth while keeping the selection.
Rectangular Atom Selections If you enter box mode, select a box inside of text, and exit, you will have created a rectangular selection of Atom cursors. This mimics other Atom rectangular selection tools.
Selecting End Of Lines You can put Atom cursors at the end of multiple lines by entering box mode, creating an empty box past the end of the lines, and exiting box mode.
Box Editing You can perform rectangular editing without leaving box mode. The following commands are supported in box mode. At this time you cannot customize these bindings.
box-edit:toggle(not necessarily Alt-S) will close box mode. It is useful in some situations to enter and exit quickly so pressing this key combo twice is an easy way to do it.
This has been used in my personal editor for a short while. Use with caution. Reports of satisfaction, good and bad, would be appreciated. Email firstname.lastname@example.org or post problem reports to the issues section of https://github.com/mark-hahn/box-edit.
Copyright Mark Hahn using the MIT license
Good catch. Let us know what about this package looks wrong to you, and we'll investigate right away.