]> Sergey Matveev's repositories - schwabrak.git/blob - lib.zsh.rc
Initial commit
[schwabrak.git] / lib.zsh.rc
1 set -e
2 setopt EXTENDED_GLOB GLOB_STAR_SHORT
3
4 PERL=${PERL:-perl}
5 EDITOR=${EDITOR:-vi}
6
7 die() {
8     print $@ >&2
9     exit 1
10 }
11
12 [[ -d issues ]] || die You must run that command in directory with issues/
13
14 relpath() {
15     $PERL -mFile::Spec -le "print File::Spec->abs2rel(@ARGV)" $1:a $2:a
16 }
17
18 endash() {
19     $PERL -npe 's/(-+)/$1-/g ; s/ /-/g'
20 }
21
22 dedash() {
23     $PERL -npe 's/([^-])-([^-])/$1 $2/g ; s/-(-+)/$1/g'
24 }
25
26 delim() {
27     local i
28     for i ({1..40}) print -n -- -
29     print
30 }