summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBlake Romero <blake@developercraft.com>2025-10-27 18:12:36 +0000
committerBlake Romero <blake@developercraft.com>2025-10-27 18:12:36 +0000
commit4d93d06c2cd99d902022ed9f87c8131df2b9bd52 (patch)
treedb004f2af9d1aba72cf3bdfd04f5426f06544f3f
parent1eb78e56cd17d34c2813938eb1707bc9fadf4b79 (diff)
Add bashrc
-rw-r--r--bashrc49
1 files changed, 49 insertions, 0 deletions
diff --git a/bashrc b/bashrc
new file mode 100644
index 0000000..5061d96
--- /dev/null
+++ b/bashrc
@@ -0,0 +1,49 @@
+#!/bin/bash
+#
+# BASHRC
+#
+
+# If not running interactively, don't do anything
+[[ $- != *i* ]] && return
+
+# Disable suspend/resume (ctrl-s, ctrl-q)
+stty -ixon
+
+# Enable extended globbing
+shopt -s extglob
+
+# History settings
+HISTTIMEFORMAT="%F %T "
+HISTCONTROL=ignoredups
+
+# Number of lines to store in RAM
+HISTSIZE=5000
+
+# Number of lines to store on file
+HISTFILESIZE=10000
+
+# Append history instead of overwriting
+shopt -s histappend
+
+# Immediately add history instead of end of session
+export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"
+
+# Prompt
+red="$(tput setaf 9)"
+green="$(tput setaf 10)"
+blue="$(tput setaf 12)"
+yellow="$(tput setaf 11)"
+reset="$(tput sgr0)"
+
+host="\[$red\]\h\[$reset\]"
+user="\[$blue\]\u\[$reset\]"
+dir="\[$yellow\]\w\[$reset\]"
+function branch() {
+ branch="$(git branch 2>/dev/null | sed -n -E 's/^\* (.*)/\1/p')"
+ [ -n "$branch" ] && printf " on \001%s\002%s\001%s\002" "$green" "$branch" "$reset"
+}
+export PS1="[$user@$host in $dir\$(branch)] "
+
+# Load aliases
+[[ -f ~/.bash_aliases ]] && source ~/.bash_aliases
+