diff --git a/zsh/functions/pacman-list-explicit2 b/zsh/functions/pacman-list-explicit2 new file mode 100644 index 0000000..8f2147d --- /dev/null +++ b/zsh/functions/pacman-list-explicit2 @@ -0,0 +1,20 @@ +# +# Lists explicitly installed Pacman packages. +# +# Authors: +# Benjamin Boudreau +# Sorin Ionescu +# + +pacman --query --explicit --info \ + | awk ' + BEGIN { + FS=":" + } + /^Name/ { + printf $2 " |" + } + /^Description/ { + print $2 + } + ' diff --git a/zsh/functions/prompt_tae_setup b/zsh/functions/prompt_tae_setup new file mode 100644 index 0000000..7db3412 --- /dev/null +++ b/zsh/functions/prompt_tae_setup @@ -0,0 +1,82 @@ +# +# A single line theme with Git information on the left and Ruby on the right. +# +# Authors: +# Steve Losh +# Bart Trojanowski +# Brian Carper +# steeef +# Sorin Ionescu +# Yan Pritzker +# +# Screenshots: +# http://i.imgur.com/gLgVp6Y.png +# + +function prompt_tae_precmd { + # Get Git repository information. + if (( $+functions[git-info] )); then + git-info + fi + + # Get Ruby information. + if (( $+functions[ruby-info] )); then + ruby-info + fi + + if (( $+functions[python-info] )); then + python-info + fi +} + +function prompt_tae_setup { + setopt LOCAL_OPTIONS + unsetopt XTRACE KSH_ARRAYS + prompt_opts=(cr percent subst) + + # Load required functions. + autoload -Uz add-zsh-hook + + # Add hook to set up prompt parameters before each command. + add-zsh-hook precmd prompt_tae_precmd + + # Use extended color pallete if available. + if [[ $TERM = *256color* || $TERM = *rxvt* ]]; then + _prompt_skwp_colors=( + "%F{81}" # Turquoise + "%F{166}" # Orange + "%F{135}" # Purple + "%F{161}" # Hotpink + "%F{118}" # Limegreen + ) + else + _prompt_skwp_colors=( + "%F{cyan}" + "%F{yellow}" + "%F{magenta}" + "%F{red}" + "%F{green}" + ) + fi + + # Set git-info parameters. + zstyle ':prezto:module:git:info' verbose 'yes' + zstyle ':prezto:module:git:info:branch' format "${_prompt_skwp_colors[1]}%b%f" + zstyle ':prezto:module:git:info:added' format "${_prompt_skwp_colors[5]}●%f" + zstyle ':prezto:module:git:info:deleted' format "${_prompt_skwp_colors[2]}●%f" + zstyle ':prezto:module:git:info:modified' format "${_prompt_skwp_colors[4]}●%f" + zstyle ':prezto:module:git:info:untracked' format "${_prompt_skwp_colors[3]}●%f" + zstyle ':prezto:module:git:info:keys' format 'prompt' '(%b%d%a%m%u)' + + # Set ruby-info parameters. + zstyle ':prezto:module:ruby:info:version' format '[%v]' + + # Set python-info parameters: + zstyle ':prezto:module:python:info:virtualenv' format '[%v]' + + # Define prompts. + PROMPT="${_prompt_skwp_colors[3]}%n%f@${_prompt_skwp_colors[2]}"'${python_info[virtualenv]-%m}'"%f ${_prompt_skwp_colors[5]}%~%f "'${git_info:+${(e)git_info[prompt]}}'"$ " + #RPROMPT='%F{blue}${ruby_info[version]}${python_info[virtualenv]}' +} + +prompt_tae_setup "$@" diff --git a/zsh/zpreztorc b/zsh/zpreztorc index ba18cdf..8525495 100644 --- a/zsh/zpreztorc +++ b/zsh/zpreztorc @@ -36,7 +36,9 @@ zstyle ':prezto:load' pmodule \ 'syntax-highlighting' \ 'git' \ 'pacman' \ - 'command-not-found' + 'command-not-found' \ + 'python' \ + 'history-substring-search' # # Editor @@ -80,7 +82,7 @@ zstyle ':prezto:module:editor' dot-expansion 'yes' # # Set the Pacman frontend. -zstyle ':prezto:module:pacman' frontend 'pacaur' +#zstyle ':prezto:module:pacman' frontend 'pacaur' # # Prompt @@ -89,7 +91,7 @@ zstyle ':prezto:module:pacman' frontend 'pacaur' # Set the prompt theme to load. # Setting it to 'random' loads a random theme. # Auto set to 'off' on dumb terminals. -zstyle ':prezto:module:prompt' theme "steeef" +zstyle ':prezto:module:prompt' theme "tae" # # Ruby @@ -121,12 +123,12 @@ zstyle ':prezto:module:prompt' theme "steeef" # Set syntax highlighters. # By default, only the main highlighter is enabled. -# zstyle ':prezto:module:syntax-highlighting' highlighters \ -# 'main' \ -# 'brackets' \ -# 'pattern' \ -# 'cursor' \ -# 'root' + zstyle ':prezto:module:syntax-highlighting' highlighters \ + 'main' \ + 'brackets' \ + 'pattern' \ + 'cursor' \ + 'root' # # Set syntax highlighting styles. # zstyle ':prezto:module:syntax-highlighting' styles \ diff --git a/zsh/zshrc b/zsh/zshrc index c9e5807..d440174 100644 --- a/zsh/zshrc +++ b/zsh/zshrc @@ -5,6 +5,14 @@ # Sorin Ionescu # +# Set the list of directories that Zsh searches for programs. +fpath=( + $DOTFILES/zsh/functions + $fpath +) + +typeset -gU fpath + # Source Prezto. if [[ -s "${ZDOTDIR}/prezto/init.zsh" ]]; then source "${ZDOTDIR}/prezto/init.zsh"