-
Notifications
You must be signed in to change notification settings - Fork 23
Examples
Manuel van Rijn edited this page Jun 13, 2018
·
17 revisions
Please contribute your examples by clicking edit!!
apple = 1==0
banana =100
car = 2
-
=/f
or=/lf
or=/l1f
or=/lf1
or=/l1f1
aligns only the first=
apple = 1==0
banana = 100
car = 2
-
(?<==)\s*./l1r0l0f1
aligns the first non-space character just after=
apple = 1==0
banana = 100
car = 2
apple& orange &grapes
one & two& three
-
&
or&/l
or&/l1
yields
apple & orange & grapes
one & two & three
-
&/c2l1
or&/c2l
or&/(c2l)*3
: two spaces after odd columns
apple & orange & grapes
one & two & three
-
&/llclr
: each column has its own justification
apple & orange & grapes
one & two & three
var x = {
foo: "hello",
someLongProp: "some other value",
x: { x: 12, y: 13 }
};
(?<=:) /l1l1f
var x = {
foo: "hello",
someLongProp: "some other value",
x: { x: 12, y: 13 }
};
Features:
- keeps
:
with the property name (required by JS) - does not change literal objects that appear as property values
var express = require('express'),
http = require('http'),
path = require('path'),
jadebrowser = require('jade-browser');
^\s*(?:var)?\s*\S|=/lr0llf2
yields
var express = require('express'),
http = require('http'),
path = require('path'),
jadebrowser = require('jade-browser');
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
-ms-border-radius: 50%;
-o-border-radius: 50%;
border-radius: 50%;
:/r0cl
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
-ms-border-radius: 50%;
-o-border-radius: 50%;
border-radius: 50%;
expose :id, :property, in: :summary, as: [:string]
expose :account_id, :property, in: :summary, as: [:string]
(?<=:|,) /l1l1
expose :id, :property, in: :summary, as: [:string]
expose :account_id, :property, in: :summary, as: [:string]
{
some: :value,
fruit: "kumquat",
animal: "dog",
favourite_number: 17,
}
\w*:/lf1
{
some: :value,
fruit: "kumquat",
animal: "dog",
favourite_number: 17,
}