Skip to content
Brandon Weiss edited this page Sep 17, 2015 · 37 revisions

Customizations

Show exit code of last command as a separate prompt character

prompt screenshot

The prompt character still turns red if the last command didn't exit with 0, but adds another magenta ❯ to show that it was the previous command that failed. (psst my colors are different ;) )

replace: PROMPT='%(?.%F{magenta}.%F{red})❯%f '

with: PROMPT='%(?.%F{magenta}.%F{red}❯%F{magenta})❯%f '

Show current mode when using vi keybindings

prompt screenshot

Add in prompt_pure_setup()

zstyle ':prezto:module:editor:info:keymap:primary'   format "❯%f"
zstyle ':prezto:module:editor:info:keymap:alternate' format "❮%f"

and change the PROMPT line to

PROMPT='%(?.%F{magenta}.%F{red})${editor_info[keymap]} '

It works using prezto, still looking for a generic solution

A generic way of showing current mode in vi mode

Following this guide I got the mode prompt without Prezto.

PROMPT='%(?.%F{magenta}.%F{red})${${KEYMAP/vicmd/❮%f}/(main|viins)/❯%f} '
function zle-line-init zle-keymap-select {
    zle reset-prompt
}
zle -N zle-line-init
zle -N zle-keymap-select

Put this code to your .zshrc or append zle reset-prompt to your existing zle-line-init and zle-keymap-select functions.

Safer symbols

Pure's default symbols are cool, but if you use a limited font such as Inconsolata (because hey, it does look good), you'll need to change them. These worked for me on Windows:

PURE_PROMPT_SYMBOL='»'
PURE_GIT_DOWN_ARROW=''
PURE_GIT_UP_ARROW=''

Inspired

@sapegin’s Bash Prompt

prompt screenshot

Bash prompt and color theme for Terminal.app.

@brandonweiss’s Fish Prompt

Screenshot of Pure.fish

A Pure-inspired prompt for fish shell.


@therealklanni's Purity fork

Purity screenshot

Purity is my own spin on Pure. It favors a more compact current working directory, important details on the main prompt line, and extra Git indicators (modified, staged, deleted, renamed, unmerged, and untracked items) in addition to the unique features of Pure (namely: the "pull ready" indicator and execution time feedback).

Clone this wiki locally