-
Notifications
You must be signed in to change notification settings - Fork 0
/
.func
41 lines (33 loc) · 824 Bytes
/
.func
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
tmp () {
[ "$1" = "view" ] && cd /tmp/workspaces && cd $(ls -t | fzf --preview 'ls -A {}') && return 0
r="/tmp/workspaces/$(xxd -l3 -ps /dev/urandom)"
mkdir -p -p "$r" && pushd "$r"
}
jj () {
cd "${1:-.}/$(find . -maxdepth 5 -type d -name .git | sed 's|/.git$||' | fzf --preview 'tree -L 2 ./{}')"
}
r () {
cd "$(git rev-parse --show-toplevel 2>/dev/null)"
}
mkcd () {
mkdir -p "$1" && cd "$1"
}
new-alias () {
echo "alias $1\n" >> ~/.alias
}
reload () {
source ~/.zshrc
echo "zshrc + other conf files reloaded!"
}
random () {
/bin/ls | sort -R | tail -3 |while read file; do
cat
done
}
,update () {
brewup.sh
}
ta () {
SESSION=$(tmux list-sessions -F \#S | gum filter --placeholder "Pick session...")
tmux switch-client -t $SESSION || tmux attach -t $SESSION
}