Improve zsh behaviour
This commit is contained in:
parent
87e3fd03ca
commit
40532e1bc6
1 changed files with 39 additions and 27 deletions
|
@ -15,23 +15,28 @@ then
|
|||
alias shopt=false
|
||||
fi
|
||||
|
||||
if [ -f /etc/bashrc ]
|
||||
if [ -n "$BASH_VERSION" ]
|
||||
then
|
||||
. /etc/bashrc
|
||||
fi
|
||||
|
||||
if [ -f /usr/share/bash-completion/bash_completion ]
|
||||
then
|
||||
. /usr/share/bash-completion/bash_completion
|
||||
elif [ -f /etc/bash_completion ]
|
||||
then
|
||||
. /etc/bash_completion
|
||||
fi
|
||||
if [ -f /etc/bashrc ]
|
||||
then
|
||||
. /etc/bashrc
|
||||
fi
|
||||
|
||||
if [ -f /usr/share/bash-completion/bash_completion ]
|
||||
then
|
||||
. /usr/share/bash-completion/bash_completion
|
||||
elif [ -f /etc/bash_completion ]
|
||||
then
|
||||
. /etc/bash_completion
|
||||
fi
|
||||
|
||||
if [ -f /usr/share/bash-completion/completions/quilt ]
|
||||
then
|
||||
. /usr/share/bash-completion/completions/quilt
|
||||
complete -F _quilt_completion -o filenames dquilt
|
||||
fi
|
||||
|
||||
if [ -f /usr/share/bash-completion/completions/quilt ]
|
||||
then
|
||||
. /usr/share/bash-completion/completions/quilt
|
||||
complete -F _quilt_completion -o filenames dquilt
|
||||
fi
|
||||
|
||||
_acp_add_path () {
|
||||
|
@ -88,7 +93,7 @@ export PAPERSIZE=a4
|
|||
export POWERSHELL_TELEMETRY_OPTOUT=1
|
||||
export PYTHONWARNINGS=ignore::UserWarning
|
||||
|
||||
if [ "x$(uname -s)" = "xDarwin" ]
|
||||
if [ x$(uname -s) = xDarwin ]
|
||||
then
|
||||
export BASH_SILENCE_DEPRECATION_WARNING=1
|
||||
fi
|
||||
|
@ -115,25 +120,32 @@ then
|
|||
export QT_FONT_DPI=72
|
||||
fi
|
||||
|
||||
shopt -s histappend
|
||||
bind '"\e[1;5C": forward-word'
|
||||
bind '"\e[1;5D": backward-word'
|
||||
bind '"\e[A": history-search-backward'
|
||||
bind '"\e[B": history-search-forward'
|
||||
bind 'set bell-style none'
|
||||
bind 'set completion-ignore-case on'
|
||||
bind 'set enable-bracketed-paste off'
|
||||
|
||||
if [ -n "$ZSH_VERSION" ]
|
||||
if [ -n "$BASH_VERSION" ]
|
||||
then
|
||||
shopt -s histappend
|
||||
bind '"\e[1;5C": forward-word'
|
||||
bind '"\e[1;5D": backward-word'
|
||||
bind '"\e[A": history-search-backward'
|
||||
bind '"\e[B": history-search-forward'
|
||||
bind 'set bell-style none'
|
||||
bind 'set completion-ignore-case on'
|
||||
bind 'set enable-bracketed-paste off'
|
||||
elif [ -n "$ZSH_VERSION" ]
|
||||
then
|
||||
bindkey "^[[A" history-beginning-search-backward
|
||||
bindkey "^[[B" history-beginning-search-forward
|
||||
fi
|
||||
|
||||
export PS1="\[\033[01m\]\u@\h\\$\[\033[00m\] "
|
||||
if [ -n "$ZSH_VERSION" ]
|
||||
# Set the prompt for various shells. The prompt should look like "user@host$ "
|
||||
# or similar, except for the fallback of "$ " for anything it can't detect.
|
||||
if [ -n "$BASH_VERSION" ]
|
||||
then
|
||||
export PS1="\[\033[01m\]\u@\h\\$\[\033[00m\] "
|
||||
elif [ -n "$ZSH_VERSION" ]
|
||||
then
|
||||
export PS1="%B%n@%m%#%b "
|
||||
else
|
||||
export PS1="$ "
|
||||
fi
|
||||
|
||||
if test $(id -u) -ne 0 && test -x /usr/bin/dnf
|
||||
|
|
Loading…
Reference in a new issue