git ssb

0+

clacke / gists



Tree: c7b2d0bce3b000f41b31dc1decd3e89822e355b7

Files: c7b2d0bce3b000f41b31dc1decd3e89822e355b7 / .bash_aliases

984 bytesRaw
1function 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
22alias pyless='langless python'
23alias bashless='langless bash'
24alias javaless='langless java'
25alias cg='ccd ~/git'
26
27function ec() {
28 emacsclient --alternate-editor $(type -p emacs) -n "$@" &>/dev/null &
29}
30
31function jsonless() {
32 python -m json.tool "$1" | langless javascript -
33}
34
35function sudomy {
36 cmd="$(type -p "$1")"
37 shift
38 sudo "$cmd" "$@"
39}
40
41function 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
48function ccd {
49 dir="$(readlink -e "$1")"
50 cd "$dir"
51}
52

Built with git-ssb-web