1
0
Fork 0
mirror of https://github.com/notwa/rc synced 2024-11-05 21:29:04 -08:00
rc/home/bashrc

55 lines
1.5 KiB
Bash
Raw Normal View History

2013-06-28 05:22:14 -07:00
[ -z "$PS1" ] && return
. ~/.prep # handle boring stuff like /etc/profile and $PATH
2021-07-29 00:37:35 -07:00
2013-06-28 05:22:14 -07:00
HISTCONTROL=erasedups
HISTSIZE=1000
HISTFILESIZE=2000
shopt -s histappend
shopt -s checkwinsize
#shopt -s physical # chaselinks (doesn't exist?)
set -o hashall # enable hash command
2024-02-23 22:29:55 -08:00
set +o histexpand # disable expansion of ! characters
2013-06-28 05:22:14 -07:00
2021-10-14 00:08:47 -07:00
[ "$TERM" != rxvt-unicode-256color ] || export TERM=xterm-256color
2022-09-30 16:47:21 -07:00
_temporary_scope_() {
local t="${TERM%%-*}" title=
if [ "$t" = xterm ] || [ "$t" = screen ] || [ "$t" = tmux ]; then
title='\[\033]2;\w\a\]'
fi
local color_okay='\\[\e[42m\\]'
local color_fail='\\[\e[41m\\]'
local line1=' \\[\e[0m\\]'
local line2='\\[\e[1;37m\\]\\$\\[\e[0m\\] '
local ret_okay="$title$color_okay$line1\n$color_okay$line2"
local ret_fail="$title$color_fail$line1\n$color_fail$line2"
PROMPT_COMMAND="[ \$? = 0 ] && PS1=\$'$ret_okay' || PS1=\$'$ret_fail'"
}; _temporary_scope_; unset _temporary_scope_
2013-06-28 05:22:14 -07:00
. ~/.shrc
2021-07-29 00:37:35 -07:00
2013-06-28 05:22:14 -07:00
# this doesn't work for all scripts at the moment, but
2013-07-01 02:22:36 -07:00
ADDPATH "$HOME/sh"
2013-06-29 11:47:01 -07:00
2022-09-30 17:17:15 -07:00
# combine everything matching "YES_BASH" in ~/sh/ into ~/.sh-bash.
# unlike zsh, we do not check the sha1sum of the output.
(: \
&& cd ~/sh \
&& printf '%s\n' '#!/usr/bin/env false' '[ -n "$preload" ] || exit 1' '' \
| cat - > ~/.sh-bash \
$(grep -lF YES_BASH -- $(find ~/sh/ -maxdepth 1 -type f '!' -name '*.bak')) \
;)
dummy() { :; } ### @- return 0, ignoring arguments.
preload=dummy
. ~/.sh-bash
unset preload
2021-07-30 17:57:08 -07:00
alias reload='cd; exec bash' ### @- **TODO:** respect initctl like in `.zshrc`.
[ ! -e ~/.lol ] || . ~/.lol
2022-09-30 16:47:21 -07:00
true