aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNerdyPepper <[email protected]>2019-05-21 03:58:45 +0100
committerNerdyPepper <[email protected]>2019-05-21 03:58:45 +0100
commit48483df9b86194bd431f62bdee7bebcd9364a4e6 (patch)
tree905e0644f7d62f4169584e76273c1b992123133d
parentc10d91cc58a563e926921f67aa82d1a615ffe091 (diff)
add full instructions
-rw-r--r--readme.md95
1 files changed, 89 insertions, 6 deletions
diff --git a/readme.md b/readme.md
index 2487306..ccefdce 100644
--- a/readme.md
+++ b/readme.md
@@ -1,12 +1,95 @@
1# pista 1# pista
2 2
3> my bash prompt, reWriTteN iN rUst 3> a simple bash prompt for programmers
4 4
5hopefully it will look like this when done: 5### installation
6```shell 6```shell
7~/c/r/pista master × 7$ cargo install pista
8$ ls 8```
9
10cargo is rust's package manager. if you dont have cargo installed, head over to
11http://rustup.rs and follow the instructions.
12make sure to add `$HOME/.cargo/bin` to your `$PATH`!
13
14
15once you have installed `pista`, set your `PS1` to use it!
16```shell
17PS1="$(pista)" # regular variant
18PS1="$(pista -m)" # minimal variant
19```
20
21
22`pista` handles prompt modifications when you enter virtual environments.
23make sure to disable `virtualenv`'s changes.
24```shell
25export VIRTUAL_ENV_DISABLE_PROMPT=1
26```
27
28thats it! read on if you aren't happy with the defaults.
29
30### configuration
31
32this is the default configuration. drop this in your `.bashrc` to get started.
33remember to `source ~/.bashrc` to observe the changes!
34
35```
36# prompt string to display, for regular users
37export PROMPT_CHAR="$"
38export PROMPT_CHAR_COLOR="green"
39
40# prompt string to display, for the root user
41export PROMPT_CHAR_ROOT="#"
42export PROMPT_CHAR_ROOT_COLOR="red"
43
44# if SHORTEN_CWD is set to 1, `/home/nerdypepper/code` is shortened to
45# `/h/n/code`
46export SHORTEN_CWD=1
47export CWD_COLOR="white"
48
49# if EXPAND_TILDE is set to 0, `/home/nerdypepper` is shortened to `~`
50export EXPAND_TILDE=0
51
52# there are three possible states for a git repo
53# - unstaged (working tree has been modified)
54# - staged (staging area has been modified)
55# - clean (all staged changes have committed)
56
57# symbol to represent clean repo state
58export GIT_CLEAN="·"
59export GIT_CLEAN_COLOR="green"
60
61# symbol to represent unstaged repo state
62export GIT_WT_MODIFIED="×"
63export GIT_WT_MODIFIED_COLOR="red"
64
65# symbol to represent staged repo state
66export GIT_INDEX_MODIFIED="±"
67export GIT_INDEX_MODIFIED_COLOR="yellow"
68
69# if HEAD ref peels to branch
70export BRANCH_COLOR="green"
71
72# if HEAD ref peels to a commit (detached state)
73export COMMIT_COLOR="green"
74```
75
76all 16 colors are available:
77```
78black
79red
80green
81yellow
82blue
83magenta (or purple)
84cyan
85white
9 86
10{cwd} {branch} {repo state} 87bright black
11{prompt_char} 88bright red
89bright green
90bright yellow
91bright blue
92bright magenta (or purple)
93bright cyan
94bright white
12``` 95```