From fcb04c0ae7e07b630305730ff2ec12b928d7c8aa Mon Sep 17 00:00:00 2001 From: David Tomaschik Date: Fri, 27 Sep 2019 15:56:36 -0700 Subject: [PATCH] More cleanup. --- dotfiles/zpreztorc | 8 +++----- dotfiles/zshrc | 17 ++++++++++------- .../zshrc.d/matir_prompt/prompt_matir_setup | 13 ++++++------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/dotfiles/zpreztorc b/dotfiles/zpreztorc index 14e8d09..7ae24e6 100644 --- a/dotfiles/zpreztorc +++ b/dotfiles/zpreztorc @@ -30,8 +30,6 @@ zstyle ':prezto:load' pmodule \ 'environment' \ 'terminal' \ 'completion' \ - 'git' \ - 'python' \ 'syntax-highlighting' \ 'history-substring-search' @@ -139,7 +137,7 @@ zstyle ':prezto:module:prompt' theme 'matir' # zstyle ':prezto:module:python:virtualenv' auto-switch 'yes' # Automatically initialize virtualenvwrapper if pre-requisites are met. -zstyle ':prezto:module:python:virtualenv' initialize 'yes' +#zstyle ':prezto:module:python:virtualenv' initialize 'yes' # # Screen @@ -201,10 +199,10 @@ zstyle ':prezto:module:terminal:multiplexer-title' format '%s' # # Auto start a session when Zsh is launched in a local terminal. -zstyle ':prezto:module:tmux:auto-start' local 'no' +# zstyle ':prezto:module:tmux:auto-start' local 'no' # Auto start a session when Zsh is launched in a SSH connection. -zstyle ':prezto:module:tmux:auto-start' remote 'no' +# zstyle ':prezto:module:tmux:auto-start' remote 'no' # Integrate with iTerm2. # zstyle ':prezto:module:tmux:iterm' integrate 'yes' diff --git a/dotfiles/zshrc b/dotfiles/zshrc index 0d4042d..5fad452 100755 --- a/dotfiles/zshrc +++ b/dotfiles/zshrc @@ -86,7 +86,16 @@ if [[ $- == *i* ]] ; then autoload -Uz promptinit && promptinit # Prompt prompt matir -fi + # Virtualenvwrapper + if test -f /usr/share/virtualenvwrapper/virtualenvwrapper_lazy.sh ; then + source /usr/share/virtualenvwrapper/virtualenvwrapper_lazy.sh + fi + # Enable grc if we have it + if ls --version 2>&1 >/dev/null ; then + alias ls='ls --color -C' + fi + [[ -s "/etc/grc.zsh" ]] && source /etc/grc.zsh +fi # End interactive-only block # In case ack is named ack-grep if [ -x /usr/bin/ack-grep ] ; then @@ -101,11 +110,5 @@ if command -v most >/dev/null 2>&1; then export PAGER="most" fi -# Enable grc if we have it -if ls --version 2>&1 >/dev/null ; then - alias ls='ls --color -C' -fi -[[ -s "/etc/grc.zsh" ]] && source /etc/grc.zsh - # Load any local settings if [ -e $HOME/.zshrc.local ] ; then source $HOME/.zshrc.local ; fi diff --git a/dotfiles/zshrc.d/matir_prompt/prompt_matir_setup b/dotfiles/zshrc.d/matir_prompt/prompt_matir_setup index 3a33a8b..8426a54 100644 --- a/dotfiles/zshrc.d/matir_prompt/prompt_matir_setup +++ b/dotfiles/zshrc.d/matir_prompt/prompt_matir_setup @@ -19,19 +19,16 @@ function prompt_matir_setup { zstyle ':vcs_info:*' unstagedstr '*' zstyle ':vcs_info:git*+set-message:*' hooks git-untracked - # Virtualenv formatting - zstyle ':prezto:module:python:info:virtualenv' format ' (py:%v)' - PROMPT='%{$fg[black]%}[%{$fg[yellow]%}%h%{$fg[black]%}] ' # History # PROMPT+='%{%(!.$fg[red].$fg[green])%}%8>..>%n%>>%{$fg[white]%}@' # username@ PROMPT+='%{$fg[blue]%}%12>..>%m%>>%{$fg[white]%}:' # hostname PROMPT+='%{$fg[green]%}%32<...<%~%<<' # path - PROMPT+='%{$fg[magenta]%}${python_info[virtualenv]}' # virtualenv + PROMPT+='%{$fg[magenta]%}${VIRTUAL_ENV_SHORT}' # virtualenv PROMPT+='%{$fg[blue]%}${vcs_info_msg_0_}' # VCS info PROMPT+='%{$fg[white]%}%#%{$reset_color%} ' # prompt symbol # Rprompt setup - local show_return="✘ " + local show_return='✘ ' RPROMPT='%(?:: %{$fg[red]%}' RPROMPT+=${show_return} RPROMPT+='%? ' @@ -49,8 +46,10 @@ zle -N zle-keymap-select function prompt_matir_precmd { vcs_info - if (( $+functions[python-info] )); then - python-info + if [ $VIRTUAL_ENV ] ; then + VIRTUAL_ENV_SHORT=" (py:$(basename $VIRTUAL_ENV))" + else + VIRTUAL_ENV_SHORT="" fi }