From a28908640e63fcc4c992253c7989c0ef2712f361 Mon Sep 17 00:00:00 2001 From: John Mertz Date: Wed, 31 Jan 2024 22:16:09 -0700 Subject: [PATCH] Move internal shell variables and settings to dedicated file --- bash/bashrc | 24 +++--------------------- bash/shell_config | 25 +++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 21 deletions(-) create mode 100644 bash/shell_config diff --git a/bash/bashrc b/bash/bashrc index c22be67ed..21a7e8860 100644 --- a/bash/bashrc +++ b/bash/bashrc @@ -25,27 +25,9 @@ if [ "$(tty)" == '/dev/tty1' ] && [ ! "$SSH_TTY" ]; then fi fi -# don't put duplicate lines or lines starting with space in the history. -shopt -s histappend -HISTCONTROL=ignoreboth -HISTFILE=${HOME}/.spool/bash_history - -# append to the history file, don't overwrite it -# for setting history length see HISTSIZE and HISTFILESIZE in bash(1) -HISTSIZE=500000 -HISTFILESIZE=1000000 - -# check the window size after each command and, if necessary, -# update the values of LINES and COLUMNS. -shopt -s checkwinsize - -# enable programmable completion features -if ! shopt -oq posix; then - if [ -f /usr/share/bash-completion/bash_completion ]; then - . /usr/share/bash-completion/bash_completion - elif [ -f /etc/bash_completion ]; then - . /etc/bash_completion - fi +# Shell configuration (history, functionality, etc.) +if [ -e ${HOME}/.dotfiles/bash/shell_config ]; then + source ${HOME}/.dotfiles/bash/shell_config ]; then fi if [[ -z $TERM_TITLE ]]; then diff --git a/bash/shell_config b/bash/shell_config new file mode 100644 index 000000000..d495a0d97 --- /dev/null +++ b/bash/shell_config @@ -0,0 +1,25 @@ +#!/bin/bash + +# don't put duplicate lines or lines starting with space in the history. +shopt -s histappend +HISTCONTROL=ignoreboth +HISTFILE=${HOME}/.spool/bash_history + +# append to the history file, don't overwrite it +# for setting history length see HISTSIZE and HISTFILESIZE in bash(1) +HISTSIZE=500000 +HISTFILESIZE=1000000 + +# check the window size after each command and, if necessary, +# update the values of LINES and COLUMNS. +shopt -s checkwinsize + +# enable programmable completion features +if ! shopt -oq posix; then + if [ -f /usr/share/bash-completion/bash_completion ]; then + . /usr/share/bash-completion/bash_completion + elif [ -f /etc/bash_completion ]; then + . /etc/bash_completion + fi +fi +