From a179516351c3175aca83026142ab54d6ea73468a Mon Sep 17 00:00:00 2001 From: The Magician Date: Tue, 7 Nov 2023 16:40:55 +0000 Subject: [PATCH] Add .bashrc and .bash_logout --- bash/.bash_logout | 3 +++ bash/.bashrc | 55 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 bash/.bash_logout create mode 100644 bash/.bashrc diff --git a/bash/.bash_logout b/bash/.bash_logout new file mode 100644 index 0000000..3856a92 --- /dev/null +++ b/bash/.bash_logout @@ -0,0 +1,3 @@ +if [ "$SHLVL" = 1 ]; then + [ -x /usr/bin/clear_console ] && /usr/bin/clear_console -q +fi diff --git a/bash/.bashrc b/bash/.bashrc new file mode 100644 index 0000000..e0df287 --- /dev/null +++ b/bash/.bashrc @@ -0,0 +1,55 @@ +# Do nothing if not running an interactive shell +case $- in + *i*) ;; + *) return;; +esac + +# Environment variables +export TERM="xterm-256color" +export EDITOR="vi" +export VISUAL="vi" + +# The Prompt +export PS1='\u@\h:\W\$ ' + +# History settings +set -o history # Enable history +shopt -s histappend # Append to the history file instead of overwriting it +HISTCONTROL=ignoreboth # Don't put duplicate lines or lines beginning with a space in the history file +HISTSIZE=-1 # Don't limit the number of history lines stored +HISTFILESIZE=-1 # Don't truncate the history when reading the history file at the start of a shell session + +# Pager settings +# Use lesspipe if it exists +if command -v lesspipe; then + export LESSOPEN="| $(command -v lesspipe) %s"; + export LESSCLOSE="$(command -v lesspipe) %s %s"; +fi + +# Enable colors in less +export LESS_TERMCAP_mb="" +export LESS_TERMCAP_md="" +export LESS_TERMCAP_me="" +export LESS_TERMCAP_se="" +export LESS_TERMCAP_so="" +export LESS_TERMCAP_ue="" +export LESS_TERMCAP_us="" + +# Enable dircolors +if test -x "$(command -v dircolors)"; then + test -r ~/.config/shell/dircolors && + eval "$(dircolors -b ~/.config/shell/dircolors)" || + eval "$(dircolors -b)" +fi + +# Safety features +set -o noclobber # Enable features to prevent accidental file deletion + +# Shell expansion features +shopt -s globstar # Enable "**" to match recursively when globbing + +# Interactive features +set -o vi + +# Aliases +source ~/.config/shell/aliasrc