All Projects → talal → Mimir

talal / Mimir

Licence: gpl-3.0
Fast and minimal shell prompt

Programming Languages

go
31211 projects - #10 most used programming language
shell
77523 projects
bash
514 projects

Projects that are alternatives of or similar to Mimir

bashy
Extremely fast and simple git prompt for bash and zsh
Stars: ✭ 43 (-52.22%)
Mutual labels:  zsh, prompt
Zsh Kubectl Prompt
Display information about the kubectl current context and namespace in zsh prompt.
Stars: ✭ 342 (+280%)
Mutual labels:  zsh, prompt
slimline
Minimal, customizable, fast and elegant ZSH prompt
Stars: ✭ 48 (-46.67%)
Mutual labels:  zsh, prompt
gitprompt
Display git status in the the terminal prompt
Stars: ✭ 22 (-75.56%)
Mutual labels:  zsh, prompt
Geometry
geometry is a minimal, fully customizable and composable zsh prompt theme
Stars: ✭ 770 (+755.56%)
Mutual labels:  zsh, prompt
zsh-prompt-generator
Zsh Prompt Generator
Stars: ✭ 39 (-56.67%)
Mutual labels:  zsh, prompt
git-prompt.zsh
A fast, customizable, pure-shell, asynchronous Git prompt for Zsh
Stars: ✭ 139 (+54.44%)
Mutual labels:  zsh, prompt
Common
A simple, clean and minimal prompt.
Stars: ✭ 213 (+136.67%)
Mutual labels:  zsh, prompt
Gbt
Highly configurable prompt builder for Bash, ZSH and PowerShell written in Go.
Stars: ✭ 457 (+407.78%)
Mutual labels:  zsh, prompt
Typewritten
A minimal, lightweight, informative zsh prompt theme
Stars: ✭ 442 (+391.11%)
Mutual labels:  zsh, prompt
auto-ls
zsh plugin for auto-ls
Stars: ✭ 77 (-14.44%)
Mutual labels:  zsh, prompt
Pretty Git Prompt
`git status` inside your shell prompt
Stars: ✭ 43 (-52.22%)
Mutual labels:  zsh, prompt
Silver
A cross-shell customizable powerline-like prompt with icons
Stars: ✭ 238 (+164.44%)
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 (+7147.78%)
Mutual labels:  zsh, prompt
Spaceship Prompt
🚀⭐ A Zsh prompt for Astronauts
Stars: ✭ 15,748 (+17397.78%)
Mutual labels:  zsh, prompt
apollo-zsh-theme
Heavily customizable, compatible, and fast ZSH theme framework.
Stars: ✭ 64 (-28.89%)
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 (+14332.22%)
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 (+102.22%)
Mutual labels:  zsh, prompt
Liquidprompt
A full-featured & carefully designed adaptive prompt for Bash & Zsh
Stars: ✭ 4,134 (+4493.33%)
Mutual labels:  zsh, prompt
Oh My Posh
A prompt theme engine for any shell.
Stars: ✭ 841 (+834.44%)
Mutual labels:  zsh, prompt

Archived project. No maintenance.

This project is not maintained anymore and is archived. Feel free to fork and make your own changes if needed.

Mímir

GitHub Release Build Status Go Report Card Software License

Mímir is a fast and minimal shell prompt written in Go. The look of Mímir is inspired by Pure and the functionality is inspired by prettyprompt.

asciicast

The Mímir Go binary only displays the (pre) prompt line with all the information. The actual prompt line used for input is configured in the shell's config file. This allows for flexibility:

  • You can configure the prompt line to your preference, e.g. you can specify a prompt symbol of your choice, add user or host name info, etc.
  • You can use Mímir with any shell of your choosing. The description says Bash and Zsh because these are the shells which I have tested Mímir on but technically you can use Mímir with any shell as long as it allows you to load a binary as a prompt.

Features

  • It is very fast: loads under 5ms with everything turned on (benchmark).
  • Shows current Git branch name.
  • Long directory paths are shortened and inaccessible paths are highlighted in red.
  • Kubernetes context and namespace info is shown using KUBECONFIG environment variable. If multiple config files are specified in the variable value then the first one with current context info is used. You can overwrite the K8s info by exporting the CURRENT_KUBE_CTX variable with an arbitrary value.
  • OpenStack cloud info is shown using the standard OpenStack environment variables that begin with OS_. Variables that specify IDs are used if name specifying variables are not available. E.g. OS_PROJECT_DOMAIN_ID would be used if OS_PROJECT_DOMAIN_NAME is not available. You can overwrite the cloud info by exporting the CURRENT_OS_CLOUD variable with an arbitrary value.

Installation

Installer script

The simplest way to install Mímir on Linux or macOS is to run:

$ sh -c "$(curl -sL git.io/getmimir)"

This will put the binary in /usr/local/bin/mimir

Pre-compiled binaries

Pre-compiled binaries for Linux and macOS are avaiable on the releases page.

The binaries are static executables.

Homebrew

$ brew install talal/tap/mimir

Building from source

The only required build dependency is Go 1.11 or above.

$ git clone https://github.com/talal/mimir.git
$ cd mimir
$ make install

This will put the binary in /usr/local/bin/mimir

Alternatively, you can also build Mímir directly with the go get command without manually cloning the repository:

$ go get -u github.com/talal/mimir

This will put the binary in $GOPATH/bin/mimir

Usage

The following usage examples are just one example of how Mímir can be configured. The examples below will result in a setup similar to the one shown in the demo above: the prompt symbol () changes to red if the previous command exited with an error.

Bash

Add this to your .bashrc file:

prompt_mimir_cmd() {
  if [ $? != 0 ]; then
    local prompt_symbol="\[\e[0;31m\]\[\e[0m\]"
  else
    local prompt_symbol="\[\e[0;35m\]\[\e[0m\]"
  fi

  PS1="$(/path/to/mimir)\n${prompt_symbol} "
}
PROMPT_COMMAND=prompt_mimir_cmd

Zsh

Add this to your .zshrc file:

autoload -Uz add-zsh-hook
prompt_mimir_cmd() { /path/to/mimir }
add-zsh-hook precmd prompt_mimir_cmd

prompt_symbol='❯'
PROMPT="%(?.%F{magenta}.%F{red})${prompt_symbol}%f "

Options

Option Description Usage
MIMIR_DISABLE_KUBE Disable Kubernetes context and namespace info. export MIMIR_DISABLE_KUBE=1
MIMIR_DISABLE_CLOUD Disable OpenStack cloud info. export MIMIR_DISABLE_CLOUD=1
CURRENT_KUBE_CTX Display arbitrary info for K8s. export CURRENT_KUBE_CTX='custom info'
CURRENT_OS_CLOUD Display arbitrary info for OpenStack. export CURRENT_OS_CLOUD='custom info'

Credits

Most of the source code is borrowed from prettyprompt.

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].