All Projects → geometry-zsh → Geometry

geometry-zsh / Geometry

Licence: isc
geometry is a minimal, fully customizable and composable zsh prompt theme

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to Geometry

auto-ls
zsh plugin for auto-ls
Stars: ✭ 77 (-90%)
Mutual labels:  zsh, prompt
bashy
Extremely fast and simple git prompt for bash and zsh
Stars: ✭ 43 (-94.42%)
Mutual labels:  zsh, prompt
gitprompt
Display git status in the the terminal prompt
Stars: ✭ 22 (-97.14%)
Mutual labels:  zsh, prompt
Common
A simple, clean and minimal prompt.
Stars: ✭ 213 (-72.34%)
Mutual labels:  zsh, prompt
Zsh Kubectl Prompt
Display information about the kubectl current context and namespace in zsh prompt.
Stars: ✭ 342 (-55.58%)
Mutual labels:  zsh, prompt
Spaceship Prompt
🚀⭐ A Zsh prompt for Astronauts
Stars: ✭ 15,748 (+1945.19%)
Mutual labels:  zsh, prompt
enquirer
Stylish, intuitive and user-friendly prompts, for Node.js. Used by eslint, webpack, yarn, pm2, pnpm, RedwoodJS, FactorJS, salesforce, Cypress, Google Lighthouse, Generate, tencent cloudbase, lint-staged, gluegun, hygen, hardhat, AWS Amplify, GitHub Actions Toolkit, @airbnb/nimbus, and many others! Please follow Enquirer's author: https://github.…
Stars: ✭ 6,523 (+747.14%)
Mutual labels:  zsh, prompt
Zsh Prompt Garrett
A prompt with the information you need the moment you need it.
Stars: ✭ 150 (-80.52%)
Mutual labels:  zsh, prompt
git-prompt.zsh
A fast, customizable, pure-shell, asynchronous Git prompt for Zsh
Stars: ✭ 139 (-81.95%)
Mutual labels:  zsh, prompt
apollo-zsh-theme
Heavily customizable, compatible, and fast ZSH theme framework.
Stars: ✭ 64 (-91.69%)
Mutual labels:  zsh, prompt
Agkozak Zsh Prompt
A fast, asynchronous ZSH prompt with color ASCII indicators of Git, exit, SSH, virtual environment, and vi mode status. Framework-agnostic and customizable.
Stars: ✭ 182 (-76.36%)
Mutual labels:  zsh, prompt
Typewritten
A minimal, lightweight, informative zsh prompt theme
Stars: ✭ 442 (-42.6%)
Mutual labels:  zsh, prompt
Powerline
Powerline is a statusline plugin for vim, and provides statuslines and prompts for several other applications, including zsh, bash, tmux, IPython, Awesome and Qtile.
Stars: ✭ 12,989 (+1586.88%)
Mutual labels:  zsh, prompt
Silver
A cross-shell customizable powerline-like prompt with icons
Stars: ✭ 238 (-69.09%)
Mutual labels:  zsh, prompt
Promptless
🚀 A super fast and extremely minimal shell prompt.
Stars: ✭ 155 (-79.87%)
Mutual labels:  zsh, prompt
zsh-prompt-generator
Zsh Prompt Generator
Stars: ✭ 39 (-94.94%)
Mutual labels:  zsh, prompt
Nicy
❄️ a nice and icy zsh and bash prompt in Nim
Stars: ✭ 148 (-80.78%)
Mutual labels:  zsh, prompt
Shelby
Shelby is a fast ⚡️ , lightweight ☁️ , minimal✨, shell prompt written in Go.
Stars: ✭ 148 (-80.78%)
Mutual labels:  zsh, prompt
slimline
Minimal, customizable, fast and elegant ZSH prompt
Stars: ✭ 48 (-93.77%)
Mutual labels:  zsh, prompt
Liquidprompt
A full-featured & carefully designed adaptive prompt for Bash & Zsh
Stars: ✭ 4,134 (+436.88%)
Mutual labels:  zsh, prompt

geometry

geometry logo by @MarioRicalde

a minimalistic, fully customizable zsh prompt theme

geometry starts small, with reasonable defaults, and allows you to customize it at your own will. It can be as simple or complex as you like.

If you have a question, suggestion, or request please open an issue and be sure to check out our contribution guide

What it does

All geometry does is run simple functions to customize the left and right prompts.

We bundle a few useful functions to start with, that can:

  • give you a custom colored prompt symbol
  • change the prompt symbol color according to the last command exit status
  • make the prompt symbol color change with your hostname
  • display current git branch, state and time since latest commit
  • tell you whether you need to pull, push or if you're mid-rebase
  • display the number of conflicting files and the total number of conflicts
  • display if there is a stash
  • display the running time of long-running commands
  • set the terminal title to current command and directory
  • make you the coolest hacker in the whole Starbucks

The right side prompt prints asynchronously, so you know it's going to be fast™.

Geometry also has a secondary prompt that shows up when pressing enter with an empty command, which you can configure with GEOMETRY_INFO.

Installing

tool add to .zshrc
zr zr load geometry-zsh/geometry
zplug zplug "geometry-zsh/geometry"
antigen antigen theme geometry-zsh/geometry
manually source geometry/geometry.zsh (after git clone https://github.com/geometry-zsh/geometry)

Functions

showing prompt customization with new function

Geometry displays output in several places. The output displayed in each location is determined by the plugins configured for that location. These are the supported locations, along with the environment variable used to configure each one.

Variable Name Text display location
GEOMETRY_PROMPT Text shown to the left of the cursor
GEOMETRY_RPROMPT Text shown at the right edge of the terminal
GEOMETRY_INFO Text shown after pressing enter with no input
GEOMETRY_TITLE Text shown in the terminal title
GEOMETRY_CMDTITLE Text shown in the terminal title when a command is run

To customize the prompt, add any function to the list of functions for the desired display location:

GEOMETRY_PROMPT=(geometry_status geometry_path) # redefine left prompt
GEOMETRY_RPROMPT+=(geometry_exec_time pwd)      # append exec_time and pwd right prompt
GEOMETRY_TITLE=(geometry_node)

Most of these functions only show up if it makes sense to (for example, geometry_git only shows up if in a git repository).

Please check out and share third-party functions on our functions wiki page

For more details on how to create a function, check out our contribution guide

If you prefer a two-line prompt, try GEOMETRY_PROMPT+=(geometry_newline)

Configuration

You can configure everything in geometry by defining a variable.

The default configuration tries to balance the theme to be both lightweight and contain useful features.

Here we highlight some of the more commonly customized variables, but to see all of them, look in the function definitions inside the functions directory.

general

GEOMETRY_SEPARATOR=" "    # use ' ' to separate function output

geometry_status

GEOMETRY_STATUS_SYMBOL="▲"             # default prompt symbol
GEOMETRY_STATUS_SYMBOL_ERROR="△"       # displayed when exit value is != 0
GEOMETRY_STATUS_COLOR_ERROR="magenta"  # prompt symbol color when exit value is != 0
GEOMETRY_STATUS_COLOR="default"        # prompt symbol color
GEOMETRY_STATUS_COLOR_ROOT="red"       # root prompt symbol color

geometry_exitcode

This renders the exit code of the previous function if it is not success.

GEOMETRY_EXITCODE_COLOR="red" # exit code color

geometry_git

The git function is one of the most developed plugins in geometry. We recommend installing rg or ag for the best performance with geometry_git. If you want to customize what is shown, instead of using geometry_git, feel free to use the helper functions geometry_git_{symbol, branch, conflicts, time, stashes & status}. You may also want to use geometry::git_wrapper to have the nice :: joining.

GEOMETRY_GIT_SYMBOL_REBASE="\uE0A0" # set the default rebase symbol to the powerline symbol 
GEOMETRY_GIT_SYMBOL_STASHES=x       # change the git stash indicator to `x`
GEOMETRY_GIT_COLOR_STASHES=blue     # change the git stash color to blue
GEOMETRY_GIT_GREP=ack               # define which grep-like tool to use (By default it looks for rg, ag and finally grep)
GEOMETRY_GIT_NO_COMMITS_MESSAGE=""  # hide the 'no commits' message in new repositories
GEOMETRY_GIT_TIME_DETAILED=true     # show full time (e.g. `12h 30m 53s`) instead of the coarsest interval (e.g. `12h`)

picture of git features

Hostname based colors

Geometry provides a generic function (geometry::hostcolor) for setting any color based on hostname. The color is calculated as the sum of each character converted to an integer. For example the hostname 'abc' generates a value of 294.

By default the colors 1-9 and 17-230 are used as colors depending on what the environment supports. The calculated value is then modded by the size of the color list to choose a value. This value will be consistent given the same hostname.

These colors can be overridden by setting variables.

GEOMETRY_HOST_COLORS=({1..7})  # Only use the colors 1-7
GEOMETRY_HOST_COLOR=4          # Override the color for a specific host.

colorize

Thanks

geometry is maintained by frm, desyncr and jedahan.

Thank you MarioRicalde for the lovely logos and branding.

A big thank you to the dozens of additional contributors.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].