[zsh] Update shell init: rc
This commit is contained in:
parent
b09d523218
commit
c30b46a88b
26 changed files with 479 additions and 462 deletions
37
zsh/func/init_rc_configure_prompt
Normal file
37
zsh/func/init_rc_configure_prompt
Normal file
|
@ -0,0 +1,37 @@
|
|||
#!/usr/bin/env zsh
|
||||
# Eryn Wells <eryn@erynwells.me>
|
||||
|
||||
function init_rc_configure_prompt
|
||||
{
|
||||
local theme=$1
|
||||
if [[ -z "$1" ]]; then
|
||||
theme=loquacious
|
||||
fi
|
||||
|
||||
shell-log -l debug 'Configuring vcs_info'
|
||||
|
||||
autoload -U add-zsh-hook
|
||||
autoload -Uz vcs_info
|
||||
|
||||
zstyle ':vcs_info:*' disable p4 bzr cdv darcs mtn svk tla cvs svn
|
||||
zstyle ':vcs_info:*' enable git
|
||||
zstyle ':vcs_info:git:general:*' formats '%b'
|
||||
|
||||
# Export the current Git branch before every prompt.
|
||||
function export_gitbranch {
|
||||
vcs_info general
|
||||
if [[ "$gitbranches[1]" != "${vcs_info_msg_0_}" ]]; then
|
||||
export gitbranches=(${vcs_info_msg_0_} $gitbranches[1,4])
|
||||
fi
|
||||
export gitbranch=${vcs_info_msg_0_}
|
||||
}
|
||||
|
||||
add-zsh-hook precmd export_gitbranch
|
||||
|
||||
shell-log "Configuring prompt with '$theme' theme"
|
||||
autoload -U promptinit
|
||||
promptinit
|
||||
prompt $theme
|
||||
}
|
||||
|
||||
init_rc_configure_prompt "$@"
|
Loading…
Add table
Add a link
Reference in a new issue