Skip to content

Instantly share code, notes, and snippets.

@gbarre
Last active January 9, 2024 15:34
Show Gist options
  • Save gbarre/9747879489542280fc9043d272e130ca to your computer and use it in GitHub Desktop.
Save gbarre/9747879489542280fc9043d272e130ca to your computer and use it in GitHub Desktop.
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block, everything else may go below.
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
# User configuration
export PATH=/usr/local/bin:$PATH
export PATH="/opt/local/bin:/opt/local/sbin:$PATH"
export PATH="/usr/local/opt/ncurses/bin:$PATH"
export PATH=$PATH:/usr/local/go/bin:~/go/bin
export PATH=$PATH:~/apps
export PATH=$PATH:~/bin
export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH"
export PATH="${PATH}:${HOME}/npm/bin"
export PATH=~/.npm-global/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH=$HOME"/.oh-my-zsh"
ZSH_THEME="powerlevel10k/powerlevel10k"
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
POWERLEVEL9K_BATTERY_CHARGING='yellow'
POWERLEVEL9K_BATTERY_CHARGED='green'
POWERLEVEL9K_BATTERY_DISCONNECTED='$DEFAULT_COLOR'
POWERLEVEL9K_BATTERY_LOW_THRESHOLD='10'
POWERLEVEL9K_BATTERY_LOW_COLOR='red'
POWERLEVEL9K_BATTERY_ICON='\uf1e6'
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir vcs dir_writable virtualenv newline)
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status background_jobs context time battery)
HIST_STAMPS="yyyy-mm-dd"
DISABLE_UPDATE_PROMPT=true
# Which plugins would you like to load?
# Standard plugins can be found in ~/.oh-my-zsh/plugins/*
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(
common-aliases
copyfile
docker
emoji-clock
encode64
extract
git
gitignore
kubectl
nmap
sudo
zsh-autosuggestions
)
source $ZSH/oh-my-zsh.sh
export EDITOR='vim'
export HISTSIZE=10000
export HISTCONTROL=erasedups
# https://www.cyberciti.biz/faq/unix-linux-color-man-pages-configuration/
export PAGER="most"
TIMEFMT=$'\n================\nCPU\t%P\nuser\t%*U\nsystem\t%*S\ntotal\t%*E'
autoload -U compinit && compinit
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
### list
alias ls='colorls --sort-dirs --report'
alias lt='colorls --tree'
alias ll='ls -l'
alias la='ls -lah'
alias grep='grep --exclude-dir=.git --color -i'
alias rgrep='grep -rn --exclude-dir=node_modules --exclude-dir=venv --exclude-dir=htmlcov --exclude-dir=.tox --exclude-dir=.git --exclude-dir=.angular'
### git
alias gcav='git commit -av'
date=$(date '+%Y-%m-%d %H:%M:%S')
alias gpom='git push origin main'
alias gcpom="git commit -a -m \"Update $date\" && gpom"
alias gpa='git push all'
alias gs='git status'
### ssh
alias foossh="ssh -o GSSAPIAuthentication=no -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedKeyTypes=+ssh-rsa"
alias foofoossh="ssh -o GSSAPIAuthentication=no -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedKeyTypes=+ssh-rsa -oKexAlgorithms=+diffie-hellman-group1-sha1 -c aes256-cbc"
alias unsafessh="ssh -o GSSAPIAuthentication=no -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedKeyTypes=+ssh-rsa -o LogLevel=ERROR"
### func
alias open='xdg-open'
alias pbcopy='xclip -selection clipboard'
alias pbpaste='xclip -selection clipboard -o'
alias getUpdate="sudo apt update && sudo apt list --upgradable"
alias doUpgrade="sudo apt dist-upgrade -y && sudo apt autoremove"
### ansible
alias ansible-dsi='launch-ansible -w . -v ~/.ansible/vault.dsi -u --dns=172.31.33.21 --dns-search=in.ac-versailles.fr --docker-name=ansible-dsi '
### divers
alias ds='dig +short'
## cleanup
unset myGitsDir
unset myGitScriptsDir
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment