-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.aliases
73 lines (57 loc) · 1.91 KB
/
.aliases
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
# vim: ft=bash
# prevent term error with ssh
# TODO find better way ?
# see https://unix.stackexchange.com/a/67541/65188
alias ssh='TERM=screen-256color ssh'
alias vim='lvim'
alias vi='lvim'
#alias git
alias g='git'
alias gs='git status'
alias gd='git diff'
alias gdst='git diff --staged'
alias lg='GIT_PAGER=less git'
alias cdr='cd $(git root)'
alias gt='glab'
alias tf='tail -f'
alias ..='cd ..'
alias ~='cd ~'
alias ls='eza --icons=auto'
alias ll='ls -alh'
alias la='ls -A'
alias l='ls'
alias xop='xdg-open'
alias bat='bat --theme=ansi'
# Docker
alias docker-clean='docker rmi $(docker images -a | grep "^<none>" | awk '"'"'BEGIN {FS=" "} ; {print $3}'"'"') && docker rm $(docker ps -q -f status=exited)'
alias docker-local='export DOCKER_HOST="" && export DOCKER_TLS_VERIFY="" && export DOCKER_CERT_PATH=""'
# nixpkgs
alias reviewthispr='nix run .#nixpkgs-review pr -- $(gh pr view | grep number | cut -f2) --post-result'
alias reviewthiscommit='nix run .#nixpkgs-review rev HEAD'
# goodies
alias meteo='curl http://fr.wttr.in/limoges'
alias tw='timew'
function watchthis {
watched_files=$1
shift
while true; do
inotifywait -r -e modify -e move -e create -e move_self -e delete -e delete_self "$watched_files" \
&& eval "$@"
done
}
alias cwifi='nmcli -f "SSID,IN-USE,FREQ,RATE,BARS,SECURITY" -c yes dev wifi list | fzf --ansi | cut -d" " -f1 | xargs nmcli dev wifi connect'
alias cvpn='nmcli -c yes connection show | grep --color=no vpn | cut -d" " -f1 | fzf | xargs nmcli connection up '
# workarounds
alias fix_damn_touchpad='sudo modprobe -r psmouse && sudo modprobe psmouse'
function s {
if [ -e package.json ]; then
target=$(jq -r '.scripts|to_entries[]|((.key))' package.json | fzf)
npm run $target
else
echo "❗ no package.json"
fi
}
# here will go everything I don't want to version for one reason or another
if [ -f ~/.local-aliases ]; then
. ~/.local-aliases
fi