2015-04-25 01:43:59 +02:00
|
|
|
#man zshzle
|
|
|
|
#man zshcontrib
|
2009-11-13 12:00:50 +01:00
|
|
|
# Lines configured by zsh-newuser-install
|
2020-01-16 12:32:53 +01:00
|
|
|
export HISTFILE=~/.histfile
|
2020-10-02 11:12:27 +02:00
|
|
|
export HISTSIZE=1000000
|
|
|
|
export SAVEHIST=1000000
|
2009-11-13 12:00:50 +01:00
|
|
|
export HISTTIMEFORMAT="%h/%d - %H:%M:%S "
|
2010-04-15 13:57:16 +02:00
|
|
|
#export HISTCONTROL=ignoredups
|
|
|
|
export HISTCONTROL=erasedups
|
|
|
|
|
2020-10-02 11:12:27 +02:00
|
|
|
setopt EXTENDED_HISTORY # Write the history file in the ":start:elapsed;command" format.
|
|
|
|
setopt INC_APPEND_HISTORY # Write to the history file immediately, not when the shell exits.
|
2020-10-07 11:53:49 +02:00
|
|
|
#setopt SHARE_HISTORY # Share history between all sessions.
|
2020-10-02 11:12:27 +02:00
|
|
|
setopt HIST_EXPIRE_DUPS_FIRST # Expire duplicate entries first when trimming history.
|
|
|
|
setopt HIST_IGNORE_DUPS # Don't record an entry that was just recorded again.
|
|
|
|
setopt HIST_IGNORE_ALL_DUPS # Delete old recorded entry if new entry is a duplicate.
|
|
|
|
#setopt HIST_FIND_NO_DUPS # Do not display a line previously found.
|
|
|
|
setopt HIST_IGNORE_SPACE # Don't record an entry starting with a space.
|
|
|
|
#setopt HIST_SAVE_NO_DUPS # Don't write duplicate entries in the history file.
|
|
|
|
#setopt HIST_REDUCE_BLANKS # Remove superfluous blanks before recording entry.
|
|
|
|
#setopt HIST_VERIFY # Don't execute immediately upon history expansion.
|
|
|
|
#setopt HIST_BEEP # Beep when accessing nonexistent history.
|
|
|
|
|
|
|
|
|
2009-11-13 12:00:50 +01:00
|
|
|
#export HISTIGNORE=”&:ls:[bf]g:exit”
|
|
|
|
setopt -h histappend
|
|
|
|
PROMPT_COMMAND='history -a'
|
|
|
|
|
2010-03-29 17:09:48 +02:00
|
|
|
setopt append_history autocd extendedglob nomatch
|
2014-08-02 01:08:24 +02:00
|
|
|
setopt hist_ignore_dups # ignore duplication command history list
|
|
|
|
setopt hist_ignore_space # ignore line starting by a space
|
2014-08-11 14:22:26 +02:00
|
|
|
#setopt share_history # share command history data
|
2010-11-24 17:52:25 +01:00
|
|
|
|
2015-04-25 01:43:59 +02:00
|
|
|
# Use 'cat -v' to obtain the keycodes
|
|
|
|
bindkey "\C-b" backward-word ## ctrl-b
|
|
|
|
bindkey "\C-f" forward-word ## ctrl-f
|
|
|
|
bindkey "^[[3~" delete-char ## Del
|
|
|
|
bindkey "^[[7~" beginning-of-line ## Home
|
|
|
|
bindkey "^[[8~" end-of-line ## End
|
|
|
|
bindkey " " magic-space ## do history expansion on space (after ! or ^)
|
2014-08-02 01:08:24 +02:00
|
|
|
bindkey '^[[1;5C' forward-word # [Ctrl-RightArrow] - move forward one word
|
|
|
|
bindkey '^[[1;5D' backward-word # [Ctrl-LeftArrow] - move backward one word
|
2010-11-24 17:52:25 +01:00
|
|
|
|
2015-04-25 01:43:59 +02:00
|
|
|
#History on Key Up/Down
|
|
|
|
autoload -U up-line-or-beginning-search
|
|
|
|
autoload -U down-line-or-beginning-search
|
|
|
|
zle -N up-line-or-beginning-search
|
|
|
|
zle -N down-line-or-beginning-search
|
|
|
|
bindkey "^[[A" up-line-or-beginning-search # Up
|
|
|
|
bindkey "^[[B" down-line-or-beginning-search # Down
|
|
|
|
#bindkey "^[[A" history-search-backward
|
|
|
|
#bindkey "^[[B" history-search-forward
|
|
|
|
#bindkey "^[[A" up-line-or-search ## up arrow for back-history-search
|
|
|
|
#bindkey "^[[B" down-line-or-search ## down arrow for fwd-history-search
|
|
|
|
|
2009-11-13 12:00:50 +01:00
|
|
|
unsetopt beep
|
2010-04-22 16:26:09 +02:00
|
|
|
#force emacs binding for tmux && screen
|
|
|
|
bindkey -e
|
2009-11-13 12:00:50 +01:00
|
|
|
|
|
|
|
# Completion for bash fonctions
|
|
|
|
autoload -U bashcompinit
|
|
|
|
bashcompinit
|
|
|
|
|
|
|
|
# Correct for wrong command like sl
|
2013-09-09 11:21:22 +02:00
|
|
|
setopt correct
|
|
|
|
#correct arg as well
|
|
|
|
#setopt correctall
|
2009-11-13 12:00:50 +01:00
|
|
|
|
|
|
|
# Activate Prompt
|
|
|
|
autoload -U promptinit
|
|
|
|
promptinit
|
2010-04-26 10:34:09 +02:00
|
|
|
#prompt adam1
|
2010-03-01 21:09:04 +01:00
|
|
|
prompt bart
|
2009-11-13 12:00:50 +01:00
|
|
|
|
2009-11-20 13:32:16 +01:00
|
|
|
|
|
|
|
# pushd pour cd
|
|
|
|
setopt autopushd
|
2014-08-02 01:08:24 +02:00
|
|
|
setopt pushd_ignore_dups
|
2009-11-20 13:32:16 +01:00
|
|
|
# ne tue pas les processus quand zsh quitte
|
2009-12-18 11:43:05 +01:00
|
|
|
#setopt nohup
|
2009-11-20 13:32:16 +01:00
|
|
|
# auto cd avec le nom du dossier
|
|
|
|
setopt autocd
|
|
|
|
|
2009-11-13 12:00:50 +01:00
|
|
|
#Un grep avec des couleurs :
|
2014-08-02 01:08:24 +02:00
|
|
|
#export GREP_COLOR=31
|
|
|
|
#alias grep='grep --color=auto'
|
2015-01-14 15:31:09 +01:00
|
|
|
GREP_OPT="--color=auto"
|
2014-08-02 01:08:24 +02:00
|
|
|
|
|
|
|
# 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
|
2015-01-14 15:31:09 +01:00
|
|
|
GREP_OPT+=" --exclude-dir=$PATTERN"
|
2014-08-02 01:08:24 +02:00
|
|
|
done
|
|
|
|
elif grep-flag-available --exclude=.cvs; then
|
|
|
|
for PATTERN in .cvs .git .hg .svn; do
|
2015-01-14 15:31:09 +01:00
|
|
|
GREP_OPT+=" --exclude=$PATTERN"
|
2014-08-02 01:08:24 +02:00
|
|
|
done
|
|
|
|
fi
|
|
|
|
unfunction grep-flag-available
|
|
|
|
|
2015-01-14 15:31:09 +01:00
|
|
|
#export GREP_OPTIONS="$GREP_OPTIONS"
|
2014-08-02 01:08:24 +02:00
|
|
|
export GREP_COLOR='1;31'
|
2015-01-14 15:31:09 +01:00
|
|
|
alias grep="grep $GREP_OPT"
|
2014-08-02 01:08:24 +02:00
|
|
|
|
|
|
|
|
2009-11-13 12:00:50 +01:00
|
|
|
|
2014-08-11 14:50:25 +02:00
|
|
|
# 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
|
2009-11-13 12:00:50 +01:00
|
|
|
|
2010-10-04 17:47:46 +02:00
|
|
|
if [ -f "${HOME}/.gpg-agent-info" ]; then
|
|
|
|
. "${HOME}/.gpg-agent-info"
|
|
|
|
export GPG_AGENT_INFO
|
|
|
|
export SSH_AUTH_SOCK
|
|
|
|
export SSH_AGENT_PID
|
|
|
|
fi
|
|
|
|
|