Skip to content

marcelarie/xelabash

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is a fork that contains some personal changes that are useful for me.

Those are the following so far:

  • vi mode indicator
  • nix mode indicator
  • display the prompt output and the prompt input on separate lines. (this still
    needs to be changed so its configurable and not by default)
  • disabled default ls alias (I prefer to set those myself, it also needs to
    configurable instead of default)
  • add clear on C-l

Enjoy!


xelabash

xelabash

A few simple, no-nonsense, non-distracting additions to the standard bash prompt.

Features

  • Compact, minimalist, single-line prompt, featuring:
    • Red $ (or #, if root) in prompt following an error
    • user@hostname, but only when in a remote session
    • Git branch and working copy dirty status, when in a Git repo
    • Active Kubernetes context and namespace
  • "Better"-than-default autocomplete settings
  • Not overly opinionated; designed to integrate with other settings and tools if desired

Install and Setup

Works best with bash 4.4+. There are no dependencies to install.

To install, simply clone this repo and source xela.bash in your .bash_profile. (If .bash_profile doesn't work, try .bashrc.)

cd
git clone --depth=1 https://github.com/aelindeman/xelabash "${XDG_DATA_HOME:-~/.local/share}/xelabash"
echo 'source "${XDG_DATA_HOME:-~/.local/share}/xelabash/xela.bash"' >> .bash_profile

Xelabash will load configuration files from the config.d/ folder in this repository, so you can fork this repo and add your own aliases, configs, functions, environment variables, or whatever else you need.

Git and Kubernetes prompt pieces are opt-in. Just set GIT_PROMPT=true and/or KUBE_PROMPT=true before you load Xelabash:

GIT_PROMPT=true
KUBE_PROMPT=true
source ~/.local/share/xelabash/xela.bash

Alternatively, if you don't want to always see them, use a tool like direnv to set those environment variables conditionally based on your working directory.

More pictures

  • Full cwd

    dir

  • Git status and branch

    git

  • Kubernetes context (and namespace, if set)

    kube

  • Last process exit status

    exit

  • Username and hostname, when connected via ssh

    ssh

  • ...and they all work in combination with each other

    combo

About

My minimalist bash prompt

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 93.6%
  • Python 6.4%