Move zsh prompt to zsh/prompt.sh

This commit is contained in:
Ivan Malison 2014-04-08 04:25:57 -07:00
parent 2e8a7c572c
commit 37dcb294bc
2 changed files with 15 additions and 17 deletions

View File

@ -11,20 +11,3 @@ autoload -U edit-command-line
zle -N edit-command-line
bindkey '\C-x\C-e' edit-command-line
setopt PROMPT_SUBST
function current_directory() {
local PWD=$(pwd)
echo "${PWD/#$HOME/~}"
}
function git_prompt_info () {
if test -z $(parse_git_branch);
then
echo ""
else
echo " %{$FG[239]%}on%{$reset_color%} %{$fg[255]%}$(parse_git_branch)%{$reset_color%}"
fi
}
PROMPT='%{$FG[040]%}%n%{$reset_color%} %{$FG[239]%}at%{$reset_color%} %{$FG[033]%}$(hostname -s)%{$reset_color%} %{$FG[239]%}in%{$reset_color%} %{$terminfo[bold]$FG[226]%}$(current_directory)%{$reset_color%}$(git_prompt_info) %{$FG[239]%}with $(colored_sandbox_string)%{$FG[255]%} '

View File

@ -0,0 +1,15 @@
function current_directory() {
local PWD=$(pwd)
echo "${PWD/#$HOME/~}"
}
function git_prompt_info () {
if test -z $(parse_git_branch);
then
echo ""
else
echo " %{$FG[239]%}on%{$reset_color%} %{$FG[255]%}$(parse_git_branch)%{$reset_color%}"
fi
}
PROMPT='%{$FG[040]%}%n%{$reset_color%} %{$FG[239]%}at%{$reset_color%} %{$FG[033]%}$(hostname -s)%{$reset_color%} %{$FG[239]%}in%{$reset_color%} %{$terminfo[bold]$FG[226]%}$(current_directory)%{$reset_color%}$(git_prompt_info) %{$FG[239]%}with $(colored_sandbox_string)%{$FG[255]%} '