dot_testing/lappy/config/bash/bashrc

44 lines
952 B
Bash
Raw Normal View History

#!/bin/bash
# if not interactive, don't do anything
[ -z "$PS1" ] && return
# some housekeeping
alias ls="ls --color=auto --group-directories-first"
2024-12-19 17:20:18 -06:00
alias weather="curl https://wttr.in"
alias lynx="lynx -cfg=$LYNX_CFG_PATH/lynx.cfg"
alias elinks="TERM='xterm-color' elinks"
alias pkgsearch="nix search nixpkgs"
alias reload=". ~/.config/bash/profile"
function cd() {
builtin cd "$@" && ls --color=auto --group-directories-first
}
# history
HISTCONTROL=ignorespace:ignoredups:erasedups
HISTFILESIZE=9999999999
HISTSIZE=9999999999
# bash specific settings
set -o vi # vim mode
shopt -s autocd
shopt -s cmdhist
shopt -s histreedit
shopt -s histappend
shopt -s histverify
PS1="\w\$ "
if [ -n "$IN_NIX_SHELL" ]; then
NIX_SHELL_PS1="nix:"
fi
if [ "$USER" = "root" ]; then
USER_PREFIX="\[\033[41m\]root:\[\033[0;0m\]"
elif [ "$USER" != "usr" ]; then
USER_PREFIX="$USER:"
fi
PS1="$USER_PREFIX\[\033[36;1m\]${NIX_SHELL_PS1}arist:$PS1\[\033[0;0m\]"