zsh: the simplest prompt acceptable
This commit is contained in:
parent
cf06ab16e3
commit
488425ee01
1 changed files with 11 additions and 8 deletions
19
zshrc
19
zshrc
|
@ -7,10 +7,10 @@ stty -ixon
|
||||||
setopt APPEND_HISTORY EXTENDED_HISTORY HIST_IGNORE_DUPS EXTENDED_GLOB AUTO_CD AUTO_PUSHD PRINT_EXIT_VALUE
|
setopt APPEND_HISTORY EXTENDED_HISTORY HIST_IGNORE_DUPS EXTENDED_GLOB AUTO_CD AUTO_PUSHD PRINT_EXIT_VALUE
|
||||||
unsetopt BEEP NO_MATCH NOTIFY MENU_COMPLETE AUTO_MENU
|
unsetopt BEEP NO_MATCH NOTIFY MENU_COMPLETE AUTO_MENU
|
||||||
|
|
||||||
|
bindkey -e
|
||||||
bindkey $terminfo[kdch1] delete-char
|
bindkey $terminfo[kdch1] delete-char
|
||||||
bindkey $terminfo[khome] beginning-of-line
|
bindkey $terminfo[khome] beginning-of-line
|
||||||
bindkey $terminfo[kend] end-of-line
|
bindkey $terminfo[kend] end-of-line
|
||||||
bindkey '^[' vi-cmd-mode
|
|
||||||
|
|
||||||
SAVEHIST=1000
|
SAVEHIST=1000
|
||||||
HISTSIZE=1000
|
HISTSIZE=1000
|
||||||
|
@ -43,17 +43,20 @@ zstyle ':completion:*:processes-names' command 'ps axho command'
|
||||||
zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
|
zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
|
||||||
# }}}
|
# }}}
|
||||||
# {{{ prompt
|
# {{{ prompt
|
||||||
prompt_fmt='%%k%%f[ %s %s:%s ]\n%s '
|
prompt_user='%(!.%F{red}%n%f@.)'
|
||||||
prompt_fmtn='%%k%%f[ %%{\e[2;3m%s\e[0m%%} ]%s '
|
style_reset='%%{\e[0m%%}'
|
||||||
prompt_user='%F{%(!.red.blue)}%n%f'
|
style_gital='%%{\e[2;3m%%}'
|
||||||
|
#prompt_user='%F{%(!.red.blue)}%n%f'
|
||||||
prompt_host='%m'
|
prompt_host='%m'
|
||||||
prompt_cwd='%F{green}%d%f'
|
prompt_cwd='%F{blue}%2~%f'
|
||||||
prompt_bang='>'
|
prompt_bang='%#'
|
||||||
|
prompt_fmt="${style_reset}[ %s%s %s ]%s "
|
||||||
|
prompt_fmtn="${style_reset}[ $style_gital%s$style_reset ]%s "
|
||||||
|
|
||||||
function zle-line-init zle-keymap-select {
|
function zle-line-init zle-keymap-select {
|
||||||
case $KEYMAP in
|
case $KEYMAP in
|
||||||
(vicmd) prompt_bang='%F{blue}!%f';;
|
(vicmd) prompt_bang='_';;
|
||||||
(main) prompt_bang='>';;
|
(main) prompt_bang='#';;
|
||||||
esac
|
esac
|
||||||
printf -v PROMPT $prompt_fmt $prompt_user $prompt_host $prompt_cwd $prompt_bang
|
printf -v PROMPT $prompt_fmt $prompt_user $prompt_host $prompt_cwd $prompt_bang
|
||||||
printf -v PROMPT2 $prompt_fmtn '%_' $prompt_bang
|
printf -v PROMPT2 $prompt_fmtn '%_' $prompt_bang
|
||||||
|
|
Loading…
Reference in a new issue