Skip to content

Multi-line and multiple selection alignment package for atom

License

Notifications You must be signed in to change notification settings

papermoon1978/atom-alignment-fork

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

atom-alignment package

Atom package

Inspired by sublime text plugin (sublime_alignment)

Usage

A simple key-binding for aligning multi-line, multi-cursor and multiple selections in Atom.

Use ctrl+cmd+a on Mac or ctrl+alt+a to align multiple matches. If you want to align the first match only, call Atom Alignment:Align from the command palette. The following examples all use the mentioned key binding to call Atom Alignment:AlignMultiple.

var a = b;
var ab = c;
var abcd = d;
var ddddd =d;
var a     = b;
var ab    = c;
var abcd  = d;
var ddddd = d;

With more than one selection

var a = b;    /* selection 1 */
var ab = c;   /* selection 1 */
var notMePlease='NOOOO';
var abcd = d; /* selection 2 */
var ddddd =d; /* selection 2 */
var a     = b;
var ab    = c;
var notMePlease='NOOOO';
var abcd  = d;
var ddddd = d;

On a single line started with ctrl+cmd+a

var a = b var cde =   d
var a = b
var cde = d

When working with multiple cursors, the different lines are aligned at the best matching cursor position. In the following example the | shows the cursor position.

var a    =b var c|= d
var e c|=   f var g = h
var i c=j var k |= l
var a    =b var c = d
var e c           = f var g = h
var i c=j var k   = l

You can even align multiple matches

lets = see = what := happens
a  = a  = b = c : d := e
lets = see = what      := happens
a    = a   = b = c : d := e

See it in action

atom-alignment

License

MIT © Andre Lerche

MIT © Simon Paitrault

About

Multi-line and multiple selection alignment package for atom

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • CoffeeScript 99.1%
  • CSS 0.9%