-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathzshrc_macos
146 lines (107 loc) · 4.04 KB
/
zshrc_macos
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# ZSHRC By Mickael "PAPAMICA" Asseline
# Environement : MACOS
### POWER10K
# https://github.com/romkatv/powerlevel10k
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
source /usr/local/opt/powerlevel10k/powerlevel10k.zsh-theme
#typeset -g POWERLEVEL9K_INSTANT_PROMPT=off
### ALIAS POUR LA YUBIKEY
# https://github.com/drduh/YubiKey-Guide
alias ssh="gpg-connect-agent updatestartuptty /bye > /dev/null; ssh"
alias scp="gpg-connect-agent updatestartuptty /bye > /dev/null; scp"s
export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
### PLUGINS ZSH
# ZSH-AUTOSUGGESTIONS : https://github.com/zsh-users/zsh-autosuggestions
if type brew &>/dev/null; then
FPATH=$(brew --prefix)/share/zsh-completions:$FPATH
autoload -Uz compinit
compinit
fi
source /usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh
# ZSH-SYNTAX-HIGHLIGHTING : https://github.com/zsh-users/zsh-syntax-highlighting
plugins=(zsh-syntax-highlighting)
### ATUIN
# https://github.com/ellie/atuin
eval "$(atuin init zsh)"
### FUCK
# https://github.com/nvbn/thefuck
eval $(thefuck --alias)
### Z
# https://github.com/rupa/z
. /usr/local/etc/profile.d/z.sh
### FZF
# https://github.com/junegunn/fzf
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
### DIRENV
# https://direnv.net/
eval "$(direnv hook zsh)"
### EXA
# https://the.exa.website/
alias ls="exa -a --icons" # short, multi-line
alias ll="exa -1a --icons" # list, 1 per line
alias ld="ll" # ^^^, NOTE: Trying to move to this for alternate hand commands
alias la="exa -lagh --icons" # list with info
alias lt="exa -a --tree --icons --level=2" # list with tree level 2
alias ltf="exa -a --tree --icons" # list with tree
alias lat="exa -lagh --tree --icons" # list with info and tree
### FD
# https://github.com/sharkdp/fd
alias locate="fd"
alias find="fd"
### BAT
# https://github.com/sharkdp/bat
alias cat=bat --style="header" --pager "less -RF"
alias catn=bat --pager "less -RF"
alias batn=bat --pager "less -RF"
### BTOP
# https://github.com/aristocratos/btop
alias htop="btop"
alias top="btop"
### CHEAT
# https://github.com/cheat/cheat
alias "?"="cheat"
alias "help"="cheat"
alias "??"="cheat perso"
alias cheat-update='git -C ~/.config/cheat/cheatsheets/papamica/ pull > /dev/null 2> /dev/null && echo " ✅ Cheats updated !"'
### RIPGREP
# https://github.com/BurntSushi/ripgrep
alias grep="rg"
### AD
# https://github.com/tanrax/terminal-AdvancedNewFile
alias add="python3 ~/Library/Python/3.9/lib/python/site-packages/advance_touch.py"
### RACCOURCIS
alias docker="sudo docker" # Pas bien mais pratique
alias w="watch "
alias nano="micro" # Question d'habitudes ...
alias swift="/usr/local/bin/swift"
### Debian environnment
#
alias debian="~/kDrive/scripts/debian.sh"
### MacOS Update
#
alias macos_update="~/kDrive/scripts/macos_update.sh"
### TIPEE
# (Voir projet interne Infomaniak)
export TIPEE_USERNAME=''
export TIPEE_PASSWORD=''
alias tipee="python3 ~/Documents/python-tipee/ti.py"
### OTHERS
export OPENCV_LOG_LEVEL=ERROR
export DEFAULT_USER=papamica
### OpenStack
alias openstack-delete-all="openstack server list | awk '$2 && $2 != \"ID\" {print $2}' | xargs -n1 openstack server delete"
alias openstack="openstack --os-compute-api-version 2.79"
alias osl="openstack --os-compute-api-version 2.79 server list --fit-width"
o() { openstack --os-compute-api-version 2.79 "$@" --fit-width ;}
oss() { openstack --os-compute-api-version 2.79 server show "$@" --fit-width ;}
### Git
gic() { eval 'git add . && git commit -a -m "'$@'" && git push'}
gbc() { eval 'git pull && git checkout -b '$@' && git push --set-upstream origin '$@''}
gweb() { git remote -v | head -n 1 | awk -F "@" '{print $2}' | awk -F " " '{print $1}' | sed 's/:/\//g' | sed 's/.git//g' | awk '{print "http://"$1}' | xargs open }
alias gaa="git add *"
alias ga="git add"
alias gps="git push"
alias gpl="git pull"