diff --git a/README.textile b/README.textile index 9972cf246..950f8861b 100644 --- a/README.textile +++ b/README.textile @@ -56,8 +56,9 @@ If you want to uninstall it, just run @uninstall_oh_my_zsh@ from the command lin h2. Thanks -* Rick Olsen (technoweenie) might remember some of the configuration, which I took from a pastie a few years ago. -* Whoever created the rake autocomplete stuff, which was posted all over the internet a few years ago. +* Rick Olson (technoweenie) might remember some of the configuration, which I took from a pastie a few years ago. +* Marcel (noradio) provided Rick the original zsh configuration. +* Nicholas (ulysses) for the "rake autocompletion code":http://weblog.rubyonrails.org/2006/3/9/fast-rake-task-completion-for-zsh. h2. Help out! @@ -69,5 +70,4 @@ I'm hoping to collect a bunch of themes for our command prompts. You can see exi h3. Todo from imajes: -* need to make the title bar support git folder -* \ No newline at end of file +* need to make the title bar support git folder \ No newline at end of file diff --git a/lib/aliases.zsh b/lib/aliases.zsh index ff43e6405..d3ee2dd8c 100644 --- a/lib/aliases.zsh +++ b/lib/aliases.zsh @@ -44,8 +44,7 @@ alias gcp='git cherry-pick' alias history='fc -l 1' # List direcory contents -alias ls='ls -F' -alias lsa='ls -lahG' +alias lsa='ls -lah' alias l='ls -la' alias ll='ls -alr' alias sl=ls # often screw this up diff --git a/lib/appearance.zsh b/lib/appearance.zsh new file mode 100644 index 000000000..ffee52b5e --- /dev/null +++ b/lib/appearance.zsh @@ -0,0 +1,38 @@ +# ls colors +autoload colors; colors; +export LSCOLORS="Gxfxcxdxbxegedabagacad" +#export LS_COLORS + +# Enable ls colors +if [ "$DISABLE_LS_COLORS" != "true" ] +then + # Find the option for using colors in ls, depending on the version: Linux or BSD + ls --color -d . &>/dev/null 2>&1 && alias ls='ls --color=tty' || alias ls='ls -G' +fi + +#setopt no_beep +setopt auto_cd +setopt multios +setopt cdablevarS + +if [[ x$WINDOW != x ]] +then + SCREEN_NO="%B$WINDOW%b " +else + SCREEN_NO="" +fi + +# Apply theming defaults +PS1="%n@%m:%~%# " + +# git theming default: Variables for theming the git info prompt +ZSH_THEME_GIT_PROMPT_PREFIX="git:(" # Prefix at the very beginning of the prompt, before the branch name +ZSH_THEME_GIT_PROMPT_SUFFIX=")" # At the very end of the prompt +ZSH_THEME_GIT_PROMPT_DIRTY="*" # Text to display if the branch is dirty +ZSH_THEME_GIT_PROMPT_CLEAN="" # Text to display if the branch is clean + +# Setup the prompt with pretty colors +setopt prompt_subst + +# Load the theme +source "$ZSH/themes/$ZSH_THEME.zsh-theme" \ No newline at end of file diff --git a/lib/colors.zsh b/lib/colors.zsh deleted file mode 100644 index b2b08f929..000000000 --- a/lib/colors.zsh +++ /dev/null @@ -1,4 +0,0 @@ -autoload colors; colors; - -unset LSCOLORS -export LS_COLORS='di=34:ln=35:so=32:pi=33:ex=31:bd=46;34:cd=43;34:su=41;30:sg=46;30:tw=42;30:ow=43;30' diff --git a/lib/git.zsh b/lib/git.zsh index 7b7b3700f..52c7969f3 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -1,14 +1,3 @@ -# Varables for themeing the git info prompt: -# ZSH_THEME_GIT_PROMPT_PREFIX - Prefix at the very beginning of the prompt, before the branch name -# ZSH_THEME_GIT_PROMPT_SUFFIX - At the very end of the prompt -# ZSH_THEME_GIT_PROMPT_DIRTY - Text to display if the branch is dirty -# ZSH_THEME_GIT_PROMPT_CLEAN - Text to display if the branch is clean - -ZSH_THEME_GIT_PROMPT_PREFIX="git:(" -ZSH_THEME_GIT_PROMPT_SUFFIX=")" -ZSH_THEME_GIT_PROMPT_DIRTY="*" -ZSH_THEME_GIT_PROMPT_CLEAN="" - # get the name of the branch we are on function git_prompt_info() { ref=$(git symbolic-ref HEAD 2> /dev/null) || return @@ -16,10 +5,18 @@ function git_prompt_info() { } parse_git_dirty () { - if [[ $((git status &> /dev/null) | tail -n1) != "nothing to commit (working directory clean)" ]]; then + if [[ $((git status 2> /dev/null) | tail -n1) != "nothing to commit (working directory clean)" ]]; then echo "$ZSH_THEME_GIT_PROMPT_DIRTY" else echo "$ZSH_THEME_GIT_PROMPT_CLEAN" fi } +# +# Will return the current branch name +# Usage example: git pull origin $(current_branch) +# +function current_branch() { + ref=$(git symbolic-ref HEAD 2> /dev/null) || return + echo ${ref#refs/heads/} +} diff --git a/lib/misc.zsh b/lib/misc.zsh index a01627d9e..4c1743657 100644 --- a/lib/misc.zsh +++ b/lib/misc.zsh @@ -7,3 +7,7 @@ bindkey "^[m" copy-prev-shell-word ## jobs setopt long_list_jobs + +## pager +export PAGER=less +export LC_CTYPE=en_US.UTF-8 diff --git a/lib/prompt.zsh b/lib/prompt.zsh deleted file mode 100644 index 39689684f..000000000 --- a/lib/prompt.zsh +++ /dev/null @@ -1,25 +0,0 @@ -export PAGER=less -export LC_CTYPE=en_US.UTF-8 - -# speed stuff. - -#setopt no_beep -setopt auto_cd -setopt multios -setopt cdablevarS - -if [[ x$WINDOW != x ]] -then - SCREEN_NO="%B$WINDOW%b " -else - SCREEN_NO="" -fi - -PS1="%n@%m:%~%# " - -# Setup the prompt with pretty colors -setopt prompt_subst - -export LSCOLORS="Gxfxcxdxbxegedabagacad" - -source "$ZSH/themes/$ZSH_THEME.zsh-theme" diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index 7c43303bd..d905be04b 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -9,7 +9,10 @@ export ZSH_THEME="robbyrussell" # export CASE_SENSITIVE="true" # Comment this out to disable weekly auto-update checks -# export DISABLE_AUTO_UPDATE="false" +# export DISABLE_AUTO_UPDATE="true" + +# Uncomment following line if you want to disable colors in ls +# export DISABLE_LS_COLORS="true" source $ZSH/oh-my-zsh.sh diff --git a/themes/gallifrey.zsh-theme b/themes/gallifrey.zsh-theme new file mode 100644 index 000000000..fce7cb923 --- /dev/null +++ b/themes/gallifrey.zsh-theme @@ -0,0 +1,8 @@ +# ZSH Theme - Preview: http://img.skitch.com/20091113-qqtd3j8xinysujg5ugrsbr7x1y.jpg +local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" + +PROMPT='%{$fg[green]%}%m%{$reset_color%} %2~ $(git_prompt_info)%{$reset_color%}%B»%b ' +RPS1="${return_code}" + +ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}‹" +ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$reset_color%}" diff --git a/themes/garyblessington.zsh-theme b/themes/garyblessington.zsh-theme index 9431be6d8..b4f84a71c 100644 --- a/themes/garyblessington.zsh-theme +++ b/themes/garyblessington.zsh-theme @@ -1,4 +1,4 @@ -PROMPT='%{%{$fg[cyan]%}%c%{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%}% %{$reset_color%}: ' +PROMPT='%{$fg[cyan]%}%c%{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%}% %{$reset_color%}: ' ZSH_THEME_GIT_PROMPT_PREFIX="(%{$fg[blue]%}" ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" diff --git a/themes/maran.zsh-theme b/themes/maran.zsh-theme index 0f6e3b6bd..6fba04688 100644 --- a/themes/maran.zsh-theme +++ b/themes/maran.zsh-theme @@ -1,6 +1,6 @@ # Theme with full path names and hostname # Handy if you work on different servers all the time; -PROMPT='%{$fg[cyan]%}%n%{$reset_color%}@$fg[yellow]%}%M:%{$fg[green]%}%/%{$reset_color%} $(git_prompt_info) %(!.#.$) ' +PROMPT='%{$fg[cyan]%}%n%{$reset_color%}@%{$fg[yellow]%}%M:%{$fg[green]%}%/%{$reset_color%} $(git_prompt_info) %(!.#.$) ' ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[cyan]%}git:(" ZSH_THEME_GIT_PROMPT_SUFFIX=")%{$reset_color%}" diff --git a/themes/tonotdo.zsh-theme b/themes/tonotdo.zsh-theme new file mode 100644 index 000000000..478f01de7 --- /dev/null +++ b/themes/tonotdo.zsh-theme @@ -0,0 +1,12 @@ +PROMPT='%{$fg_no_bold[cyan]%}%n%{$fg_no_bold[yellow]%}•%{$fg_no_bold[magenta]%}%3~$(git_prompt_info)%{$reset_color%}» ' +RPROMPT='[%*]' + +# git theming +ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}(%{$fg_no_bold[green]%}" +ZSH_THEME_GIT_PROMPT_SUFFIX="" +ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg_bold[blue]%})" +ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[red]%}⚡%{$fg_bold[blue]%})" + +# LS colors, made with http://geoff.greer.fm/lscolors/ +export LSCOLORS="Gxfxcxdxbxegedabagacad" +export LS_COLORS='no=00:fi=00:di=01;34:ln=00;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=41;33;01:ex=00;32:*.cmd=00;32:*.exe=01;32:*.com=01;32:*.bat=01;32:*.btm=01;32:*.dll=01;32:*.tar=00;31:*.tbz=00;31:*.tgz=00;31:*.rpm=00;31:*.deb=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.lzma=00;31:*.zip=00;31:*.zoo=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.tb2=00;31:*.tz2=00;31:*.tbz2=00;31:*.avi=01;35:*.bmp=01;35:*.fli=01;35:*.gif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mng=01;35:*.mov=01;35:*.mpg=01;35:*.pcx=01;35:*.pbm=01;35:*.pgm=01;35:*.png=01;35:*.ppm=01;35:*.tga=01;35:*.tif=01;35:*.xbm=01;35:*.xpm=01;35:*.dl=01;35:*.gl=01;35:*.wmv=01;35:*.aiff=00;32:*.au=00;32:*.mid=00;32:*.mp3=00;32:*.ogg=00;32:*.voc=00;32:*.wav=00;32:' \ No newline at end of file