2019-10-03 21:28:01 +00:00
|
|
|
# If you come from bash you might have to change your $PATH.
|
|
|
|
# export PATH=$HOME/bin:/usr/local/bin:$PATH
|
|
|
|
|
|
|
|
# Path to your oh-my-zsh installation.
|
|
|
|
export ZSH="${HOME}/.oh-my-zsh"
|
|
|
|
|
|
|
|
# Set name of the theme to load --- if set to "random", it will
|
|
|
|
# load a random theme each time oh-my-zsh is loaded, in which case,
|
|
|
|
# to know which specific one was loaded, run: echo $RANDOM_THEME
|
|
|
|
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
|
|
|
|
ZSH_THEME="powerlevel10k/powerlevel10k"
|
|
|
|
|
|
|
|
# Set list of themes to pick from when loading at random
|
|
|
|
# Setting this variable when ZSH_THEME=random will cause zsh to load
|
|
|
|
# a theme from this variable instead of looking in ~/.oh-my-zsh/themes/
|
|
|
|
# If set to an empty array, this variable will have no effect.
|
|
|
|
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )
|
|
|
|
|
|
|
|
# Uncomment the following line to use case-sensitive completion.
|
|
|
|
# CASE_SENSITIVE="true"
|
|
|
|
|
|
|
|
# Uncomment the following line to use hyphen-insensitive completion.
|
|
|
|
# Case-sensitive completion must be off. _ and - will be interchangeable.
|
|
|
|
# HYPHEN_INSENSITIVE="true"
|
|
|
|
|
|
|
|
# Uncomment the following line to disable bi-weekly auto-update checks.
|
|
|
|
# DISABLE_AUTO_UPDATE="true"
|
|
|
|
|
|
|
|
# Uncomment the following line to automatically update without prompting.
|
|
|
|
# DISABLE_UPDATE_PROMPT="true"
|
|
|
|
|
|
|
|
# Uncomment the following line to change how often to auto-update (in days).
|
|
|
|
# export UPDATE_ZSH_DAYS=13
|
|
|
|
|
|
|
|
# Uncomment the following line if pasting URLs and other text is messed up.
|
|
|
|
# DISABLE_MAGIC_FUNCTIONS=true
|
|
|
|
|
|
|
|
# Uncomment the following line to disable colors in ls.
|
|
|
|
# DISABLE_LS_COLORS="true"
|
|
|
|
|
|
|
|
# Uncomment the following line to disable auto-setting terminal title.
|
|
|
|
# DISABLE_AUTO_TITLE="true"
|
|
|
|
|
|
|
|
# Uncomment the following line to enable command auto-correction.
|
|
|
|
# ENABLE_CORRECTION="true"
|
|
|
|
|
|
|
|
# Uncomment the following line to display red dots whilst waiting for completion.
|
|
|
|
# COMPLETION_WAITING_DOTS="true"
|
|
|
|
|
|
|
|
# Uncomment the following line if you want to disable marking untracked files
|
|
|
|
# under VCS as dirty. This makes repository status check for large repositories
|
|
|
|
# much, much faster.
|
|
|
|
# DISABLE_UNTRACKED_FILES_DIRTY="true"
|
|
|
|
|
|
|
|
# Uncomment the following line if you want to change the command execution time
|
|
|
|
# stamp shown in the history command output.
|
|
|
|
# You can set one of the optional three formats:
|
|
|
|
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
|
|
|
|
# or set a custom format using the strftime function format specifications,
|
|
|
|
# see 'man strftime' for details.
|
|
|
|
# HIST_STAMPS="mm/dd/yyyy"
|
|
|
|
|
|
|
|
# Would you like to use another custom folder than $ZSH/custom?
|
|
|
|
# ZSH_CUSTOM=/path/to/new-custom-folder
|
|
|
|
|
|
|
|
# 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.
|
2024-11-17 13:22:11 +00:00
|
|
|
plugins=(git httpie ng npm nvm pass pip sudo wd pyenv kubectl helm terraform)
|
2019-10-03 21:28:01 +00:00
|
|
|
|
|
|
|
source $ZSH/oh-my-zsh.sh
|
|
|
|
|
|
|
|
# powerlevel10k configuration
|
|
|
|
POWERLEVEL9K_SHORTEN_DIR_LENGTH=1
|
|
|
|
POWERLEVEL9K_SHORTEN_DELIMITER=""
|
|
|
|
POWERLEVEL9K_SHORTEN_STRATEGY="truncate_from_right"
|
|
|
|
|
2024-11-29 19:56:49 +00:00
|
|
|
#compdef gitlab-ci-local
|
|
|
|
###-begin-gitlab-ci-local-completions-###
|
|
|
|
#
|
|
|
|
# yargs command completion script
|
|
|
|
#
|
|
|
|
# Installation: gitlab-ci-local completion >> ~/.zshrc
|
|
|
|
# or gitlab-ci-local completion >> ~/.zprofile on OSX.
|
|
|
|
#
|
|
|
|
_gitlab-ci-local_yargs_completions()
|
|
|
|
{
|
|
|
|
local reply
|
|
|
|
local si=$IFS
|
|
|
|
IFS=$'
|
|
|
|
' reply=($(COMP_CWORD="$((CURRENT-1))" COMP_LINE="$BUFFER" COMP_POINT="$CURSOR" gitlab-ci-local --get-yargs-completions "${words[@]}"))
|
|
|
|
IFS=$si
|
|
|
|
_describe 'values' reply
|
|
|
|
}
|
|
|
|
compdef _gitlab-ci-local_yargs_completions gitlab-ci-local
|
|
|
|
###-end-gitlab-ci-local-completions-###
|
|
|
|
|
2019-10-03 21:28:01 +00:00
|
|
|
# User configuration
|
|
|
|
export PAGER=most
|
|
|
|
export BROWSER=elinks
|
|
|
|
export SSH_ASKPASS=qt4-ssh-askpass
|
|
|
|
export AUTEUR="Olivier DOSSMANN"
|
|
|
|
export DEFAULT_USER="od"
|
2020-01-20 13:37:19 +00:00
|
|
|
export PYTHONWARNINGS="ignore::DeprecationWarning"
|
2020-05-14 15:15:06 +00:00
|
|
|
#export FLASK_SKIP_DOTENV=1 ## make problems with poetry and flask applications
|
2020-01-31 13:38:00 +00:00
|
|
|
export PIPENV_QUIET=1 # enlève les courtesy notice
|
|
|
|
export ENABLE_WARNINGS=false # enlève les warnings dans le setup RERO-ils
|
2024-10-17 09:43:38 +00:00
|
|
|
export KUBECONFIG=$HOME/kubeconfig
|
2019-10-03 21:28:01 +00:00
|
|
|
|
|
|
|
# You may need to manually set your language environment
|
|
|
|
export LANG=fr_FR.UTF-8
|
|
|
|
|
|
|
|
# Preferred editor for local and remote sessions
|
|
|
|
if [[ -n $SSH_CONNECTION ]]; then
|
|
|
|
export EDITOR='vim'
|
|
|
|
else
|
|
|
|
export EDITOR='nvim'
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Enlève le prompt de droite après avoir appuyé sur Entrée
|
|
|
|
setopt transient_rprompt
|
|
|
|
|
|
|
|
# Compilation flags
|
|
|
|
# export ARCHFLAGS="-arch x86_64"
|
|
|
|
|
|
|
|
# Set personal aliases, overriding those provided by oh-my-zsh libs,
|
|
|
|
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
|
|
|
|
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
|
|
|
|
# For a full list of active aliases, run `alias`.
|
|
|
|
#
|
|
|
|
# Example aliases
|
|
|
|
# alias zshconfig="mate ~/.zshrc"
|
|
|
|
# alias ohmyzsh="mate ~/.oh-my-zsh"
|
|
|
|
alias e="${EDITOR}"
|
2019-10-29 15:25:55 +00:00
|
|
|
alias r="${EDITOR} -R"
|
2019-12-14 15:30:12 +00:00
|
|
|
alias sm="sublime_merge"
|
2019-10-03 21:28:01 +00:00
|
|
|
alias vi="${EDITOR}"
|
|
|
|
alias mem='free -mt'
|
|
|
|
alias df='df -hT'
|
|
|
|
alias ls='exa'
|
|
|
|
alias ll='exa -l'
|
|
|
|
alias l='exa -F'
|
|
|
|
alias rgrep='rg --no-ignore'
|
|
|
|
export GREP_COLORS='ms=01;33:mc=01;33:s1=:cx=:fn=37;ln=32:bn=32:se=36'
|
|
|
|
alias diff='colordiff'
|
|
|
|
alias dotfiles='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'
|
|
|
|
# évite de faire des erreurs
|
|
|
|
alias rm='rm -i'
|
|
|
|
alias cp='cp -i'
|
|
|
|
alias grep='grep --color'
|
|
|
|
# requêtes
|
|
|
|
alias https='http --verify=no --default-scheme=https'
|
|
|
|
# pytest
|
2020-05-21 13:06:15 +00:00
|
|
|
alias pyt='poetry run pytest -vvs --no-cov --disable-warnings'
|
|
|
|
alias pytc='poetry run pytest -vvs --disable-warnings --cov-report=xml:cov.xml'
|
2020-03-06 09:37:00 +00:00
|
|
|
# projet rero
|
2021-06-10 06:37:51 +00:00
|
|
|
alias rero="ALIAS=rero /home/od/projets/rerologik/agnes"
|
2024-10-17 09:43:21 +00:00
|
|
|
# coloration de la commande IP
|
2021-12-05 05:15:04 +00:00
|
|
|
alias ip='ip -c'
|
2024-10-20 12:45:34 +00:00
|
|
|
alias k='kubectl'
|
2024-11-29 19:56:49 +00:00
|
|
|
alias devu="${HOME}/devu/devu/devu"
|
|
|
|
alias gcle='gitlab-ci-local'
|
2019-10-03 21:28:01 +00:00
|
|
|
|
|
|
|
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
|
|
|
|
[[ -f ~/.p10k.zsh ]] && source ~/.p10k.zsh
|
|
|
|
|
|
|
|
# Connexion automatique
|
|
|
|
mkdir -p "${HOME}/etc/ssh";
|
|
|
|
function ssh-procure-launch-agent {
|
|
|
|
eval `ssh-agent -s -a ~/etc/ssh/ssh-agent-socket`;
|
|
|
|
ssh-add;
|
|
|
|
}
|
|
|
|
|
|
|
|
if [ ! $SSH_AGENT_PID ]; then
|
|
|
|
if [ -e ~/etc/ssh/ssh-agent-socket ] ; then
|
|
|
|
SSH_AGENT_PID=`ps -fC ssh-agent |grep 'etc/ssh/ssh-agent-socket' |sed -r 's/^\S+\s+(\S+).*$/\1/'`;
|
|
|
|
if [[ $SSH_AGENT_PID =~ [0-9]+ ]]; then
|
|
|
|
# in this case the agent has already been launched and we are just attaching to it.
|
|
|
|
##++ It should check that this pid is actually active & belongs to an ssh instance
|
|
|
|
export SSH_AGENT_PID;
|
|
|
|
SSH_AUTH_SOCK=~/etc/ssh/ssh-agent-socket; export SSH_AUTH_SOCK;
|
|
|
|
else
|
|
|
|
# in this case there is no agent running, so the socket file is left over from a graceless agent termination.
|
|
|
|
rm ~/etc/ssh/ssh-agent-socket;
|
|
|
|
ssh-procure-launch-agent;
|
|
|
|
fi;
|
|
|
|
else
|
|
|
|
ssh-procure-launch-agent;
|
|
|
|
fi;
|
|
|
|
fi;
|
|
|
|
|
2020-01-20 13:37:19 +00:00
|
|
|
# Desktop specificities for development
|
2019-10-03 21:28:01 +00:00
|
|
|
case $HOST in
|
|
|
|
lueur | baloo | sam)
|
|
|
|
:
|
|
|
|
;;
|
|
|
|
*)
|
2020-01-20 13:37:19 +00:00
|
|
|
# nvm (for JS environment)
|
2019-10-03 21:28:01 +00:00
|
|
|
source /usr/share/nvm/init-nvm.sh
|
2020-01-20 13:37:19 +00:00
|
|
|
# Virtualenv (for Python development)
|
|
|
|
export WORKON_HOME=~/.virtualenvs
|
2024-10-20 19:05:01 +00:00
|
|
|
#source /usr/bin/virtualenvwrapper.sh
|
2019-10-03 21:28:01 +00:00
|
|
|
;;
|
|
|
|
esac
|
2024-11-29 19:56:49 +00:00
|
|
|
|