• Packages
  • Themes
  • Documentation
  • Blog
  • Discuss
Sign in

valign

Can has aligns your code.
chemoish
1.1.3 4,794
16
  • Repo
  • Bugs
  • Versions
  • License
Flag as spam or malicious

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.

I think this package is bad news.

Good catch. Let us know what about this package looks wrong to you, and we'll investigate right away.

  • Terms of Use
  • Privacy
  • Code of Conduct
  • Releases
  • FAQ
  • Contact
with by