dotfiles.pub/_zshrc

47 lines
943 B
Text
Executable file

#
# ~/.zshrc
#
#
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
[ -f ~/.bashrc ] && source ~/.bashrc
HISTFILE=~/.zsh_histfile
HISTSIZE=1000
SAVEHIST=1000
setopt appendhistory extendedglob nomatch
unsetopt autocd beep notify
zstyle ':completion:*' menu select
zstyle ':completion:*' max-errors 5
setopt COMPLETE_ALIASES
autoload -Uz compinit
compinit
# vim mode with editor in command line
bindkey -v
autoload edit-command-line
zle -N edit-command-line
zle -N zle-keymap-select
zle -N zle-line-init
zle -N zle-line-finish
bindkey -M vicmd v edit-command-line
function zle-keymap-select zle-line-init zle-line-finish () {
if [ $KEYMAP = vicmd ]; then
echo -ne "\e[2 q"
else
echo -ne "\e[6 q"
fi
}
export PS1="
%{$(tput bold)%}%{$(tput setaf 1)%}[%{$(tput setaf 3)%}%n%{$(tput setaf 2)%}@%{$(tput setaf 4)%}%M %{$(tput setaf 5)%}%~%{$(tput setaf 1)%}]%{$(tput setaf 7)%}
$ %{$(tput sgr0)%}"