Skip to content

Instantly share code, notes, and snippets.

@july-12
Created January 2, 2020 11:43
Show Gist options
  • Save july-12/2d32cca6ee4753dc92b14309c0474ccd to your computer and use it in GitHub Desktop.
Save july-12/2d32cca6ee4753dc92b14309c0474ccd to your computer and use it in GitHub Desktop.
powerlevel9k
POWERLEVEL9K_MODE=nerdfont-complete
POWERLEVEL9K_PROMPT_ON_NEWLINE=true
POWERLEVEL9K_RPROMPT_ON_NEWLINE=true
POWERLEVEL9K_SHORTEN_DIR_LENGTH=2
POWERLEVEL9K=truncate_beginning
POWERLEVEL9K_TIME_BACKGROUND=black
POWERLEVEL9K_TIME_FOREGROUND=white
POWERLEVEL9K_TIME_FORMAT=%D{%I:%M}
POWERLEVEL9K_STATUS_VERBOSE=false
POWERLEVEL9K_VCS_CLEAN_FOREGROUND=black
POWERLEVEL9K_VCS_CLEAN_BACKGROUND=green
POWERLEVEL9K_VCS_UNTRACKED_FOREGROUND=black
POWERLEVEL9K_VCS_UNTRACKED_BACKGROUND=yellow
POWERLEVEL9K_VCS_MODIFIED_FOREGROUND=white
POWERLEVEL9K_VCS_MODIFIED_BACKGROUND=black
POWERLEVEL9K_COMMAND_EXECUTION_TIME_BACKGROUND=black
POWERLEVEL9K_COMMAND_EXECUTION_TIME_FOREGROUND=blue
POWERLEVEL9K_FOLDER_ICON=
POWERLEVEL9K_VCS_GIT_GITHUB_ICON=$'\uE708'
POWERLEVEL9K_PACKAGE_ICON=$'\uF487'
POWERLEVEL9K_CRATE_ICON=$POWERLEVEL9K_PACKAGE_ICON
POWERLEVEL9K_NODE_ICON=$'\uF898'
POWERLEVEL9K_NPM_ICON=$'\uE71E'
POWERLEVEL9K_STATUS_OK_IN_NON_VERBOSE=true
POWERLEVEL9K_STATUS_VERBOSE=false
POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=0
POWERLEVEL9K_VCS_UNTRACKED_ICON=●
POWERLEVEL9K_VCS_UNSTAGED_ICON=±
POWERLEVEL9K_VCS_INCOMING_CHANGES_ICON=↓
POWERLEVEL9K_VCS_OUTGOING_CHANGES_ICON=↑
POWERLEVEL9K_VCS_COMMIT_ICON=' '
POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX='%F{blue}╭─%F{red}'
POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX='%F{blue}╰%f '
POWERLEVEL9K_CUSTOM_OS_ICON='echo  $(whoami) '
POWERLEVEL9K_CUSTOM_OS_ICON_BACKGROUND=red
POWERLEVEL9K_CUSTOM_OS_ICON_FOREGROUND=white
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(custom_os_icon ssh root_indicator dir dir_writable vcs custom_nothing custom_package_json)
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(command_execution_time status background_jobs time ram)
# Custom segments
export POWERLEVEL9K_CUSTOM_NOTHING=zsh_nothing
export POWERLEVEL9K_CUSTOM_PACKAGE_JSON=zsh_package_json
function zsh_nothing () {
echo '' # Nothing
}
# Functions: If working directory contains package.json, show nodejs information
function zsh_package_json () {
local pkgjson=$(pwd)/package.json
if [[ -f $pkgjson ]]; then
local nodever npmver pkgver
if [[ $POWERLEVEL9K_CUSTOM_PACKAGE_JSON_NODEVER != 'false' ]]; then
nodever=$POWERLEVEL9K_NODE_ICON' '$(node --version)
fi
if [[ $POWERLEVEL9K_CUSTOM_PACKAGE_JSON_NPMVER != 'false' ]]; then
npmver=$POWERLEVEL9K_NPM_ICON' '$(npm --version)
fi
if [[ $POWERLEVEL9K_CUSTOM_PACKAGE_JSON_PKGVER != 'false' ]]; then
local actualpkgver=$(node -p "require('$pkgjson').version || ''")
[[ -z $actualpkgver ]] || pkgver=$POWERLEVEL9K_PACKAGE_ICON' '$actualpkgver
fi
env echo -n $nodever $npmver $pkgver
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment