dotfiles/files/.bashrc

62 lines
1.6 KiB
Bash
Raw Normal View History

2022-12-17 00:37:53 -05:00
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
2023-02-03 23:21:16 -05:00
# history settings
2023-02-01 01:12:30 -05:00
HISTSIZE=5000
HISTFILESIZE=10000
2023-02-03 23:21:16 -05:00
2023-02-01 01:12:30 -05:00
shopt -s histappend
2023-02-03 23:21:16 -05:00
2023-02-01 05:13:27 -05:00
PROMPT_COMMAND="history -a; $PROMPT_COMMAND"
2023-02-01 01:12:30 -05:00
2023-02-03 23:08:35 -05:00
export HISTCONTROL=erasedups
2022-12-17 00:37:53 -05:00
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
# If set, the pattern "**" used in a pathname expansion context will
# match all files and zero or more directories and subdirectories.
shopt -s globstar
2023-02-03 23:25:38 -05:00
# automatically prepend cd when entering just a path in the shell
shopt -s autocd
2022-12-17 00:37:53 -05:00
# set a fancy prompt (non-color, unless we know we "want" color)
2022-12-27 19:12:25 -05:00
export TERM=xterm-color
2022-12-17 00:37:53 -05:00
# Alias definitions.
2023-02-26 01:36:59 -05:00
[[ -f ~/.bash_aliases ]] && . ~/.bash_aliases
2022-12-17 00:37:53 -05:00
# set PATH so it includes user's private bin if it exists
2023-02-26 01:41:29 -05:00
[[ -d "$HOME/bin" ]] && PATH+=":$HOME/bin"
[[ -d "$HOME/.local/bin" ]] && PATH+=":$HOME/.local/bin"
2022-12-17 00:37:53 -05:00
2023-02-04 00:50:10 -05:00
# source misc user scripts
2023-02-07 00:27:15 -05:00
if [ -d ~/git/dotfiles/source ]; then
2023-02-04 01:38:41 -05:00
for f in ~/git/dotfiles/source/.*; do if [[ -f $f ]]; then source $f ; fi; done
2023-02-04 01:38:11 -05:00
fi
2022-12-28 15:38:02 -05:00
2023-02-03 23:21:16 -05:00
# set prompt colors and style
2023-02-07 00:27:15 -05:00
if [ -f ~/.PS1 ]; then
2023-01-22 14:23:01 -05:00
source ~/.PS1
2023-01-22 14:03:26 -05:00
else
PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]$ '
fi
2023-01-23 08:45:00 -05:00
2023-02-03 23:21:16 -05:00
# fetch uninstalled package names when attempting command (arch only)
2023-02-07 00:27:15 -05:00
if [ -f /usr/share/doc/pkgfile/command-not-found.bash ]; then
2023-02-03 23:21:16 -05:00
source /usr/share/doc/pkgfile/command-not-found.bash
fi
2023-02-07 00:27:15 -05:00
2023-02-07 00:50:21 -05:00
if [ -d ~/.fzf ]; then
2023-02-07 00:42:00 -05:00
source ~/.fzf/completion.bash
source ~/.fzf/key-bindings.bash
2023-02-07 00:27:15 -05:00
fi
2023-02-07 22:59:10 -05:00
# source client specific scripts
if [ -d ~/.client ]; then
for f in ~/.client/.*; do if [[ -f $f ]]; then source $f ; fi; done
fi