-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhellishrc.example
More file actions
112 lines (97 loc) · 6.22 KB
/
Copy pathhellishrc.example
File metadata and controls
112 lines (97 loc) · 6.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# ═══════════════════════════════════════════════════════════════════════
# ~/.hellishrc — hellish interactive configuration
# Copy this file to ~/.hellishrc; it is sourced by every interactive
# hellish (never by scripts, -c, or piped input — tests stay clean).
# ═══════════════════════════════════════════════════════════════════════
# ── 1. PROMPT ──────────────────────────────────────────────────────────
# Setting PS1 replaces the built-in prompt entirely; unset it to get the
# rich built-in theme back. Bash escape set:
# \u user \h host \H host.fqdn \w cwd(~) \W cwd basename
# \$ $/# \n newline \t HH:MM:SS \d date \j job count
# \s shell \v version \e ESC \[ \] readline width guards
# hellish extensions — all SELF-SPACING (invisible until relevant):
# \g git branch of the cwd (+ * when dirty), empty outside a repo
# \S " ✘N" after a failing command, empty after success
# \p " took N.Ns" once a command ran 2s or longer
# \J " ⚙N" while background jobs exist
# \A an ANIMATED glyph (see HELLISH_ANIM below) — live while the
# shell waits at the prompt, repainted in place ~10x/second.
# (Shadows bash's \A 24h-clock escape; use \t for time instead.)
# Live $VAR / ${VAR} expansion happens at every render.
# Prompt animation style for \A:
# spinner braille spinner in blue pulse a ✦ breathing magenta
# ember a ▲ flickering through fire off freeze/hide \A
HELLISH_ANIM=pulse
# Theme: "pure" (default) — a blank line for breathing room, then one
# calm info line (bold blue path, grey branch, red failure badge, amber
# duration, blue jobs), then a lone magenta arrow on its own line. Your
# commands always start at the same column, and nothing appears unless
# it carries information.
#
# ~/Documents/hellish feat/rc-theming* ✘1 took 3.2s ⚙1
# ❯
PS1='\n\[\e[1;38;2;122;162;247m\]\w\[\e[0m\] \[\e[38;2;125;133;144m\]\g\[\e[0m\]\[\e[1;38;2;224;108;117m\]\S\[\e[0m\]\[\e[38;2;229;192;123m\]\p\[\e[0m\]\[\e[1;38;2;125;207;255m\]\J\[\e[0m\] \A\n\[\e[1;38;2;198;120;221m\]❯\[\e[0m\] '
PS2='\[\e[38;2;125;133;144m\]❯\[\e[0m\] '
# Theme: "ember" — framed two-liner, user shown, same badges.
# PS1='\[\e[38;2;90;96;106m\]╭─\[\e[0m\] \[\e[1;38;2;122;162;247m\]\u\[\e[0m\] \[\e[38;2;108;114;125m\]in\[\e[0m\] \[\e[1;38;2;158;203;255m\]\w\[\e[0m\] \[\e[1;38;2;152;195;121m\]\g\[\e[0m\]\[\e[1;38;2;224;108;117m\]\S\[\e[0m\]\n\[\e[38;2;90;96;106m\]╰─\[\e[0m\] \[\e[1;38;2;152;195;121m\]❯\[\e[0m\] '
# PS2='\[\e[38;2;108;114;125m\]│ \[\e[0m\]'
# Theme: "minimal" — everything on one line, basename only.
# PS1='\[\e[1;38;2;122;162;247m\]\W\[\e[0m\]\[\e[38;2;125;133;144m\] \g\[\e[0m\]\[\e[1;38;2;224;108;117m\]\S\[\e[0m\] \[\e[1;38;2;152;195;121m\]❯\[\e[0m\] '
# Theme: "classic" — bash look, zero color.
# PS1='\u@\h:\w\$ '
# ── 2. LINE EDITING & OPTIONS ─────────────────────────────────────────
# set -o supports: errexit nounset xtrace noglob noclobber allexport
# noexec verbose pipefail vi emacs
set -o emacs # line editing mode (or: set -o vi)
# set -o noclobber # `>` refuses to overwrite files; force with >|
# set -o pipefail # a pipeline fails if ANY stage fails
# ── 3. ENVIRONMENT ────────────────────────────────────────────────────
export EDITOR=vim
export PAGER=less
export LESS='-R' # let pagers pass ANSI colors through
# PATH. A LOGIN hellish (chsh, or --login) sources /etc/profile — and so
# the .sh snippets in /etc/profile.d, which is where your distro adds
# things like /snap/bin — and then ~/.profile, before it gets here. So the
# PATH you had under bash carries over; you do not need to rebuild it.
# What you still add by hand is anything you only want under hellish.
# The case guard makes each addition idempotent: this file is re-sourced
# by every nested interactive hellish, and an unguarded prepend would
# stack a fresh copy each time until PATH is mostly duplicates.
case ":$PATH:" in
*":$HOME/.local/bin:"*) ;;
*) export PATH="$HOME/.local/bin:$PATH" ;;
esac
# Same shape for anything else you keep outside the system prefixes:
# case ":$PATH:" in
# *":$HOME/.cargo/bin:"*) ;;
# *) export PATH="$HOME/.cargo/bin:$PATH" ;;
# esac
# ── 4. ALIASES ────────────────────────────────────────────────────────
alias ls='ls --color=auto'
alias ll='ls -lh --color=auto'
alias la='ls -lha --color=auto'
alias grep='grep --color=auto'
alias ..='cd ..'
alias ...='cd ../..'
alias g='git'
alias gs='git status --short'
alias gl='git log --oneline -15'
alias gd='git diff'
# ── 5. FUNCTIONS ──────────────────────────────────────────────────────
# mkcd DIR: create a directory (parents included) and cd into it.
mkcd() { mkdir -p "$1" && cd "$1"; }
# up [N]: climb N directories (default 1).
up() {
n="${1:-1}"
while [ "$n" -gt 0 ]; do
cd ..
n=$((n - 1))
done
}
# ── 6. HISTORY ────────────────────────────────────────────────────────
# Kept in ~/.hellish_history; multiline commands are joined into one
# entry (bash cmdhist behaviour) so arrow-up recalls whole constructs.
# ── 7. HELLISH DIAGNOSTIC TOGGLES (for the curious) ───────────────────
# HELLISH_ALLOC_STATS=1 hellish script.sh # live heap bytes at exit
# HELLISH_PROMPT_BENCH=1 hellish # ns per prompt render
# hellish --debug=lexer --debug=parser --debug=ast # pipeline views