• Stars
    star
    193
  • Rank 199,778 (Top 4 %)
  • Language
    Rust
  • License
    MIT License
  • Created over 5 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

a simple {bash, zsh} prompt for programmers

pista

a simple {bash, zsh} prompt for programmers

pista.png

features

  • shortened current working directory
  • git info (branch/commit, ahead/behind status, repo status)
  • superuser indicator
  • fully configurable
  • m̶̛̩̬͎̲͚͙͇͂͌̏͒̎͗̆̚i̡̛̬̩͙̣̤͈̥̟͔͆̈͑̑͠͝ņ̵̛̟̥̹͍̻͍̐͛̑͋ì̴̛̗̫͍̯͈̖̝͍͊̏͗̍̈́̾m̨̼̦͈͍͕͊̀̾̽̿̅͋͆͜a̵͔̥̫̲͙͒̎͋͌̑͘̚͜͡l̵̨̧̛̪̭̣͚͇͌̇͋̌͘͢

installation

  • Step 0: install rust
$ curl https://sh.rustup.rs -sSf | sh
Rust is installed now. Great!

# check if you have the latest version. 
# pista works with rustc >= 1.34
$ rustc --version
rustc 1.36.0 (a53f9df32 2019-07-03)

# update rust if required
$ rustup update
  • Step 1a (install from crates.io): install pista with cargo (rust's package manager):
# if you want to install from source, skip over to 1b
$ cargo install pista

$ ~/.cargo/bin/pista -V
Pista 0.1.2
# yay!
  • Step 1b (install from source): if you do not want install from crates.io, you can install from source:
# install from source
$ git clone https://github.com/nerdypepper/pista --recurse-submodules
$ cargo install --path ./pista --force

$ ~/.cargo/bin/pista -V
Pista 0.1.2
# yay!
  • Step 2a (bash): bash users, set your PS1:
PS1='$(pista)'    # regular variant
PS1='$(pista -m)' # minimal variant
  • Step 2b (zsh): zsh users, add this to your .zshrc:
autoload -Uz add-zsh-hook
_pista_prompt() {
	PROMPT="$(pista -z)"   # `pista -zm` for the miminal variant
}
add-zsh-hook precmd _pista_prompt

pista handles prompt modifications when you enter virtual environments. make sure to disable virtualenv's changes.

export VIRTUAL_ENV_DISABLE_PROMPT=1

thats it! read on if you aren't happy with the defaults.

configuration

this is the default configuration. drop this in your .bashrc (or .zshrc) to get started. remember to source ~/.bashrc (or source ~/.zshrc) to observe the changes!

# prompt string to display, for regular users
export PROMPT_CHAR="$"
export PROMPT_CHAR_COLOR="green"

# prompt string to display, for the root user
export PROMPT_CHAR_ROOT="#"
export PROMPT_CHAR_ROOT_COLOR="red"

# if SHORTEN_CWD is set to 1, `/home/nerdypepper/code` is shortened to
# `/h/n/code`
export SHORTEN_CWD=1
export CWD_COLOR="white"

# if EXPAND_TILDE is set to 0, `/home/nerdypepper` is shortened to `~`
export EXPAND_TILDE=0

# if HIDE_HOME_CWD is set to 1, path is hidden when in $HOME
export HIDE_HOME_CWD=1

# there are three possible states for a git repo
# - unstaged (working tree has been modified) 
# - staged (staging area has been modified)
# - clean (all staged changes have committed)

# symbol to represent clean repo state
export GIT_CLEAN="·"
export GIT_CLEAN_COLOR="green"

# symbol to represent unstaged repo state
export GIT_WT_MODIFIED="×"
export GIT_WT_MODIFIED_COLOR="red"

# symbol to represent staged repo state
export GIT_INDEX_MODIFIED="±"
export GIT_INDEX_MODIFIED_COLOR="yellow"

# if HEAD ref peels to branch
export BRANCH_COLOR="green"

# if HEAD ref peels to a commit (detached state)
export COMMIT_COLOR="green"

all 16 colors are available:

black
red
green
yellow
blue
magenta (or purple)
cyan
white

bright black
bright red
bright green
bright yellow
bright blue
bright magenta (or purple)
bright cyan
bright white

More Repositories

1

dijo

scriptable, curses-based, digital habit tracker
Rust
2,679
star
2

scientifica

tall, condensed, bitmap font for geeks
Vim Script
1,773
star
3

eva

a calculator REPL, similar to bc(1)
Rust
712
star
4

statix

lints and suggestions for the nix programming language
Rust
391
star
5

dotfiles

files that define my GNU/Linux box.
Vim Script
349
star
6

taizen

curses based mediawiki browser
Rust
289
star
7

curie

An upscaled version of scientifica.
183
star
8

fondant

macro based configuration management library
Rust
60
star
9

chestnut.vim

Minimal syntax highlighting for 16-color terminals.
Vim Script
31
star
10

nerdypepper.github.io

CSS
29
star
11

lotus

simple money and number formatting for rust
Rust
28
star
12

cutlass

experimental auto-currying for rust functions
Rust
27
star
13

site

my site and its generator
Shell
24
star
14

agila.vim

a port of the agila vs code colorscheme for vim
Vim Script
19
star
15

xcursorlocate

cursor location indicator for x11
Rust
16
star
16

lien

Screenshot / File uploader program
Shell
12
star
17

obi

the 1-bit image format
Rust
11
star
18

isostatic

minimal url shortner
Rust
8
star
19

nanoid

A single header nanoid implementation in C
C
6
star
20

aksh

an interactive shell
Rust
6
star
21

SongMonger

C++ program to view and play music
C++
6
star
22

orpheus

Read short stories in a super slick GUI
Rust
6
star
23

prompt

rewrite of pista with a fork of libps1
Rust
4
star
24

aoc

my solutions to AoC '19, in guile scheme
Scheme
3
star
25

unipack

vim plugin manager, for usage on outdated university PCs
Shell
3
star
26

nixos

nerdypepper's nixos configuration (mirrored from git.peppe.rs)
Nix
2
star
27

website-theme

Pelican theme for my website
CSS
2
star
28

rt-bench

Rust
2
star
29

conversations

nix flake to build conversations.im
Nix
2
star
30

rosetta-rs

a copy of my rust tasks for rosettacode.org
Rust
1
star
31

cursed_game

a curses based game-of-life universe
Rust
1
star
32

forma

format floating points to arbitrary bases
Rust
1
star
33

styles

CSS for some websites
CSS
1
star
34

spoiler

my solutions to problems on projecteuler.net
Rust
1
star
35

mush

an mpd repl
Rust
1
star