-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdot_bashrc.tmpl
83 lines (73 loc) · 2.79 KB
/
dot_bashrc.tmpl
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#┌─┐┬─┐┌─┐┌┬┐┌─┐┌┬┐
#├─┘├┬┘│ ││││├─┘ │
#┴ ┴└─└─┘┴ ┴┴ ┴
eval "$(starship init $(ps -p $$ -o ucomm=))"
#┌─┐┬ ┬┌┐┌┌─┐┌┬┐┬┌─┐┌┐┌┌─┐
#├┤ │ │││││ │ ││ ││││└─┐
#└ └─┘┘└┘└─┘ ┴ ┴└─┘┘└┘└─┘
function cheat() { curl "http://cheat.sh/$1"; }
function col {
awk -v col=$1 '{print $col}'
}
function findext() {
CMD='find -type f'
for E in $@
do
CMD=$CMD" -iname \"*.$E\" -or"
done
echo $CMD | sed -e 's# -or$##' | bash
}
function look() {
if [ "$1" = "-a" ]; then
local find_result=$(find . -type f -o -type l)
else
local find_result=$(find . -maxdepth 1 -type f -o -type l)
fi
local target_files=($(echo "$find_result" \
| sed 's/\.\///g' \
| grep -v -e '.jpg' -e '.gif' -e '.png' -e '.jpeg' \
| sort -r \
| fzf-tmux -p80% --select-1 --prompt 'vim ' --preview 'bat --color always {}' --preview-window=right:70%
))
[ "$target_files" = "" ] && return
vim -p ${target_files[@]}
}
TRAPALRM() {
MODELS=($(ls -d $HOME/Documents/models/*))
SEC=`date +%S`
I=$((SEC%$(echo ${#MODELS[@]})+1))
3d-ascii-viewer -z 120 ${MODELS[$I]}
}
#┌─┐┬ ┬┌─┐┌─┐┌─┐┌─┐
#├─┤│ │├─┤└─┐├┤ └─┐
#┴ ┴┴─┘┴┴ ┴└─┘└─┘└─┘
alias myip="ifconfig | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p'"
alias setls='cat << eof | xargs -n 1 $1'
alias grepls='cat << eof | xargs -I {} -n 1 grep {} $1'
alias less='bat'
alias late='less $(echo `ls -t | head -n 1`)'
alias cat='bat --paging=never'
alias diff='delta -s'
alias ls="eza --icons --git"
alias la="eza -a --icons --git"
alias ll="eza -aahl --icons --git"
alias lt="eza -T -L 3 -a -I 'node_modules|.git|.cache' --icons"
alias lta="eza -T -a -I 'node_modules|.git|.cache' --color=always --icons | less -r"
alias vc='code' # gui code editor
alias clear='paclear -s 5 -c ${PCLRCOLS[$((RANDOM%5 + 1))]}'
alias gui='am start --user 0 -n com.termux.x11/com.termux.x11.MainActivity && export DISPLAY=:0 && \
PULSE_SERVER=tcp:127.0.0.1 && dbus-launch --exit-with-session bspwm &'
#┬ ┬┌─┐┬─┐┬┌─┐┌┐ ┬ ┌─┐┌─┐
#└┐┌┘├─┤├┬┘│├─┤├┴┐│ ├┤ └─┐
# └┘ ┴ ┴┴└─┴┴ ┴└─┘┴─┘└─┘└─┘
TMOUT=900
PCLRCOLS=(red green blue yellow pink)
export PATH="$PATH:$HOME/bin"
export PATH="$PATH:$HOME/go/bin"
export PATH="$PATH:$HOME/.local/bin"
{{ if eq .chezmoi.os "darwin" }}
# Copy from Caveats of 'brew (re)install python3'.
export PATH="$PATH:/usr/local/bin/python3"
# installed by pip3
export PATH="$PATH:/usr/local/opt/[email protected]/libexec/bin"
{{ end }}