Further tweak .bashrc for both linux/work mac
This commit is contained in:
parent
17395f464e
commit
f2da865f30
54
.bashrc
54
.bashrc
|
@ -14,10 +14,10 @@ shopt -s globstar # pattern '**' matches all files, >= 0 dir/subdirs
|
|||
#shopt -s expand_aliases # //
|
||||
|
||||
|
||||
shopt -s histappend # append to history file instead of overwriting
|
||||
HISTCONTROL=ignoredups # ignore duplicate commands or if start with a space
|
||||
HISTSIZE=48000 # history lines stored in memory (while using bash)
|
||||
HISTFILESIZE=48000 # history lines stored in .bash_history after session
|
||||
HISTCONTROL=ignoredups # ignore duplicate commands or if start with a space
|
||||
shopt -s histappend # append to history file instead of overwriting
|
||||
|
||||
case "$(uname -s)" in # for OS-specific configuration
|
||||
Linux) operating_system='linux' ;;
|
||||
|
@ -32,16 +32,26 @@ esac
|
|||
# apply "secret" settings (these are just settings I don't want in git)
|
||||
[ -f "$HOME"/.bashrc_secrets ] && source "$HOME"/.bashrc_secrets
|
||||
|
||||
# apply work settings
|
||||
[ -f "$HOME"/.bash_work_stuff ] && source "$HOME"/.bash_work_stuff
|
||||
|
||||
# set PATH to something tolerable
|
||||
# NOTE: in Arch, everything's already in /usr/bin, /usr/sbin anyway
|
||||
PATH="/usr/bin:/usr/local/bin:/bin:/usr/sbin:/usr/local/sbin:/sbin" # base
|
||||
PATH="$PATH:/var/lib/snapd/snap/bin" # snapd
|
||||
PATH="$PATH:/usr/local/games:/usr/games" # base
|
||||
if [ "$hostname" = "shorefall" ]; then
|
||||
PATH="$PATH:$HOME/bin" # my own secret sauce
|
||||
PATH="$PATH:$HOME/bin/jdk-11.0.10+9/bin" # JavaTM
|
||||
PATH="$PATH:$HOME/bin/android-studio/bin" # Android Studio
|
||||
PATH="$PATH:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl" # BS
|
||||
if [ "$operating_system" = "linux" ]; then
|
||||
PATH="/usr/bin:/usr/local/bin:/bin:/usr/sbin:/usr/local/sbin:/sbin" # base
|
||||
PATH="$PATH:/var/lib/snapd/snap/bin" # snapd
|
||||
PATH="$PATH:/usr/local/games:/usr/games" # base
|
||||
if [ "$hostname" = "shorefall" ]; then
|
||||
PATH="$PATH:$HOME/bin" # secret sauce
|
||||
PATH="$PATH:$HOME/bin/jdk-11.0.10+9/bin" # JavaTM
|
||||
PATH="$PATH:$HOME/bin/android-studio/bin" # Android Studio
|
||||
PATH="$PATH:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl"
|
||||
fi
|
||||
elif [ "$operating_system" = "macOS" ]; then
|
||||
PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
|
||||
PATH="$PATH:/Applications/Vmware Fusion.app/Contents/Public"
|
||||
PATH="$PATH:/Library/Apple/usr/bin"
|
||||
work_set_path "$PATH"
|
||||
fi
|
||||
export PATH
|
||||
|
||||
|
@ -224,23 +234,17 @@ alias cl='clear '
|
|||
alias e='exit '
|
||||
alias q='exit '
|
||||
alias DIE='shutdown now '
|
||||
alias cp='cp -i ' # confirm before overwriting a file
|
||||
alias cp='cp -i ' # confirm before overwriting a file
|
||||
alias df='df -h '
|
||||
alias fucking='sudo '
|
||||
alias goddammit=' '
|
||||
alias bottom='top '
|
||||
alias bc='bc -l ' # makes bc use 'scale=20' by default
|
||||
alias grep='grep --color=auto '
|
||||
alias egrep='egrep --color=auto '
|
||||
alias fgrep='fgrep --color=auto '
|
||||
alias bc='bc -l ' # makes bc use 'scale=20' by default
|
||||
alias vim="$EDITOR "
|
||||
alias i3config="$EDITOR ~/.config/i3/config && i3-msg reload && i3-msg restart"
|
||||
alias bashrc="$EDITOR ~/.bashrc"
|
||||
alias vimrc="$EDITOR ~/.vimrc"
|
||||
alias nanorc="nano ~/.config/nano/nanorc" # just for fun!
|
||||
alias spellcheck='aspell check '
|
||||
alias nanorc="nano ~/.config/nano/nanorc" # just for fun!
|
||||
alias rot13="tr 'A-Za-z' 'N-ZA-Mn-za-m' "
|
||||
alias iso-date='date --iso-8601=s '
|
||||
|
||||
not_in_vim="echo -e \"You're not in vim doofus!\""
|
||||
alias :wq="$not_in_vim" ; alias :q="$not_in_vim" ; alias :x="$not_in_vim"
|
||||
|
@ -251,6 +255,12 @@ alias rangre='ranger '; alias rangr='ranger ' # <<<-^^^-: common ranger typos
|
|||
|
||||
alias gdb='gdb -q ' # muzzle gdb
|
||||
|
||||
if [ "$hostname" = "shorefall" ]; then
|
||||
alias i3config="$EDITOR ~/.config/i3/config && i3-msg reload && i3-msg restart"
|
||||
alias spellcheck='aspell check '
|
||||
alias iso-date='date --iso-8601=s '
|
||||
fi
|
||||
|
||||
if [[ "$operating_system" = "macOS" ]]; then
|
||||
alias ls='ls -C '
|
||||
alias l='ls -C '
|
||||
|
@ -263,12 +273,16 @@ elif [[ "$operating_system" = "BSD" ]]; then
|
|||
alias ll='ls -lh --color=auto '
|
||||
alias la='ls -A --color=auto '
|
||||
alias lla='ls -lhA --color=auto '
|
||||
else # assume GNU ls (should work on _most_ Linuxes)
|
||||
else # assume GNU ls (most desktop Linux distros)
|
||||
alias ls='ls -C --color=auto '
|
||||
alias l='ls -C --color=auto '
|
||||
alias ll='ls -lh --color=auto '
|
||||
alias la='ls -A --color=auto '
|
||||
alias lla='ls -lhA --color=auto '
|
||||
|
||||
alias grep='grep --color=auto '
|
||||
alias egrep='egrep --color=auto '
|
||||
alias fgrep='fgrep --color=auto '
|
||||
fi
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue