https://github.com/Freyskeyd/atom-alignment
Multi-line and multiple selection alignment package for atom
https://github.com/Freyskeyd/atom-alignment
Last synced: about 1 year ago
JSON representation
Multi-line and multiple selection alignment package for atom
- Host: GitHub
- URL: https://github.com/Freyskeyd/atom-alignment
- Owner: Freyskeyd
- License: mit
- Created: 2014-02-28T08:56:16.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2017-11-02T09:10:45.000Z (over 8 years ago)
- Last Synced: 2024-05-02T04:36:27.796Z (about 2 years ago)
- Language: CoffeeScript
- Size: 142 KB
- Stars: 46
- Watchers: 8
- Forks: 12
- Open Issues: 32
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# atom-alignment package
[Atom package](https://atom.io/packages/atom-alignment)
> Inspired by sublime text plugin ([sublime_alignment](https://github.com/wbond/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`.
```javascript
var a = b;
var ab = c;
var abcd = d;
var ddddd =d;
```
```javascript
var a = b;
var ab = c;
var abcd = d;
var ddddd = d;
```
With more than one selection
```javascript
var a = b; /* selection 1 */
var ab = c; /* selection 1 */
var notMePlease='NOOOO';
var abcd = d; /* selection 2 */
var ddddd =d; /* selection 2 */
```
```javascript
var a = b;
var ab = c;
var notMePlease='NOOOO';
var abcd = d;
var ddddd = d;
```
On a single line started with `ctrl+cmd+a`
```javascript
var a = b var cde = d
```
```javascript
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.
```javascript
var a =b var c|= d
var e c|= f var g = h
var i c=j var k |= l
```
```javascript
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
```javascript
lets = see = what := happens
a = a = b = c : d := e
```
```javascript
lets = see = what := happens
a = a = b = c : d := e
```
## License
MIT © [Andre Lerche](https://github.com/papermoon1978)
MIT © [Simon Paitrault](http://www.freyskeyd.fr)