summaryrefslogtreecommitdiff
path: root/common/programs/bash.nix
diff options
context:
space:
mode:
Diffstat (limited to 'common/programs/bash.nix')
-rw-r--r--common/programs/bash.nix41
1 files changed, 41 insertions, 0 deletions
diff --git a/common/programs/bash.nix b/common/programs/bash.nix
new file mode 100644
index 0000000..1ad9e80
--- /dev/null
+++ b/common/programs/bash.nix
@@ -0,0 +1,41 @@
+{
+ programs.bash = {
+ enable = true;
+ historySize = 10000;
+ historyFile = "$HOME/.bash_history";
+ historyControl = [
+ "ignorespace"
+ "erasedups"
+ ];
+ initExtra = ''
+ shopt -s histappend
+
+ bind "set completion-ignore-case on"
+ bind "set show-all-if-ambiguous on"
+
+ bind '"\e[Z": menu-complete-backward'
+
+ bind '"\e[A": history-search-backward'
+ bind '"\e[B": history-search-forward'
+
+
+ if [ "$TERM" != "dumb" ] || [ -n "$INSIDE_EMACS" ]; then
+ # Removed the '1;' prefix to disable bold
+ PROMPT_COLOR="31m"
+ ((UID)) && PROMPT_COLOR="32m"
+
+ if [ -n "$INSIDE_EMACS" ]; then
+ PS1="\[\033[$PROMPT_COLOR\]\u@\h:\w\\$\[\033[0m\] "
+ else
+ # PS1="\[\033[$PROMPT_COLOR\]\[\e]0;\u@\h: \w\a\]\u@\h:\w\\$\[\033[0m\] "
+ PS1="\[\e[38;5;75m\]\u@\h \[\e[38;5;113m\]\w \[\e[38;5;189m\]\$ \[\e[0m\]"
+ fi
+
+ if test "$TERM" = "xterm"; then
+ PS1="\[\033]2;\h:\u:\w\007\]$PS1"
+ fi
+ fi
+ '';
+ };
+
+}