box-edit

An Atom package to edit rectangular areas; supports short lines.

mark-hahn

2,901

7

0.1.3

MIT

GitHub

box-edit

An Atom package to edit rectangular areas; supports short lines.

box-edit-demo

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.

Features

Usage

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.

Status: Beta

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 mark@hahnca.com or post problem reports to the issues section of https://github.com/mark-hahn/box-edit.

Known Problems:

To-Do

License

Copyright Mark Hahn using the MIT license