-
Notifications
You must be signed in to change notification settings - Fork 0
/
interact.zsh
67 lines (51 loc) · 1.2 KB
/
interact.zsh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#/bin/zsh
source "$Z/theme";
alias e=edit
ze(){
z $1 &&
edit
}
edit(){
$EDITOR ${1:-.}
}
HISTFILE="$HOME/.zsh_history"
HISTSIZE=1_000_000
SAVEHIST=1_000_000
alias gits='git status'
alias '$'=''
alias ❯=''
alias ..='cd ..'
alias ls='ls -h'
alias la='ls -lah'
alias disks='duf -only local,fuse'
alias spanso='espanso edit'
h(){ tldr "$1" || man "$1" || "$1" --help || "$1" -h }
+d() { mkdir -p $1; cd $1 }
rand(){ python -c "from random import randrange; print(randrange(0, ${1:-10}))" }
word(){ sed `perl -e "print int rand(99999)"`"q;d" /usr/share/dict/words }
oy(){ echo "${@:-Oy!}" }
scr() {
if [ "$#" -eq "0" ];
then screen -ls;
else screen -D -R -S $1 $@;
fi
}
scr-rename() {
screen -S "$1" -X sessionname "$2"
}
denest(){
# default assumes nested_dir is same as the current directory name
# nested_dir is $1 or the folder name of $PWD
nested_dir="${1:-$(basename $(pwd))}"
ditto "$nested_dir"/* .
echo "$nested_dir"
trash "$nested_dir"
}
paths() {
# display $PATH as a readable list
echo $PATH | tr ':' '\n' | uniq | sed 's/^/\t/'
}
folder(){ basename "$PWD"}
parent(){ basename "$(dirname $PWD)"}
# completions
[ -s "$BUN_INSTALL/_bun" ] && source "$BUN_INSTALL/_bun"