Adds shlvl segment to powerline themes

pull/1443/head
David Farrell 2019-11-01 08:41:37 -07:00
parent eb21a1da6c
commit 8123b1c887
No known key found for this signature in database
GPG Key ID: 1CCA28D0E300B56F
5 changed files with 20 additions and 0 deletions

View File

@ -64,6 +64,9 @@ IN_VIM_THEME_PROMPT_TEXT=${POWERLINE_IN_VIM_TEXT:="vim"}
HOST_THEME_PROMPT_COLOR=${POWERLINE_HOST_COLOR:=0}
SHLVL_THEME_PROMPT_COLOR=${POWERLINE_SHLVL_COLOR:=${HOST_THEME_PROMPT_COLOR}}
SHLVL_THEME_PROMPT_CHAR=${POWERLINE_SHLVL_CHAR:="§"}
POWERLINE_LEFT_PROMPT=${POWERLINE_LEFT_PROMPT:="scm python_venv ruby node cwd"}
POWERLINE_RIGHT_PROMPT=${POWERLINE_RIGHT_PROMPT:="in_vim clock battery user_info"}

View File

@ -60,6 +60,9 @@ IN_VIM_THEME_PROMPT_TEXT=${POWERLINE_IN_VIM_TEXT:="vim"}
HOST_THEME_PROMPT_COLOR=${POWERLINE_HOST_COLOR:=254}
SHLVL_THEME_PROMPT_COLOR=${POWERLINE_SHLVL_COLOR:=${HOST_THEME_PROMPT_COLOR}}
SHLVL_THEME_PROMPT_CHAR=${POWERLINE_SHLVL_CHAR:="§"}
POWERLINE_PROMPT=${POWERLINE_PROMPT:="user_info scm python_venv ruby node cwd"}
safe_append_prompt_command __powerline_prompt_command

View File

@ -57,6 +57,9 @@ IN_VIM_THEME_PROMPT_TEXT=${POWERLINE_IN_VIM_TEXT:="vim"}
HOST_THEME_PROMPT_COLOR=${POWERLINE_HOST_COLOR:=0}
SHLVL_THEME_PROMPT_COLOR=${POWERLINE_SHLVL_COLOR:=${HOST_THEME_PROMPT_COLOR}}
SHLVL_THEME_PROMPT_CHAR=${POWERLINE_SHLVL_CHAR:="§"}
POWERLINE_PROMPT=${POWERLINE_PROMPT:="user_info scm python_venv ruby node cwd"}
safe_append_prompt_command __powerline_prompt_command

View File

@ -162,6 +162,14 @@ function __powerline_aws_profile_prompt {
fi
}
function __powerline_shlvl_prompt {
if [[ "${SHLVL}" -gt 1 ]]; then
local prompt="${SHLVL_THEME_PROMPT_CHAR}"
local level=$(( ${SHLVL} - 1))
echo "${prompt}${level}|${SHLVL_THEME_PROMPT_COLOR}"
fi
}
function __powerline_left_segment {
local OLD_IFS="${IFS}"; IFS="|"
local params=( $1 )

View File

@ -60,6 +60,9 @@ IN_VIM_THEME_PROMPT_TEXT=${POWERLINE_IN_VIM_TEXT:="vim"}
HOST_THEME_PROMPT_COLOR=${POWERLINE_HOST_COLOR:=0}
SHLVL_THEME_PROMPT_COLOR=${POWERLINE_SHLVL_COLOR:=${HOST_THEME_PROMPT_COLOR}}
SHLVL_THEME_PROMPT_CHAR=${POWERLINE_SHLVL_CHAR:="§"}
POWERLINE_PROMPT=${POWERLINE_PROMPT:="user_info scm python_venv ruby node cwd"}
safe_append_prompt_command __powerline_prompt_command