-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zshrc
106 lines (89 loc) · 3.12 KB
/
.zshrc
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
export ZSH="$HOME/.oh-my-zsh"
ZSH_THEME="agnoster"
# agnoster
# jispwoso
# kafeitu
TERM=xterm-256color
plugins=(
colored-man-pages
docker
docker-compose
fzf
git
rust
rsync
ssh-agent
terraform
virtualenvwrapper
web-search
z
fzf-tab # https://github.com/Aloxaf/fzf-tab
ohmyzsh-full-autoupdate # https://github.com/Pilaton/OhMyZsh-full-autoupdate
zsh-autosuggestions # https://github.com/zsh-users/zsh-autosuggestions
zsh-syntax-highlighting # https://github.com/zsh-users/zsh-syntax-highlighting
)
zstyle :omz:plugins:ssh-agent identities rivit
source $ZSH/oh-my-zsh.sh
# history
HISTSIZE=100000
SAVEHIST=10000
setopt hist_ignore_all_dups # when runing a command several times, only store one
setopt hist_reduce_blanks # reduce whitespace in history
setopt hist_ignore_space # do not remember commands starting with space
setopt histfcntllock # use F_SETLCKW
setopt share_history # share history among sessions
setopt extended_history # timestamp for each history entry
setopt hist_verify # reload full command when runing from history
setopt hist_expire_dups_first # remove dups when max size reached
setopt inc_append_history # append to history once executed
setopt notify # report the status of backgrounds jobs immediately
export PATH=$PATH:$HOME/.local/bin:$HOME/go/bin:$HOME/.cargo/bin
export EDIOTR=nvim
export FZF_DEFAULT_OPTS=" \
--height 40% \
--reverse \
--border \
--color=bg+:#363a4f,bg:#24273a,spinner:#f4dbd6,hl:#ed8796 \
--color=fg:#cad3f5,header:#ed8796,info:#c6a0f6,pointer:#f4dbd6 \
--color=marker:#f4dbd6,fg+:#cad3f5,prompt:#c6a0f6,hl+:#ed8796"
alias linode="ssh [email protected]"
alias linode3="ssh [email protected]"
alias ipy="ipython3"
alias gdb="gdb --quiet"
alias yt-dlpmp3="yt-dlp -f "bestaudio/best" -x --audio-format mp3 -o \"%(upload_date)s__%(title)s.%(ext)s\" --audio-quality 0 -ciw"
alias ipx="grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}'"
alias download-vids="(cd /home/rivit/workspace/tools/video-updater && /home/rivit/workspace/tools/video-updater/run.sh)"
alias sync-music="(cd /home/rivit/workspace/tools && ./music-sync.sh)"
alias silencer="while :; do ls >/dev/null; sleep 0.0001; done"
alias rg="rg --threads $(nproc)"
alias vi=nvim
alias pwntemplate="cp /w/github/ctf-tools/pwn/solve.py ."
dotfiles() {
case "$1" in
listall)
shift
dotfiles ls-tree --full-tree -r --name-only HEAD "$@"
;;
*)
/usr/bin/env git --git-dir="$HOME/.dotfiles/" --work-tree="$HOME" "$@"
;;
esac
}
compdef dotfiles='git'
md5rename() {
filename=$(basename -- "$1")
extension="${filename##*.}"
filename="${filename%.*}"
mv $1 $filename-$(md5sum $1 | cut -d ' ' -f 1).$extension
}
countdown() {
start="$(( $(date '+%s') + $1))"
while [ $start -ge $(date +%s) ]; do
time="$(( $start - $(date +%s) ))"
printf '%s\r' "$(date -u -d "@$time" +%H:%M:%S)"
sleep 0.1
done
}
ts() {
python -c 'import datetime;import sys;print(datetime.datetime.utcfromtimestamp(int(sys.argv[1].strip()[:10])))'
}