clean and refine

This commit is contained in:
2024-11-05 13:08:18 -05:00
parent c7eb412ab5
commit df1d890b3c

66
bashrc
View File

@@ -1,9 +1,37 @@
#!/usr/bin/env bash #!/usr/bin/env bash # Best bashrc in history
# Best bashrc in history
# #
# Author: Shane Peters <shane@shaner.life> # Author: Shane Peters <shane@shaner.life>
#
# Alternate Paths
#
[[ -d ~/Bin ]] && export PATH=~/Bin:$PATH # local binaries & scripts
[[ -d ~/Bin/streams ]] && export PATH=~/Bin/streams:$PATH # radio streams
[[ -d /usr/local/cuda/bin ]] && export PATH=/usr/local/cuda-11.8/bin:$PATH
[[ -d /opt/node/node/bin ]] && export PATH=/opt/node/node/bin:$PATH # local binaries & scripts
[[ -d /opt/zeek/bin ]] && export PATH=/opt/zeek/bin:$PATH
[[ -d ~/.local/bin ]] && export PATH=~/bin:~/.local/bin:$PATH
[[ -d ~/.cargo/bin ]] && export PATH=~/.cargo/bin:$PATH
#
# App env variables
#
export EDITOR='vim'
export LANG=en_US.utf8
export HISTIGNORE="&:[ ]*:ls:ls -a:cd:cd .." # leave commands out of history log
export HISTCONTROL='ignoredups'
export HISTSIZE=5000
export HISTFILESIZE=5000
export PAGER='less'
export TZ='America/New_York'
export VISUAL=$EDITOR
export VAULT_TOKEN=root
export VAULT_ADDR=http://127.0.0.1:8200
[[ -x /usr/bin/lesspipe ]] && eval "$(SHELL=/bin/sh lesspipe)" # less more friendly for non-text
#
# SSH agent # SSH agent
#
SSH_ENV="$HOME/.ssh/agent-environment" SSH_ENV="$HOME/.ssh/agent-environment"
start_agent() { start_agent() {
/usr/bin/ssh-agent | sed 's/^echo/#echo/' >"$SSH_ENV" /usr/bin/ssh-agent | sed 's/^echo/#echo/' >"$SSH_ENV"
@@ -21,32 +49,6 @@ else
start_agent start_agent
fi fi
#
# Alternate Paths
#
[[ -d ~/Bin ]] && export PATH=~/Bin:$PATH # local binaries & scripts
[[ -d ~/Bin/streams ]] && export PATH=~/Bin/streams:$PATH # radio streams
[[ -d /usr/local/cuda/bin ]] && export PATH=/usr/local/cuda-11.8/bin:$PATH
[[ -d /opt/node/node/bin ]] && export PATH=/opt/node/node/bin:$PATH # local binaries & scripts
[[ -d /opt/zeek/bin ]] && export PATH=/opt/zeek/bin:$PATH
[[ -d ~/.local/bin ]] && export PATH=~/bin:~/.local/bin:$PATH
[[ -d ~/.cargo/bin ]] && export PATH=~/.cargo/bin:$PATH
#
# App env variables
#
export EDITOR='vim'
export HISTIGNORE="&:[ ]*:ls:ls -a:cd:cd .." # leave commands out of history log
export HISTCONTROL='ignoredups'
export HISTSIZE=5000
export HISTFILESIZE=5000
export PAGER='less'
export TZ='America/New_York'
export VAULT_TOKEN=root
export VAULT_ADDR=http://127.0.0.1:8200
export LANG=en_US.utf8
export VISUAL=$EDITOR
[[ -x /usr/bin/lesspipe ]] && eval "$(SHELL=/bin/sh lesspipe)" # less more friendly for non-text
# #
# bash options # bash options
@@ -58,7 +60,7 @@ shopt -s nocaseglob # case-insensitive pathname expansion
shopt -s autocd # enter directory without cd shopt -s autocd # enter directory without cd
shopt -s cdspell # correct minor errors in directory names with cd shopt -s cdspell # correct minor errors in directory names with cd
shopt -s dirspell # attempt spelling correction on directory names in completion shopt -s dirspell # attempt spelling correction on directory names in completion
#shopt -s dotglob # includes filenames beginning with a `.' in filename expansion shopt -s dotglob # includes filenames beginning with a `.' in filename expansion
shopt -s histappend # append to history file, instead of overwriting it shopt -s histappend # append to history file, instead of overwriting it
shopt -s no_empty_cmd_completion # not attempt to search for possible completions on an empty line. shopt -s no_empty_cmd_completion # not attempt to search for possible completions on an empty line.
shopt -s globstar # recursive globbing with ** shopt -s globstar # recursive globbing with **
@@ -73,14 +75,12 @@ stty -ixon # disable ^S/^Q flow control
if [[ "$OSTYPE" == "darwin"* ]] || [[ "$OSTYPE" == "sun"* ]] ; then if [[ "$OSTYPE" == "darwin"* ]] || [[ "$OSTYPE" == "sun"* ]] ; then
# BSD/macOS # BSD/macOS
export LS_COLORS='ExGxbEaECxxEhEhBaDaCaD' export LS_COLORS='ExGxbEaECxxEhEhBaDaCaD'
echo "BSD/macOS detected: LS_COLORS set for BSD/macOS."
else else
# Linux # Linux
export LS_COLORS='di=34:ln=36:su=31;47:sg=35;47' export LS_COLORS='di=36:ln=35:su=31;47:sg=35;47'
echo "Linux detected: LS_COLORS set for Linux."
fi fi
export GREP_COLOR='1;36' export GREP_COLOR='mt=1;36'
export LESS="-R" # less colored output export LESS="-R" # less colored output
export LESS_TERMCAP_mb=$'\E[01;31m' # begin blinking export LESS_TERMCAP_mb=$'\E[01;31m' # begin blinking
export LESS_TERMCAP_md=$'\E[01;38;5;74m' # begin bold export LESS_TERMCAP_md=$'\E[01;38;5;74m' # begin bold