Home

Awesome

Dexter, a zsh theme.

A theme with an emphasis on the right side of the terminal. It works best with terminals wider than the standard 80 columns.

License

Copyright (c) 2016 by Shiv Venkatasubrahmanyam shiv@alum.mit.edu. License: Apache License 2.0

Examples

Here's how this theme looks with the solarized light color palette.

With default settings: Dexter with default settings

With some custom settings: Dexter with some custom settings

With simple settings: Dexter with simple settings

Features

Installation and Use

To use this plugin, in your ~/.zshrc:

  1. Source the plugins you need for the right prompt,
  2. Set the DEXTER_* configuration variables described below, and
  3. Source this file.

A plugin manager is highly recommended to simplify installation and loading. For instance, using zplug and the following, you could customize your shell to look like the "custom" example above.

...  # Load zplug.
zplug "plugins/shrink-path", from:oh-my-zsh
zplug "plugins/gitfast", from:oh-my-zsh, defer:1
zplug "plugins/virtualenv", from:oh-my-zsh
zplug "shvenkat/zsh-theme-dexter", use:"*.zsh", defer:3
DEXTER_RIGHT_PROMPT_ELEMS=(time workdir git venv)
DEXTER_WORKDIR_COLOR=$fg_bold[green]
DEXTER_GIT_COLOR=$fg_bold[magenta]
DEXTER_VENV_COLOR=$fg[yellow]
DEXTER_SHOW_EXIT_MESSAGE=0
DEXTER_SHOW_ELAPSED_TIME=0
...
zplug load

Customization

To customize this theme, set the following variables before sourcing this file. Default values are shown below.

DEXTER_LEFT_PROMPT_STRING=◀▶           # No trailing space.

The prompt string. A space will be printed to the right of this string.

DEXTER_RIGHT_PROMPT_ELEMS=(venv git workdir host time)

The sequence of elements in the right prompt. Use () to disable the right prompt.

DEXTER_VENV_COLOR=$fg_bold[green]      # Darker than foreground.
DEXTER_GIT_COLOR=$fg[default]`         # Foreground text color.
DEXTER_WORKDIR_COLOR=$fg_bold[cyan]`   # Lighter than foreground.
DEXTER_HOST_COLOR=$fg_bold[cyan]`      # Lighter than foreground.
DEXTER_TIME_COLOR=$fg_bold[cyan]`      # Lighter than foreground.

The color of right prompt elements. The default colors are intended for use with the solarized light palette. Any terminal/ANSI color specification supported by zsh or your terminal can be used.

DEXTER_SHOW_EXIT_MESSAGE=1

If set to 1, the non-zero exit status of the last command is shown within parentheses below command output. If zero, non-zero exit is indicated by the color of the left prompt.

DEXTER_EXIT_STATUS_COLOR=$fg[red]

The color used to indicate non-zero exit of the previous command. It is used either in the exit status message if DEXTER_SHOW_EXIT_MESSAGE is 1, or in the left prompt.

DEXTER_SHOW_ELAPSED_TIME=1
DEXTER_TIME_LIMIT_SECS=5

If set to 1, the wall-clock time consumed by the last command, if longer than DEXTER_TIME_LIMIT_SECS, is shown within parentheses below command output.

DEXTER_UNTIMED_COMMANDS=("more" "less" "emacs" "emacsclient" "nvim" "vim"
                         "man" "git" "time")

The commands for which elapsed time is not shown. These are typically interactive programs. Elements of this array are strings -- possibly with more than one word -- that match the beginning of excluded commands. Matching is performed after alias expansion.