Browse Source

Adding a default bashrc config

pull/2/head
Ryan Reed 3 years ago
parent
commit
b8290da896
3 changed files with 50 additions and 0 deletions
  1. +22
    -0
      dot_bashrc
  2. +28
    -0
      dot_config/bash/bashrc
  3. +0
    -0
      dot_local/state/bash/.keep

+ 22
- 0
dot_bashrc View File

@ -0,0 +1,22 @@
#!/bin/bash
# Ensure XDG locations are defined
export XDG_CONFIG_HOME="$HOME"/.config
export XDG_CACHE_HOME="$HOME"/.cache
export XDG_DATA_HOME="$HOME"/.local/share
export XDG_STATE_HOME="$HOME"/.local/state
export HISTFILE="$XDG_STATE_HOME"/bash/history
export VIMINIT="set nocp | source ${XDG_CONFIG_HOME}/vim/vimrc"
# Load default system settings
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# Load custom bash settings
if [ -f "$XDG_CONFIG_HOME/bash/bashrc" ]; then
. "$XDG_CONFIG_HOME/bash/bashrc"
fi

+ 28
- 0
dot_config/bash/bashrc View File

@ -0,0 +1,28 @@
shopt -s cdspell # correct spelling for directories
shopt -s checkwinsize # Check columns and lines window size after every run
shopt -s extglob #
shopt -s nocaseglob; # Case-insensitive globbing (used in pathname expansion)
shopt -s histverify # Don't run history substitution immediately (!!), require confirmation
shopt -s cmdhist # Save multi-line commands as one command
shopt -s histappend # Append history across shells
export HISTCONTROL=ignoreboth:erasedups # Ignore duplicates in the history and commands starting with space
export HISTSIZE=500000
export HISTFILESIZE=100000
export HISTTIMEFORMAT='%F %T - '
# Simple prompt coloring
PS1="$(if [[ ${EUID} == 0 ]]; then echo '\[\033[01;31m\]\h'; else echo '\[\033[01;32m\]\u@\h'; fi)\[\033[01;34m\] \w \$([[ \$? != 0 ]] && echo \"\[\033[01;31m\]:(\[\033[01;34m\] \")\\$\[\033[00m\] "
if [[ "$(set -o | grep 'emacs\|\bvi\b' | cut -f2 | tr '\n' ':')" != 'off:off:' ]];
then
bind Space:magic-space # Enable history expansion with space e.g. !!<space> will replace the !! with your last command
bind 'set completion-ignore-case on' # Perform file completion in a case insensitive fashion
bind 'set completion-map-case on' # Treat hyphens and underscores as equivalent
# The following allows partial searching (e.g. ss<up|down> will autocomplete ssh 4.2.2.2)
bind '"\e[A": history-search-backward'
bind '"\e[B": history-search-forward'
bind '"\e[C": forward-char'
bind '"\e[D": backward-char'
fi

+ 0
- 0
dot_local/state/bash/.keep View File


Loading…
Cancel
Save