-
Notifications
You must be signed in to change notification settings - Fork 0
/
.powerlevel9k
68 lines (53 loc) · 2.28 KB
/
.powerlevel9k
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
POWERLEVEL9K_INSTALLATION_PATH=$_ANTIGEN_INSTALL_DIR/bundles/bhilburn/powerlevel9k
POWERLEVEL9K_MODE="awesome-fontconfig"
# POWERLEVEL9K_MODE="nerdfont-complete"
# POWERLEVEL9K_FOLDER_ICON=""
# POWERLEVEL9K_HOME_SUB_ICON="$(print_icon "HOME_ICON")"
# POWERLEVEL9K_DIR_PATH_SEPARATOR=" $(print_icon "LEFT_SUBSEGMENT_SEPARATOR") "
POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=0
POWERLEVEL9K_DIR_OMIT_FIRST_CHARACTER=true
POWERLEVEL9K_BACKGROUND_JOBS_FOREGROUND='black'
POWERLEVEL9K_BACKGROUND_JOBS_BACKGROUND='178'
POWERLEVEL9K_NVM_BACKGROUND="238"
POWERLEVEL9K_NVM_FOREGROUND="green"
POWERLEVEL9K_CONTEXT_DEFAULT_FOREGROUND="blue"
POWERLEVEL9K_DIR_WRITABLE_FORBIDDEN_FOREGROUND="015"
POWERLEVEL9K_PYTHON_ICON=""
POWERLEVEL9K_PYENV_PROMPT_ALWAYS_SHOW='true'
POWERLEVEL9K_TIME_BACKGROUND='255'
# POWERLEVEL9K_COMMAND_TIME_FOREGROUND='gray'
POWERLEVEL9K_COMMAND_EXECUTION_TIME_BACKGROUND='245'
POWERLEVEL9K_COMMAND_EXECUTION_TIME_FOREGROUND='black'
POWERLEVEL9K_TIME_FORMAT="%D{%H:%M}"
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(root_indicator context dir dir_writable vcs)
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status background_jobs command_execution_time pyenv my_node_version time)
POWERLEVEL9K_PROMPT_ON_NEWLINE=true
# POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX=''
# POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX='\uf0da'
POWERLEVEL9K_SHOW_CHANGESET=true
get_asdf_version() {
# Get asdf plugin version
if [ $commands[asdf] ]; then
local asdf_global_conf="$HOME/.tool-versions"
local version_regex="s/^\([.0-9]*\)\s*\([.0-9]*\)\{0,1\}.*/\1 \2/p"
local config_regex="s/.*(set by \(.*\))/\1/p"
local current="$(asdf current $1)"
local current_version="$(echo $current | sed -n $version_regex)"
local current_conf="$(echo $current | sed -n $config_regex)"
echo "$current_version"
fi
}
prompt_asdf_python() {
if [ $commands[asdf] ]; then
local python_version="$(get_asdf_version python)"
"$1_prompt_segment" "$0" "$2" "blue" "$DEFAULT_COLOR" "$python_version" 'PYTHON_ICON'
fi
}
# Only show node version if package.json exists in the current directory
prompt_my_node_version() {
if [[ -f package.json ]]; then
local node_version=$(node -v 2>/dev/null)
[[ -z "${node_version}" ]] && return
"$1_prompt_segment" "$0" "$2" "green" "white" "${node_version:1}" 'NODE_ICON'
fi
}