mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2024-11-25 21:40:08 +00:00
Merge branch 'master' into next
This commit is contained in:
commit
ea05b4ebe6
3 changed files with 11 additions and 16 deletions
|
@ -1,6 +1,6 @@
|
||||||
![](https://raw.githubusercontent.com/bhilburn/powerlevel9k-logo/master/logo-banner.png)
|
![](https://raw.githubusercontent.com/bhilburn/powerlevel9k-logo/master/logo-banner.png)
|
||||||
---
|
---
|
||||||
[![Build Status](https://travis-ci.org/bhilburn/powerlevel9k.svg?branch=next)](https://travis-ci.org/bhilburn/powerlevel9k)
|
[![Build Status](https://travis-ci.org/bhilburn/powerlevel9k.svg?branch=master)](https://travis-ci.org/bhilburn/powerlevel9k)
|
||||||
[![Join the chat at https://gitter.im/bhilburn/powerlevel9k](https://badges.gitter.im/bhilburn/powerlevel9k.svg)](https://gitter.im/bhilburn/powerlevel9k?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
[![Join the chat at https://gitter.im/bhilburn/powerlevel9k](https://badges.gitter.im/bhilburn/powerlevel9k.svg)](https://gitter.im/bhilburn/powerlevel9k?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||||
|
|
||||||
Powerlevel9k is a theme for ZSH which uses [Powerline
|
Powerlevel9k is a theme for ZSH which uses [Powerline
|
||||||
|
|
|
@ -17,7 +17,7 @@ function +vi-git-untracked() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $(git rev-parse --is-inside-work-tree 2> /dev/null) == 'true' && \
|
if [[ $(git rev-parse --is-inside-work-tree 2> /dev/null) == 'true' && \
|
||||||
-n $(git status ${FLAGS} | grep -E '^\?\?' 2> /dev/null | tail -n1) ]]; then
|
-n $(git status ${FLAGS} | \grep -E '^\?\?' 2> /dev/null | tail -n1) ]]; then
|
||||||
hook_com[unstaged]+=" $(print_icon 'VCS_UNTRACKED_ICON')"
|
hook_com[unstaged]+=" $(print_icon 'VCS_UNTRACKED_ICON')"
|
||||||
VCS_WORKDIR_HALF_DIRTY=true
|
VCS_WORKDIR_HALF_DIRTY=true
|
||||||
else
|
else
|
||||||
|
@ -139,15 +139,15 @@ function +vi-vcs-detect-changes() {
|
||||||
|
|
||||||
function +vi-svn-detect-changes() {
|
function +vi-svn-detect-changes() {
|
||||||
local svn_status="$(svn status)"
|
local svn_status="$(svn status)"
|
||||||
if [[ -n "$(echo "$svn_status" | grep \^\?)" ]]; then
|
if [[ -n "$(echo "$svn_status" | \grep \^\?)" ]]; then
|
||||||
hook_com[unstaged]+=" $(print_icon 'VCS_UNTRACKED_ICON')"
|
hook_com[unstaged]+=" $(print_icon 'VCS_UNTRACKED_ICON')"
|
||||||
VCS_WORKDIR_HALF_DIRTY=true
|
VCS_WORKDIR_HALF_DIRTY=true
|
||||||
fi
|
fi
|
||||||
if [[ -n "$(echo "$svn_status" | grep \^\M)" ]]; then
|
if [[ -n "$(echo "$svn_status" | \grep \^\M)" ]]; then
|
||||||
hook_com[unstaged]+=" $(print_icon 'VCS_UNSTAGED_ICON')"
|
hook_com[unstaged]+=" $(print_icon 'VCS_UNSTAGED_ICON')"
|
||||||
VCS_WORKDIR_DIRTY=true
|
VCS_WORKDIR_DIRTY=true
|
||||||
fi
|
fi
|
||||||
if [[ -n "$(echo "$svn_status" | grep \^\A)" ]]; then
|
if [[ -n "$(echo "$svn_status" | \grep \^\A)" ]]; then
|
||||||
hook_com[staged]+=" $(print_icon 'VCS_STAGED_ICON')"
|
hook_com[staged]+=" $(print_icon 'VCS_STAGED_ICON')"
|
||||||
VCS_WORKDIR_DIRTY=true
|
VCS_WORKDIR_DIRTY=true
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -696,7 +696,10 @@ set_default POWERLEVEL9K_DIR_PATH_SEPARATOR "/"
|
||||||
set_default POWERLEVEL9K_HOME_FOLDER_ABBREVIATION "~"
|
set_default POWERLEVEL9K_HOME_FOLDER_ABBREVIATION "~"
|
||||||
set_default POWERLEVEL9K_DIR_SHOW_WRITABLE false
|
set_default POWERLEVEL9K_DIR_SHOW_WRITABLE false
|
||||||
prompt_dir() {
|
prompt_dir() {
|
||||||
|
local tmp="$IFS"
|
||||||
|
local IFS=""
|
||||||
local current_path=$(pwd | sed -e "s,^$HOME,~,")
|
local current_path=$(pwd | sed -e "s,^$HOME,~,")
|
||||||
|
local IFS="$tmp"
|
||||||
if [[ -n "$POWERLEVEL9K_SHORTEN_DIR_LENGTH" || "$POWERLEVEL9K_SHORTEN_STRATEGY" == "truncate_with_folder_marker" ]]; then
|
if [[ -n "$POWERLEVEL9K_SHORTEN_DIR_LENGTH" || "$POWERLEVEL9K_SHORTEN_STRATEGY" == "truncate_with_folder_marker" ]]; then
|
||||||
set_default POWERLEVEL9K_SHORTEN_DELIMITER $'\U2026'
|
set_default POWERLEVEL9K_SHORTEN_DELIMITER $'\U2026'
|
||||||
|
|
||||||
|
@ -1384,18 +1387,10 @@ prompt_virtualenv() {
|
||||||
}
|
}
|
||||||
|
|
||||||
# pyenv: current active python version (with restrictions)
|
# pyenv: current active python version (with restrictions)
|
||||||
# More information on pyenv (Python version manager like rbenv and rvm):
|
# https://github.com/pyenv/pyenv#choosing-the-python-version
|
||||||
# https://github.com/yyuu/pyenv
|
|
||||||
# the prompt parses output of pyenv version and only displays the first word
|
|
||||||
prompt_pyenv() {
|
prompt_pyenv() {
|
||||||
local pyenv_version="$(pyenv version 2>/dev/null)"
|
if [[ -n "$PYENV_VERSION" ]]; then
|
||||||
pyenv_version="${pyenv_version%% *}"
|
"$1_prompt_segment" "$0" "$2" "blue" "$DEFAULT_COLOR" "$PYENV_VERSION" 'PYTHON_ICON'
|
||||||
# XXX: The following should return the same as above.
|
|
||||||
# This reads better for devs familiar with sed/awk/grep/cut utilities
|
|
||||||
# Using shell expansion/substitution may hamper future maintainability
|
|
||||||
#local pyenv_version="$(pyenv version 2>/dev/null | head -n1 | cut -d' ' -f1)"
|
|
||||||
if [[ -n "$pyenv_version" && "$pyenv_version" != "system" ]]; then
|
|
||||||
"$1_prompt_segment" "$0" "$2" "blue" "$DEFAULT_COLOR" "$pyenv_version" 'PYTHON_ICON'
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue