config/.zsh/00_basic.zsh
Mathieu Maret 81f0a3dc73 [zsh] do not use GREP_OPTIONS
GREP_OPTIONS is now depracated, use alias instead
2015-06-30 15:49:18 +02:00

91 lines
2.2 KiB
Bash

# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=10000
SAVEHIST=10000
export HISTTIMEFORMAT="%h/%d - %H:%M:%S "
#export HISTCONTROL=ignoredups
export HISTCONTROL=erasedups
#export HISTIGNORE=”&:ls:[bf]g:exit”
setopt -h histappend
PROMPT_COMMAND='history -a'
setopt append_history autocd extendedglob nomatch
setopt hist_ignore_dups # ignore duplication command history list
setopt hist_ignore_space # ignore line starting by a space
#setopt share_history # share command history data
#Doing this, only past commands beginning with the current input would've been shown.
bindkey "^[[A" history-search-backward
bindkey "^[[B" history-search-forward
bindkey '^[[1;5C' forward-word # [Ctrl-RightArrow] - move forward one word
bindkey '^[[1;5D' backward-word # [Ctrl-LeftArrow] - move backward one word
unsetopt beep
#force emacs binding for tmux && screen
bindkey -e
# Completion for bash fonctions
autoload -U bashcompinit
bashcompinit
# Correct for wrong command like sl
setopt correct
#correct arg as well
#setopt correctall
# Activate Prompt
autoload -U promptinit
promptinit
#prompt adam1
prompt bart
# pushd pour cd
setopt autopushd
setopt pushd_ignore_dups
# ne tue pas les processus quand zsh quitte
#setopt nohup
# auto cd avec le nom du dossier
setopt autocd
#Un grep avec des couleurs :
#export GREP_COLOR=31
#alias grep='grep --color=auto'
GREP_OPT="--color=auto"
# avoid VCS folders (if the necessary grep flags are available)
grep-flag-available() {
echo | grep $1 "" >/dev/null 2>&1
}
if grep-flag-available --exclude-dir=.cvs; then
for PATTERN in .cvs .git .hg .svn; do
GREP_OPT+=" --exclude-dir=$PATTERN"
done
elif grep-flag-available --exclude=.cvs; then
for PATTERN in .cvs .git .hg .svn; do
GREP_OPT+=" --exclude=$PATTERN"
done
fi
unfunction grep-flag-available
#export GREP_OPTIONS="$GREP_OPTIONS"
export GREP_COLOR='1;31'
alias grep="grep $GREP_OPT"
# mimes type support e.g: ./toto.pdf
# /!\ zsh-mime-setup is slow !
#autoload -U zsh-mime-setup
#autoload -U zsh-mime-handler
#zsh-mime-setup
if [ -f "${HOME}/.gpg-agent-info" ]; then
. "${HOME}/.gpg-agent-info"
export GPG_AGENT_INFO
export SSH_AUTH_SOCK
export SSH_AGENT_PID
fi