Giter Club home page Giter Club logo

barion's Introduction

Barion - Fast and Simple Prompt

Barion is a compiled fast prompt to use across any shell.

Barions builtin git status features showcased

Features

The special features of Barion is support for showing nix-shell, showing a compact git status overview and optional fish_prompt-like view of the exit status of last command.

GIF showing the exit code, git and nix-shell bars

Building

Building Barion requires just Crystal as there is no dependencies. Running crystal build --release prompt.cr -o barion should be everything necessary. There is also an environment set up for building via nix, so nix-build will take care of everything.

Setup

All these setup commands are

bash

If you want to keep your prompt inside nix shells, you can use the below code:

function barion_prompt {
	barion $1
	PS1="\[\e[1m\]\$\[\e[m\] "
}
PROMPT_COMMAND="barion_prompt \$?"

If the fish-style status-code display is not needed, simply drop the parameter:

function barion_prompt {
	barion
	PS1="\[\e[1m\]\$\[\e[m\] "
}
PROMPT_COMMAND="barion_prompt"

(The \[ and \] marks non-printing characters to avoid glitches in prompt rendering see GNU Bash manual)

fish

For fish we can just use the fish_prompt hook.

function fish_prompt
	barion $status
	echo "\e[1m\$\e[m "
end

Again, if the status is not needed or wanted, just remove the parameter:

function fish_prompt
	barion
	echo "\e[1m\$\e[m "
end

zsh

With zsh we use the precmd hook to achieve the same effect as the other shells.

function precmd {
	barion $?
}
PROMPT="%B\$%b "

If you don't want the fish-style exit codes shown in the prompt, just remove the parameter passed to barion.

function precmd {
	barion
}
PROMPT="%B\$%b "

Other shells

Use some sort of available hook to call Barion and write the lower prompt line in the native way of the shell.

barion's People

Contributors

sebbadk avatar

Stargazers

Alexander ADAM avatar

Watchers

James Cloos avatar  avatar  avatar

barion's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.