2016-04-29 15:18:05 +00:00
|
|
|
#!/bin/bash
|
2016-01-20 17:06:54 +00:00
|
|
|
#
|
|
|
|
# ~/.bashrc
|
|
|
|
#
|
|
|
|
# Thurstylark
|
2017-02-16 08:23:49 +00:00
|
|
|
#
|
|
|
|
# Reference: https://wiki.thurstylark.com/Bashrc.html
|
2016-01-20 17:06:54 +00:00
|
|
|
|
2019-05-16 03:45:06 +00:00
|
|
|
### GENERAL CONFIG ###
|
2016-01-21 19:42:34 +00:00
|
|
|
|
2016-01-20 17:06:54 +00:00
|
|
|
# If not running interactively, don't do anything
|
|
|
|
[[ $- != *i* ]] && return
|
|
|
|
|
2019-05-16 03:45:06 +00:00
|
|
|
# Don't put duplicate lines or lines starting with space in the history.
|
|
|
|
HISTCONTROL=ignoreboth
|
2016-03-31 17:09:10 +00:00
|
|
|
|
2019-05-16 03:45:06 +00:00
|
|
|
# If a directory is given without any command, CD into it.
|
|
|
|
shopt -s autocd
|
2016-01-20 17:06:54 +00:00
|
|
|
|
2016-04-29 15:18:05 +00:00
|
|
|
# Some programs, such as tee(1), like to use this variable
|
2017-02-16 08:23:49 +00:00
|
|
|
export LS_COLORS='di=34;40:ln=35;40:so=32;40:pi=33;40:ex=31;40:bd=34;46:cd=34;43:su=0;41:sg=0;46:tw=0;42:ow=0;43:'
|
2016-03-15 14:15:35 +00:00
|
|
|
|
2016-01-21 19:42:34 +00:00
|
|
|
# Prefer vim, but if it's not installed, nano will do
|
2019-05-16 04:17:05 +00:00
|
|
|
if [[ -s /usr/bin/vim ]]; then
|
|
|
|
export EDITOR=vim
|
|
|
|
else
|
|
|
|
export EDITOR=nano
|
|
|
|
fi
|
2016-01-21 19:42:34 +00:00
|
|
|
|
|
|
|
# Enable pkgfile to automatically search for packages if pkgfile is installed
|
2016-04-11 17:27:46 +00:00
|
|
|
[[ -s /usr/share/doc/pkgfile/command-not-found.bash ]] && source /usr/share/doc/pkgfile/command-not-found.bash
|
2016-01-21 19:42:34 +00:00
|
|
|
|
2016-01-20 17:06:54 +00:00
|
|
|
|
2019-05-16 03:45:06 +00:00
|
|
|
### UTILITIES ###
|
2016-01-20 17:06:54 +00:00
|
|
|
|
2019-05-16 03:45:06 +00:00
|
|
|
# Source all *.sh files in ~/.bashrc.d/
|
|
|
|
# This way all my useful little utilities are easier to reference and fix
|
2019-05-16 04:17:05 +00:00
|
|
|
# shellcheck source=/dev/null
|
|
|
|
for f in ~/.bashrc.d/*.sh; do source "$f"; done
|