From 950e6f45ce28ec27a84b7880850b4c1251e7046c Mon Sep 17 00:00:00 2001 From: Ev Bogdanov Date: Wed, 16 Aug 2017 19:59:39 +0300 Subject: [PATCH] `s-` becomes `lstrip` --- README.md | 2 +- bin/lstrip | 4 ++++ bin/s- | 10 ---------- 3 files changed, 5 insertions(+), 11 deletions(-) create mode 100755 bin/lstrip delete mode 100755 bin/s- diff --git a/README.md b/README.md index efea1e7..f602562 100644 --- a/README.md +++ b/README.md @@ -88,8 +88,8 @@ Who is who in **bin** directory: - `h+ SYMBOL` draw a pretty heading - `hg+ MESSAGE` hg: commit and push to master - `lower` convert selection to lowercase +- `lstrip` remove leading whitespace - `search` search with The Silver Searcher -- `s-` remove leading whitespace - `s2t N_SPACES` spaces to tabs (default: 4 spaces to 1 tab) - `t2s N_SPACES` tabs to spaces (default: 1 tab to 4 spaces) - `t+` add tab diff --git a/bin/lstrip b/bin/lstrip new file mode 100755 index 0000000..cfc54fd --- /dev/null +++ b/bin/lstrip @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +# macOS (BSD) flavor of sed +sed -E 's/^[[:space:]]+//' diff --git a/bin/s- b/bin/s- deleted file mode 100755 index 992aa64..0000000 --- a/bin/s- +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env perl - -while (<>) { - if ($_ =~ m/^\s+$/) { - print "\n"; - } else { - $_ =~ s/^\s+//; - print $_; - } -}