-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcommonshrc
More file actions
126 lines (107 loc) · 2.23 KB
/
commonshrc
File metadata and controls
126 lines (107 loc) · 2.23 KB
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# Shell init script, shared by bash / zsh
set -o vi
set +o notify
HISTSIZE=10000
source ~/.commonenv
alias l=ls
alias ls='ls --group-directories-first -F --color=auto'
alias ll='ls -oh'
alias la='ls -A'
alias grep='grep --color=auto -E -i'
alias lstcp='lsof -nPi tcp'
alias mkdir='mkdir -p'
alias ip='ip -h -br -c=auto'
alias dg='doggo --time --timeout 3s '
alias e=nvim
alias fd='fd --color=never'
alias g=git
alias gl='git l'
alias gll='git ll'
alias gs='git s'
alias o=xdg-open
alias ht="htop -u \$USER -s PERCENT_CPU"
alias k=kubectl
alias s='sudo -E '
alias sctl='systemctl'
alias scu='systemctl --user'
alias sdrun="systemd-run -d"
alias rg='rg -LSp -M 80 --max-columns-preview --no-require-git'
alias rgnotes='rg -w "BUG|COMBAK|FIX|TBD|TODO|WTF|XXX" | less'
alias bss="browser-sync start --server --directory --files='*.css, *.html, *.js'"
alias bsc="browser-sync start --config bs-config.js"
alias cp='cp --reflink=auto'
alias cm=mocp
alias cal='cal -mw'
alias alert="echo -n '\a'"
alias vg=vagrant
alias v=less
alias be='bundle exec'
alias zathura='zathura --fork &>/dev/null'
alias irc='weechat-curses'
alias j='journalctl -n 20'
alias jfu='j -fu '
alias ns=dnsget
alias rsv=resolvectl
alias ntw=networkctl
alias ntwr='networkctl reconfigure'
alias downspeed='curl -o /dev/null'
alias ping='ping -n'
alias gp=gpaste-client
alias wn=workon
alias z=bsdtar
mkd() {
mkdir -p "$1"
cd "$1"
}
cdrb() {
cd "$(dirname "$(gem which "$1")")"
}
cdpy() {
cd "$(dirname "$(python -c "import $1; print($1.__file__)")")"
}
cdvim() {
if [ -n "$1" ]
then
cd ~/.local/share/nvim/plugged/"$1"
else
cd ~/.local/share/nvim/plugged
fi
}
edbin() {
bin="$(command -v "$1")"
if [ -n "$bin" ]
then
"$EDITOR" "$bin"
else
return 1
fi
}
gc() {
git add --all .
git commit -m "$*"
}
rn() {
[ -z "$1" ] && return 1
[ -e "$1" ] || return 2
fn="$1"
cache="$(mktemp)"
echo "$fn" > "$cache"
"$EDITOR" "$cache"
mv "$fn" "$(cat "$cache")"
}
t() {
eza -T -a --color=always --git-ignore "$@" | less
}
psg() {
pgrep -fai "$@" | cut -c -100
}
with_proxy() {
local p="$1"
shift
http_proxy=$p https_proxy=$p ftp_proxy=$p \
HTTPS_PROXY=$p ALL_PROXY=$p \
"$@"
}
source_if_possible() {
test -r "$1" && source "$1"
}