-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.zsh
42 lines (35 loc) · 842 Bytes
/
functions.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
jqp () {
jq -C "$@" | less -R
}
d () {
if [[ -n $1 ]]; then
dirs "$@"
else
dirs -v | head -n 10
fi
}
man () {
env \
LESS_TERMCAP_md=$(tput bold; tput setaf 4) \
LESS_TERMCAP_me=$(tput sgr0) \
LESS_TERMCAP_mb=$(tput blink) \
LESS_TERMCAP_us=$(tput setaf 2) \
LESS_TERMCAP_ue=$(tput sgr0) \
LESS_TERMCAP_so=$(tput smso) \
LESS_TERMCAP_se=$(tput rmso) \
PAGER="${commands[less]:-$PAGER}" \
_NROFF_U=1 \
GROFF_NO_SGR=1 \
man "$@"
}
va () {
source .venv/bin/activate 2>/dev/null || source ../.venv/bin/activate 2>/dev/null || echo 'no .env found in this or parent directory' && false
}
va! () {
va || vc && va
}
vc () {
uv venv --seed --python-preference managed "$@"
}
vd () { deactivate; }
vrm () { rm -rf .venv; }