diff options
author | Ben Hilburn <bhilburn@gmail.com> | 2017-05-23 04:07:23 +0300 |
---|---|---|
committer | Ben Hilburn <bhilburn@gmail.com> | 2017-05-23 04:07:23 +0300 |
commit | 6486e62f1444048b5ba45584d7a8a647a5ab5137 (patch) | |
tree | dbcf03b6705bc8287847259ac537cdfca98b0fec | |
parent | ff0766ec5e5aca9f1dda94e6e52769503ae60b3e (diff) | |
parent | e9e3e9dc538edc82bf8071919eca2fc9c56292a5 (diff) |
Merge branch 'pr/newline' of https://github.com/docwhat/powerlevel9k into docwhat-pr/newline
-rw-r--r-- | README.md | 9 | ||||
-rw-r--r-- | functions/icons.zsh | 12 | ||||
-rwxr-xr-x | powerlevel9k.zsh-theme | 17 |
3 files changed, 34 insertions, 4 deletions
@@ -143,6 +143,7 @@ The segments that are currently available are: * [`command_execution_time`](#command_execution_time) - Display the time the current command took to execute. * [`todo`](http://todotxt.com/) - Shows the number of tasks in your todo.txt tasks file. * `detect_virt` - Virtualization detection with systemd +* `newline` - Continues the prompt on a new line. --------------------------------------------------------------------------------- @@ -442,6 +443,14 @@ segment will not be displayed. |`POWERLEVEL9K_PUBLIC_IP_METHODS`|(dig curl wget)| These methods in that order are used to refresh your IP.| |`POWERLEVEL9K_PUBLIC_IP_NONE`|None|The string displayed when an IP was not obtained| +##### newline + +Puts a newline in your prompt so you can continue using segments on the next line. + +This allows you to use segments on both lines, unlike `POWERLEVEL9K_PROMPT_ON_NEWLINE`. + +This only works on the left side. On the right side it does nothing. + ##### rbenv This segment shows the version of Ruby being used when using `rbenv` to change your current Ruby stack. diff --git a/functions/icons.zsh b/functions/icons.zsh index 7b3bba78..72e0fbe4 100644 --- a/functions/icons.zsh +++ b/functions/icons.zsh @@ -39,8 +39,9 @@ case $POWERLEVEL9K_MODE in FAIL_ICON $'\u2718' # ✘ SYMFONY_ICON 'SF' NODE_ICON $'\u2B22' # ⬢ - MULTILINE_FIRST_PROMPT_PREFIX $'\u256D'$'\U2500' - MULTILINE_SECOND_PROMPT_PREFIX $'\u2570'$'\U2500 ' + MULTILINE_FIRST_PROMPT_PREFIX $'\u256D'$'\U2500' # ╭─ + MULTILINE_NEWLINE_PROMPT_PREFIX $'\u251C'$'\U2500' # ├─ + MULTILINE_SECOND_PROMPT_PREFIX $'\u2570'$'\U2500 ' # ╰─ APPLE_ICON $'\uE26E' # WINDOWS_ICON $'\uE26F' # FREEBSD_ICON $'\U1F608 ' # 😈 @@ -111,6 +112,7 @@ case $POWERLEVEL9K_MODE in SYMFONY_ICON 'SF' NODE_ICON $'\u2B22' # ⬢ MULTILINE_FIRST_PROMPT_PREFIX $'\u256D'$'\U2500' # ╭─ + MULTILINE_NEWLINE_PROMPT_PREFIX $'\u251C'$'\U2500' # ├─ MULTILINE_SECOND_PROMPT_PREFIX $'\u2570'$'\U2500 ' # ╰─ APPLE_ICON $'\uF179' # WINDOWS_ICON $'\uF17A' # @@ -178,6 +180,7 @@ case $POWERLEVEL9K_MODE in SYMFONY_ICON $'\uE757' # NODE_ICON $'\uE617 ' # MULTILINE_FIRST_PROMPT_PREFIX $'\u256D'$'\U2500' # ╭─ + MULTILINE_NEWLINE_PROMPT_PREFIX $'\u251C'$'\U2500' # ├─ MULTILINE_SECOND_PROMPT_PREFIX $'\u2570'$'\U2500 ' # ╰─ APPLE_ICON $'\uF179' # WINDOWS_ICON $'\uF17A' # @@ -244,8 +247,9 @@ case $POWERLEVEL9K_MODE in FAIL_ICON $'\u2718' # ✘ SYMFONY_ICON 'SF' NODE_ICON $'\u2B22' # ⬢ - MULTILINE_FIRST_PROMPT_PREFIX $'\u256D'$'\u2500' - MULTILINE_SECOND_PROMPT_PREFIX $'\u2570'$'\u2500 ' + MULTILINE_FIRST_PROMPT_PREFIX $'\u256D'$'\U2500' # ╭─ + MULTILINE_NEWLINE_PROMPT_PREFIX $'\u251C'$'\U2500' # ├─ + MULTILINE_SECOND_PROMPT_PREFIX $'\u2570'$'\U2500 ' # ╰─ APPLE_ICON 'OSX' WINDOWS_ICON 'WIN' FREEBSD_ICON 'BSD' diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index 0f2445e6..e4629646 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -337,6 +337,23 @@ prompt_background_jobs() { fi } +# A newline in your prompt, so you can segments on multiple lines. +prompt_newline() { + local lws newline + [[ "$1" == "right" ]] && return + newline=$'\n' + lws=$POWERLEVEL9K_WHITESPACE_BETWEEN_LEFT_SEGMENTS + if [[ "$POWERLEVEL9K_PROMPT_ON_NEWLINE" == true ]]; then + newline="${newline}$(print_icon 'MULTILINE_NEWLINE_PROMPT_PREFIX')" + fi + POWERLEVEL9K_WHITESPACE_BETWEEN_LEFT_SEGMENTS= + "$1_prompt_segment" \ + "$0" \ + "$2" \ + "NONE" "NONE" "${newline}" + POWERLEVEL9K_WHITESPACE_BETWEEN_LEFT_SEGMENTS=$lws +} + # Segment that indicates usage level of current partition. set_default POWERLEVEL9K_DISK_USAGE_ONLY_WARNING false set_default POWERLEVEL9K_DISK_USAGE_WARNING_LEVEL 90 |