dorkhub

common

A simple, clean and minimal prompt.

jackharrisonsherlock
Shell36430 forksMITupdated 5 days ago
git clone https://github.com/jackharrisonsherlock/common.gitjackharrisonsherlock/common

Common

A simple, clean and minimal Zsh prompt.

Common prompt screenshot

  • Current working directory
  • Hostname (shown in remote SSH shells only)
  • AWS Vault role
  • Background jobs
  • Current SHA (optional)
  • Exit status of the last command
  • Git branch and staged, unstaged, and untracked counts
  • Customisable colours and symbols
  • Optional asynchronous Git status

Requirements

  • Zsh 5.2 or newer
  • Git
  • Oh My Zsh, or another setup that provides its colour definitions
  • zsh-async (optional, for non-blocking Git status)

Installation

Oh My Zsh

Download the theme, set it as the active Oh My Zsh theme, and restart Zsh:

mkdir -p "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes" && curl -fsSL https://raw.githubusercontent.com/jackharrisonsherlock/common/master/common.zsh-theme -o "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/common.zsh-theme" && omz theme set common && exec zsh

Asynchronous Git status

Common works without additional dependencies. By default it uses zsh-async when the plugin has already been loaded, and falls back to synchronous Git status otherwise.

To use asynchronous status, load zsh-async before Common. To force synchronous status, set this before loading the theme:

COMMON_GIT_ASYNC=false

Configuration

Set options before loading Common. The examples below show the defaults:

COMMON_PROMPT_SYMBOL="❯"

COMMON_COLORS_HOST_ME=green
COMMON_COLORS_HOST_AWS_VAULT=yellow
COMMON_COLORS_CURRENT_DIR=blue
COMMON_COLORS_RETURN_STATUS_TRUE=magenta
COMMON_COLORS_RETURN_STATUS_FALSE=yellow
COMMON_COLORS_GIT_STATUS_DEFAULT=green
COMMON_COLORS_GIT_STATUS_STAGED=red
COMMON_COLORS_GIT_STATUS_UNSTAGED=yellow
COMMON_COLORS_GIT_PROMPT_SHA=green
COMMON_COLORS_BG_JOBS=yellow

COMMON_GIT_STAGED_SYMBOL="+"
COMMON_GIT_UNSTAGED_SYMBOL="!"
COMMON_GIT_UNTRACKED_SYMBOL="?"
COMMON_GIT_ASYNC=true

Git state is displayed explicitly as well as with colour. For example, main +2 !1 ?3 means two staged changes, one unstaged change, and three untracked files. A staged or mixed repository is red, an unstaged or untracked repository is yellow, and a clean repository is green.

Terminal

The screenshot shows Common in Hyper with a custom theme and SF Mono.

more like this

MTT-File-Manager-RUST

MTT File Manager is a Rust-based Windows file manager with tabbed navigation, rich media previews, deep system integrat…

Rust51

Aritim-Light

A Light theme for both KDE and GTK based distros, pleasant to the eyes and perfect for your daily workload.

CSS51

search

search projects, people, and tags