git ssb

0+

clacke / gists



Commit 2dd0df16fb92bdbca3dcd586a3fb590c0f7fc5ea

.bash_aliases

Claes Wallin (韋嘉誠) committed on 10/7/2016, 5:32:36 AM
Parent: c13067361a419f15f78cd39605356e1d02d717ee

Files changed

.bash_aliasesadded
.bash_aliasesView
@@ -1,0 +1,51 @@
1 +function langless() {
2 + /var/guix/profiles/execline/bin/execlineb -c '
3 + importas -i language 1
4 + shift
5 + elgetpositionals
6 + pipeline -d {
7 + piperw 3 4
8 + background {
9 + fdmove 0 3
10 + fdmove 1 2
11 + grep -v "output left in -"
12 + }
13 + fdclose 3
14 + fdmove 2 4
15 + guix environment --ad-hoc enscript --
16 + enscript -E$language -wansi -o- $@
17 + }
18 + less -R
19 + ' "$@"
20 +}
21 +
22 +alias pyless='langless python'
23 +alias bashless='langless bash'
24 +alias javaless='langless java'
25 +alias cg='ccd ~/git'
26 +
27 +function ec() {
28 + emacsclient --alternate-editor $(type -p emacs) -n "$@" &>/dev/null &
29 +}
30 +
31 +function jsonless() {
32 + python -m json.tool "$1" | langless javascript -
33 +}
34 +
35 +function sudomy {
36 + cmd="$(type -p "$1")"
37 + shift
38 + sudo "$cmd" "$@"
39 +}
40 +
41 +function dockmy {
42 + instance="$1"
43 + cmd="$(readlink -e $(type -p "$2"))"
44 + shift; shift
45 + docker exec -it "$instance" /usr/bin/env TERM="$TERM" "$cmd" "$@"
46 +}
47 +
48 +function ccd {
49 + dir="$(readlink -e "$1")"
50 + cd "$dir"
51 +}

Built with git-ssb-web