diff options
author | romkatv <roman.perepelitsa@gmail.com> | 2019-07-27 14:47:54 +0300 |
---|---|---|
committer | romkatv <roman.perepelitsa@gmail.com> | 2019-07-27 14:47:54 +0300 |
commit | 4a59f7f42256755bf4ae0754572fa486dec2589f (patch) | |
tree | b6f5634822c697105426517e6d9cd0ddd17221ca /config/p10k-lean.zsh | |
parent | c025a878fd33e9262c91c67791dd8d37976471bd (diff) | |
parent | 57b1f1aa744d3a990c1173ae5fe88d1e09e8c853 (diff) |
Merge branch 'master' into dev
Diffstat (limited to 'config/p10k-lean.zsh')
-rw-r--r-- | config/p10k-lean.zsh | 110 |
1 files changed, 90 insertions, 20 deletions
diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh index 53633ede..30bfce7d 100644 --- a/config/p10k-lean.zsh +++ b/config/p10k-lean.zsh @@ -1,9 +1,9 @@ -# Config for Powerlevel10k with lean prompt style. Doesn't require a Powerline font. -# The color scheme is suitable for dark terminal background. +# Config for Powerlevel10k with lean prompt style. Doesn't require a custom font but can take +# advantage of it if available. The color scheme is suitable for dark terminal background. # # Once you've installed Powerlevel10k, run these commands to apply lean style. # -# curl -fsSL -O ~/p10k-lean.zsh https://raw.githubusercontent.com/romkatv/powerlevel10k/master/config/p10k-lean.zsh +# curl -fsSL -o ~/p10k-lean.zsh https://raw.githubusercontent.com/romkatv/powerlevel10k/master/config/p10k-lean.zsh # echo 'source ~/p10k-lean.zsh' >>! ~/.zshrc # # To customize your prompt, open ~/p10k-lean.zsh in your favorite text editor, change it and @@ -89,15 +89,18 @@ fi # such as POWERLEVEL9K_LOCK_ICON='⭐'. This will change the icon in every segment that uses # LOCK_ICON as default icon. If this paragraph looks confusing, forget what it says. # + # Note: You can use $'\u2B50' instead of '⭐'. It's especially convenient when specifying + # icons that your text editor cannot render. Don't forget to put $ and use single quotes when + # defining icons via Unicode codepoints. + # # Note: Many default icons cannot be displayed with system fonts. You'll need to install a - # Powerline font to use them. See POWERLEVEL9K_MODE below. + # capable font to use them. See POWERLEVEL9K_MODE below. typeset -g POWERLEVEL9K_VISUAL_IDENTIFIER_EXPANSION= - # This option doesn't make a difference unless you've enabled default icons for all or some - # prompt segments (see POWERLEVEL9K_VISUAL_IDENTIFIER_EXPANSION above). Default icons depend on - # the value of POWERLEVEL9K_MODE. For example, LOCK_ICON can be printed as $'\uE0A2', $'\uE138' - # or $'\uF023' depending on POWERLEVEL9K_MODE. The correct value of this parameter depends on - # the provider of the font your terminal is using. + # This option makes a difference only when default icons are enabled for all or some prompt + # segments (see POWERLEVEL9K_VISUAL_IDENTIFIER_EXPANSION above). LOCK_ICON can be printed as + # $'\uE0A2', $'\uE138' or $'\uF023' depending on POWERLEVEL9K_MODE. The correct value of this + # parameter depends on the provider of the font your terminal is using. # # Font Provider | POWERLEVEL9K_MODE # ---------------------------------+------------------- @@ -108,6 +111,13 @@ fi # Awesome-Terminal Fonts (regular) | awesome-fontconfig # Awesome-Terminal Fonts (patched) | awesome-patched # Nerd Fonts | nerdfont-complete + # Other | compatible + # + # If this looks overwhelming, either stick with a preinstalled system font and set + # POWERLEVEL9K_MODE=compatible, or install a font from https://github.com/ryanoasis/nerd-fonts + # and set POWERLEVEL9K_MODE=nerdfont-complete. "Meslo LG S Regular Nerd Font Complete Mono" from + # https://github.com/ryanoasis/nerd-fonts/tree/master/patched-fonts/Meslo/S/Regular/complete is + # very good. typeset -g POWERLEVEL9K_MODE=nerdfont-complete # When set to true, icons appear before content on both sides of the prompt. When set @@ -234,7 +244,9 @@ fi # # ⌂ ~/best/powerlevel10k # - # You can also set different colors for directories of different classes. + # You can also set different colors for directories of different classes. Remember to override + # FOREGROUND, SHORTENED_FOREGROUND and ANCHOR_FOREGROUND for every directory class that you wish + # to have its own color. # # typeset -g POWERLEVEL9K_DIR_WORK_FOREGROUND=12 # typeset -g POWERLEVEL9K_DIR_WORK_SHORTENED_FOREGROUND=4 @@ -274,7 +286,7 @@ fi # If P9K_CONTENT is not empty, leave it unchanged. It's either "loading" or from vcs_info. vcs="\${P9K_CONTENT:-$vcs}" - # Branch icon. Set this parameter to '\uF126 ' for the popular Powerline branch icon. + # Branch icon. Set this parameter to $'\uF126 ' for the popular Powerline branch icon. typeset -g POWERLEVEL9K_VCS_BRANCH_ICON= # Disable the default Git status formatting. @@ -306,15 +318,34 @@ fi typeset -g POWERLEVEL9K_VCS_STAGED_ICON=$'%{\b+%}' ##########################[ status: exit code of the last command ]########################### - # Don't show status on success. Prompt symbol (prompt_char) indicates success with green color. + # Enable OK_PIPE, ERROR_PIPE and ERROR_SIGNAL status states to allow us to enable, disable and + # style them independently from the regular OK and ERROR state. + typeset -g POWERLEVEL9K_STATUS_EXTENDED_STATES=true + # Don't show status on success. prompt_char already indicates success with green color. typeset -g POWERLEVEL9K_STATUS_OK=false - # Error status color. + # Don't show status when it's just an error code (e.g., '1'). prompt_char already indicates errors + # with red color and error codes aren't interesting enough to waste prompt real estate on them. + typeset -g POWERLEVEL9K_STATUS_ERROR=false typeset -g POWERLEVEL9K_STATUS_ERROR_FOREGROUND=9 - # Don't show status unless the last command was terminated by a signal. Your prompt symbol - # (prompt_char) indicates error by turning red. Error codes aren't usually interesting but - # signals are. This shows signals as "INT", "ABORT", "KILL", etc. You can remove this parameter - # for more verbose output. - typeset -g POWERLEVEL9K_STATUS_ERROR_CONTENT_EXPANSION='${${P9K_CONTENT#SIG}//[!A-Z]}' + # Show status when the last command was terminated by a signal. + typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL=true + typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_FOREGROUND=9 + # Use terse signal names: "INT" instead of "SIGINT(2)". + typeset -g POWERLEVEL9K_STATUS_VERBOSE_SIGNAME=false + # Show status when a pipe command fails and the overall exit status is non-zero. It may look + # like this: 0|1. prompt_char is red in this case. + typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE=true + typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_FOREGROUND=9 + # Show status when a pipe command fails and the overall exit status is zero. It may look + # like this: 1|0. prompt_char is green in this case. + typeset -g POWERLEVEL9K_STATUS_OK_PIPE=true + typeset -g POWERLEVEL9K_STATUS_OK_PIPE_FOREGROUND=9 + # Custom icons. + # typeset -g POWERLEVEL9K_STATUS_OK_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_STATUS_OK_PIPE_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_STATUS_ERROR_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_VISUAL_IDENTIFIER_EXPANSION='⭐' ###################[ command_execution_time: duration of the last command ]################### # Show duration of the last command if takes longer than this many seconds. @@ -325,6 +356,8 @@ fi typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FOREGROUND=101 # Duration format: 1d 2h 3m 4s. typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FORMAT='d h m s' + # Custom icon. + # typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_VISUAL_IDENTIFIER_EXPANSION='⭐' #######################[ background_jobs: presence of background jobs ]####################### # Don't show the number of background jobs. @@ -333,6 +366,8 @@ fi typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VISUAL_IDENTIFIER_EXPANSION='⇶' # Background jobs icon color. typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VISUAL_IDENTIFIER_COLOR=2 + # Custom icon. + # typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VISUAL_IDENTIFIER_EXPANSION='⭐' ##########[ nordvpn: nordvpn connection status, linux only (https://nordvpn.com/) ]########### # NordVPN connection indicator color when connected. @@ -342,6 +377,11 @@ fi # Uncomment these two lines to hide NordVPN connection indicator when not connected. # typeset -g POWERLEVEL9K_NORDVPN_{DISCONNECTED,CONNECTING,DISCONNECTING}_CONTENT_EXPANSION= # typeset -g POWERLEVEL9K_NORDVPN_{DISCONNECTED,CONNECTING,DISCONNECTING}_VISUAL_IDENTIFIER_EXPANSION= + # Custom icons. + # typeset -g POWERLEVEL9K_NORDVPN_CONNECTED_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_NORDVPN_DISCONNECTED_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_NORDVPN_CONNECTING_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_NORDVPN_DISCONNECTING_VISUAL_IDENTIFIER_EXPANSION='⭐' ####################################[ context: user@host ]#################################### # Context format: user@host. @@ -353,6 +393,10 @@ fi # Don't show context unless running with privileges on in SSH. typeset -g POWERLEVEL9K_CONTEXT_{DEFAULT,SUDO}_{CONTENT,VISUAL_IDENTIFIER}_EXPANSION= typeset -g POWERLEVEL9K_ALWAYS_SHOW_CONTEXT=true + # Custom icon. + # typeset -g POWERLEVEL9K_CONTEXT_VISUAL_IDENTIFIER_EXPANSION='⭐' + # Custom icon when root. + # typeset -g POWERLEVEL9K_CONTEXT_ROOT_VISUAL_IDENTIFIER_EXPANSION='⭐' ###[ virtualenv: python virtual environment (https://docs.python.org/3/library/venv.html) ]### # Python virtual environment color. @@ -361,6 +405,8 @@ fi typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION=true # Separate environment name from Python version only with a space. typeset -g POWERLEVEL9K_VIRTUALENV_{LEFT,RIGHT}_DELIMITER= + # Custom icon. + # typeset -g POWERLEVEL9K_VIRTUALENV_VISUAL_IDENTIFIER_EXPANSION='⭐' #####################[ anaconda: conda environment (https://conda.io/) ]###################### # Anaconda environment color. @@ -369,32 +415,44 @@ fi typeset -g POWERLEVEL9K_ANACONDA_SHOW_PYTHON_VERSION=true # Separate environment name from Python version only with a space. typeset -g POWERLEVEL9K_ANACONDA_{LEFT,RIGHT}_DELIMITER= + # Custom icon. + # typeset -g POWERLEVEL9K_ANACONDA_VISUAL_IDENTIFIER_EXPANSION='⭐' ################[ pyenv: python environment (https://github.com/pyenv/pyenv) ]################ # Pyenv color. typeset -g POWERLEVEL9K_PYENV_FOREGROUND=6 # Don't show the current Python version if it's the same as global. typeset -g POWERLEVEL9K_PYENV_PROMPT_ALWAYS_SHOW=false + # Custom icon. + # typeset -g POWERLEVEL9K_PYENV_VISUAL_IDENTIFIER_EXPANSION='⭐' ##########[ nodenv: node.js version from nodenv (https://github.com/nodenv/nodenv) ]########## # Nodenv color. typeset -g POWERLEVEL9K_NODENV_FOREGROUND=2 # Don't show node version if it's the same as global: $(nodenv version-name) == $(nodenv global). typeset -g POWERLEVEL9K_NODENV_PROMPT_ALWAYS_SHOW=false + # Custom icon. + # typeset -g POWERLEVEL9K_NODENV_VISUAL_IDENTIFIER_EXPANSION='⭐' ##############[ nvm: node.js version from nvm (https://github.com/nvm-sh/nvm) ]############### # Nvm color. typeset -g POWERLEVEL9K_NVM_FOREGROUND=2 + # Custom icon. + # typeset -g POWERLEVEL9K_NVM_VISUAL_IDENTIFIER_EXPANSION='⭐' ############[ nodeenv: node.js environment (https://github.com/ekalinin/nodeenv) ]############ # Nodeenv color. typeset -g POWERLEVEL9K_NODEENV_FOREGROUND=2 + # Custom icon. + # typeset -g POWERLEVEL9K_NODEENV_VISUAL_IDENTIFIER_EXPANSION='⭐' ##############################[ node_version: node.js version ]############################### # Node version color. typeset -g POWERLEVEL9K_NODE_VERSION_FOREGROUND=2 # Show node version only when in a directory tree containing package.json. - typeset -g P9K_NODE_VERSION_PROJECT_ONLY=true + typeset -g POWERLEVEL9K_NODE_VERSION_PROJECT_ONLY=true + # Custom icon. + # typeset -g POWERLEVEL9K_NODE_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' #############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]############# # Kubernetes context classes for the purpose of using different colors with @@ -415,8 +473,12 @@ fi # '*test*' TEST # to match your needs. Customize them as needed. '*' DEFAULT) # typeset -g POWERLEVEL9K_KUBECONTEXT_PROD_FOREGROUND=1 + # typeset -g POWERLEVEL9K_KUBECONTEXT_PROD_VISUAL_IDENTIFIER_EXPANSION='⭐' # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_FOREGROUND=2 + # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_FOREGROUND=3 + # typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' + # Kubernetes context too long? You can shorten it by defining an expansion. The original # Kubernetes context that you see in your prompt is stored in ${P9K_CONTENT} when # the expansion is evaluated. To remove everything up to and including the last '/', @@ -425,12 +487,15 @@ fi # are very flexible and fast, too. See reference: # http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion. typeset POWERLEVEL9K_KUBECONTEXT_CONTENT_EXPANSION='${P9K_CONTENT}' - # Show the trailing "/default" in kubernetes context. + # Show the trailing "/default" in kubernetes context. This makes it easier to define + # POWERLEVEL9K_KUBECONTEXT_CONTENT_EXPANSION by making the format of ${P9K_CONTENT} consistent. typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_DEFAULT_NAMESPACE=true ###############################[ public_ip: public IP address ]############################### # Public IP color. typeset -g POWERLEVEL9K_PUBLIC_IP_FOREGROUND=144 + # Custom icon. + # typeset -g POWERLEVEL9K_PUBLIC_IP_VISUAL_IDENTIFIER_EXPANSION='⭐' ################################[ battery: internal battery ]################################# # Show battery in red when it's below this level and not connected to power supply. @@ -448,6 +513,9 @@ fi typeset -g POWERLEVEL9K_BATTERY_CHARGED_{CONTENT,VISUAL_IDENTIFIER}_EXPANSION= # Don't show the remaining time to charge/discharge. typeset -g POWERLEVEL9K_BATTERY_VERBOSE=false + # Disable the default icon because POWERLEVEL9K_BATTERY_STAGES is enough to cue the meaning + # of this segment. + typeset -g POWERLEVEL9K_BATTERY_VISUAL_IDENTIFIER_EXPANSION= ####################################[ time: current time ]#################################### # Current time color. @@ -458,6 +526,8 @@ fi # commands will contain the start times of their commands as opposed to the default # behavior where they contain the end times of their preceding commands. typeset -g POWERLEVEL9K_TIME_UPDATE_ON_COMMAND=false + # Custom icon. + # typeset -g POWERLEVEL9K_TIME_VISUAL_IDENTIFIER_EXPANSION='⭐' } (( ! p10k_lean_restore_aliases )) || setopt aliases |