Atom.io – Valign Package
Easily align your code.
// from
var easily = 'align';
var your = 'code';
// to
var easily = 'align';
var your = 'code';
Hotkey
Command | Mac | PC and Linux |
---|---|---|
Align code | Ctrl + \ | Alt + Ctrl + \ |
Features
- General, works on ANY language without needing specific support
- Aligns many kinds of operators (E.g.
%=
,?=
,|=
,=>
, etc.) - Can configure alignment and padding of operators
- Basic functionality works on untitled files (No grammar needed)
Settings
Alignment "=" (Default: right)
Padding "=" (Default: both)
Alignment ":" (Default: left)
Padding ":" (Default: right)
Alignment "=>" (Default: right)
Padding "=>" (Default: both)
Few Examples (html, css, less, scss, etc. also work)
JavaScript
Assignment
// from
var one = "uno",
two="dos",
three ="thres",
four= "quatro";
one = "uno";
two+="dos";
three -="thres";
// to
var one = "uno",
two = "dos",
three = "thres",
four = "quatro";
one = "uno";
two += "dos";
three -= "thres";
Object
// from
var numero = {
one : "uno",
two:"dos",
three :"thres",
four: "quatro"
};
// to
var numero = {
one: "uno",
two: "dos",
three: "thres",
four: "quatro"
};
CoffeeScript
Assignment
# from
one = "uno"
two+="dos"
three -="thres"
four?= "quatro"
# to
one = "uno"
two += "dos"
three -= "thres"
four ?= "quatro"
Object
# from
numero =
one : "uno"
two:"dos"
three :"thres"
four: "quatro"
# to
numero =
one: "uno"
two: "dos"
three: "thres"
four: "quatro"
PHP
Assignment
// from
var one = "uno";
two+="dos";
three -="thres";
four*= "four";
// to
var one = "uno";
two += "dos";
three -= "thres";
four *= "four";
Array
// from
var numero = array(
"one" => "uno"
"two"=>"dos"
"three" =>"thres"
"four"=> "quatro"
);
// to
var numero = array(
"one" => "uno"
"two" => "dos"
"three" => "thres"
"four" => "quatro"
);
Notice
This package has been fully rewritten and has stripped out array, object, and space alignment.
If you would like to see these come back please submit a issue.