Added new vim colorscheme, updated prompt
Added smyck colorscheme, which I foud on reddit today. Also, copied the prompt from zholman's dotfiles
This commit is contained in:
@@ -16,7 +16,8 @@ setopt APPEND_HISTORY
|
||||
|
||||
setopt COMPLETE_ALIASES
|
||||
|
||||
export PS1='%3~ ☠ '
|
||||
#export PS1='%3~ ☠ '
|
||||
#export PS1='%3~$(git_info_for_prompt) ☠ '
|
||||
|
||||
# make terminal command navigation sane again
|
||||
bindkey '^[^[[D' backward-word
|
||||
|
||||
83
zsh/prompt.zsh
Normal file
83
zsh/prompt.zsh
Normal file
@@ -0,0 +1,83 @@
|
||||
autoload colors && colors
|
||||
# cheers, @ehrenmurdick
|
||||
# http://github.com/ehrenmurdick/config/blob/master/zsh/prompt.zsh
|
||||
|
||||
git_branch() {
|
||||
echo $(/usr/bin/git symbolic-ref HEAD 2>/dev/null | awk -F/ {'print $NF'})
|
||||
}
|
||||
|
||||
git_dirty() {
|
||||
st=$(/usr/bin/git status 2>/dev/null | tail -n 1)
|
||||
if [[ $st == "" ]]
|
||||
then
|
||||
echo ""
|
||||
else
|
||||
if [[ $st == "nothing to commit (working directory clean)" ]]
|
||||
then
|
||||
echo "on %{$fg_bold[green]%}$(git_prompt_info)%{$reset_color%}"
|
||||
else
|
||||
echo "on %{$fg_bold[red]%}$(git_prompt_info)%{$reset_color%}"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
git_prompt_info () {
|
||||
ref=$(/usr/bin/git symbolic-ref HEAD 2>/dev/null) || return
|
||||
# echo "(%{\e[0;33m%}${ref#refs/heads/}%{\e[0m%})"
|
||||
echo "${ref#refs/heads/}"
|
||||
}
|
||||
|
||||
unpushed () {
|
||||
/usr/bin/git cherry -v @{upstream} 2>/dev/null
|
||||
}
|
||||
|
||||
need_push () {
|
||||
if [[ $(unpushed) == "" ]]
|
||||
then
|
||||
echo " "
|
||||
else
|
||||
echo " with %{$fg_bold[magenta]%}unpushed%{$reset_color%} "
|
||||
fi
|
||||
}
|
||||
|
||||
rb_prompt(){
|
||||
if $(which rbenv &> /dev/null)
|
||||
then
|
||||
echo "%{$fg_bold[yellow]%}$(rbenv version | awk '{print $1}')%{$reset_color%}"
|
||||
else
|
||||
echo ""
|
||||
fi
|
||||
}
|
||||
|
||||
# This keeps the number of todos always available the right hand side of my
|
||||
# command line. I filter it to only count those tagged as "+next", so it's more
|
||||
# of a motivation to clear out the list.
|
||||
todo(){
|
||||
if $(which todo.sh &> /dev/null)
|
||||
then
|
||||
num=$(echo $(todo.sh ls +next | wc -l))
|
||||
let todos=num-2
|
||||
if [ $todos != 0 ]
|
||||
then
|
||||
echo "$todos"
|
||||
else
|
||||
echo ""
|
||||
fi
|
||||
else
|
||||
echo ""
|
||||
fi
|
||||
}
|
||||
|
||||
directory_name(){
|
||||
echo "%{$fg_bold[cyan]%}%1/%\/%{$reset_color%}"
|
||||
}
|
||||
|
||||
export PROMPT=$'\n$(rb_prompt) in $(directory_name) $(git_dirty)$(need_push)\n› '
|
||||
set_prompt () {
|
||||
export RPROMPT="%{$fg_bold[cyan]%}$(todo)%{$reset_color%}"
|
||||
}
|
||||
|
||||
precmd() {
|
||||
title "zsh" "%m" "%55<...<%~"
|
||||
set_prompt
|
||||
}
|
||||
19
zsh/window.zsh
Normal file
19
zsh/window.zsh
Normal file
@@ -0,0 +1,19 @@
|
||||
# From http://dotfiles.org/~_why/.zshrc
|
||||
# Sets the window title nicely no matter where you are
|
||||
function title() {
|
||||
# escape '%' chars in $1, make nonprintables visible
|
||||
a=${(V)1//\%/\%\%}
|
||||
|
||||
# Truncate command, and join lines.
|
||||
a=$(print -Pn "%40>...>$a" | tr -d "\n")
|
||||
|
||||
case $TERM in
|
||||
screen)
|
||||
print -Pn "\ek$a:$3\e\\" # screen title (in ^A")
|
||||
;;
|
||||
xterm*|rxvt)
|
||||
print -Pn "\e]2;$2\a" # plain xterm title ($3 for pwd)
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user