From e538aa75187af4dd3037450f3e75c01dcc868f1d Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 11 Jan 2021 23:17:46 +0100 Subject: zsh: prompt tweaks --- user-profiles/zsh/p10k.zsh | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) (limited to 'user-profiles/zsh/p10k.zsh') diff --git a/user-profiles/zsh/p10k.zsh b/user-profiles/zsh/p10k.zsh index ff66f0df..d0dda29c 100644 --- a/user-profiles/zsh/p10k.zsh +++ b/user-profiles/zsh/p10k.zsh @@ -49,7 +49,10 @@ # =========================[ Line #1 ]========================= status # exit code of the last command command_execution_time # duration of the last command + time # current time background_jobs # presence of background jobs + # =========================[ Line #2 ]========================= + newline direnv # direnv status (https://direnv.net/) asdf # asdf version manager (https://github.com/asdf-vm/asdf) virtualenv # python virtual environment (https://docs.python.org/3/library/venv.html) @@ -98,12 +101,10 @@ todo # todo items (https://github.com/todotxt/todo.txt-cli) timewarrior # timewarrior tracking status (https://timewarrior.net/) taskwarrior # taskwarrior task count (https://taskwarrior.org/) + status # exit code of the last command + command_execution_time # duration of the last command time # current time - # =========================[ Line #2 ]========================= - newline - status - command_execution_time - time + background_jobs # presence of background jobs # ip # ip address and bandwidth usage for a specified network interface # public_ip # public IP address # proxy # system-wide http/https/ftp proxy @@ -189,10 +190,7 @@ # typeset -g POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION='⭐' ################################[ prompt_char: prompt symbol ]################################ - # Green prompt symbol if the last command succeeded. - typeset -g POWERLEVEL9K_PROMPT_CHAR_OK_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=76 - # Red prompt symbol if the last command failed. - typeset -g POWERLEVEL9K_PROMPT_CHAR_ERROR_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=196 + typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=010 # Default prompt symbol. typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIINS_CONTENT_EXPANSION='❯' # Prompt symbol in command vi mode. @@ -266,7 +264,7 @@ # directory will be shortened only when prompt doesn't fit or when other parameters demand it # (see POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS and POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT below). # If set to `0`, directory will always be shortened to its minimum length. - typeset -g POWERLEVEL9K_DIR_MAX_LENGTH=80 + typeset -g POWERLEVEL9K_DIR_MAX_LENGTH=30% # When `dir` segment is on the last prompt line, try to shorten it enough to leave at least this # many columns for typing commands. typeset -g POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS=40 @@ -336,14 +334,14 @@ # parameter. For example, if POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_FOREGROUND is not set, it falls # back to POWERLEVEL9K_DIR_FOREGROUND. # - # typeset -g POWERLEVEL9K_DIR_CLASSES=() + typeset -g POWERLEVEL9K_DIR_CLASSES=() # Custom prefix. # typeset -g POWERLEVEL9K_DIR_PREFIX='%fin ' #####################################[ vcs: git status ]###################################### # Branch icon. Set this parameter to '\uF126 ' for the popular Powerline branch icon. - typeset -g POWERLEVEL9K_VCS_BRANCH_ICON='\uF126 ' + typeset -g POWERLEVEL9K_VCS_BRANCH_ICON='' # Untracked files icon. It's really a question mark, your font isn't broken. # Change the value of this parameter to show a different icon. @@ -456,7 +454,7 @@ # Don't show Git status in prompt for repositories whose workdir matches this pattern. # For example, if set to '~', the Git repository at $HOME/.git will be ignored. # Multiple patterns can be combined with '|': '~(|/foo)|/bar/baz/*'. - typeset -g POWERLEVEL9K_VCS_DISABLED_WORKDIR_PATTERN='~' + # typeset -g POWERLEVEL9K_VCS_DISABLED_WORKDIR_PATTERN='~' # Disable the default Git status formatting. typeset -g POWERLEVEL9K_VCS_DISABLE_GITSTATUS_FORMATTING=true @@ -1495,13 +1493,13 @@ # Current time color. typeset -g POWERLEVEL9K_TIME_FOREGROUND=66 # Format for the current time: 09:51:02. See `man 3 strftime`. - typeset -g POWERLEVEL9K_TIME_FORMAT='%D{%H:%M:%S}' + typeset -g POWERLEVEL9K_TIME_FORMAT='%D{%H:%M}' # If set to true, time will update when you hit enter. This way prompts for the past # 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='⭐' + typeset -g POWERLEVEL9K_TIME_VISUAL_IDENTIFIER_EXPANSION='' # Custom prefix. # typeset -g POWERLEVEL9K_TIME_PREFIX='%fat ' @@ -1546,8 +1544,8 @@ # typed after changing current working directory. typeset -g POWERLEVEL9K_TRANSIENT_PROMPT=off - function p10k-on-pre-prompt() { p10k display '1'=show '2/left/dir'=hide '2/right/(status|command_execution_time|time)'=hide } - function p10k-on-post-prompt() { p10k display '2/left/(dir|prompt_char)'=show 'empty_line|1'=hide '2/right/(status|command_execution_time|time)'=show } + function p10k-on-pre-prompt() { p10k display '1'=show '2/left/dir'=hide '2/right/*'=show '2/right/(status|command_execution_time|time|background_jobs)'=hide } + function p10k-on-post-prompt() { p10k display '2/left/(dir|prompt_char)'=show 'empty_line|1'=hide '2/right/*'=hide '2/right/(status|command_execution_time|time|background_jobs)'=show } # Instant prompt mode. # -- cgit v1.2.3