You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
1.3 KiB
Bash
55 lines
1.3 KiB
Bash
12 years ago
|
# If not running interactively, don't do anything
|
||
|
[ -z "$PS1" ] && return
|
||
|
|
||
6 years ago
|
function source-file {
|
||
4 years ago
|
local file
|
||
6 years ago
|
file="$1"
|
||
|
if [[ -f "$file" ]]; then
|
||
4 years ago
|
# shellcheck disable=SC1090
|
||
4 years ago
|
source "$file"
|
||
6 years ago
|
fi
|
||
|
}
|
||
|
|
||
4 years ago
|
if [[ ! "${BASH_VERSION}" = "3.2*" ]]; then
|
||
|
shopt -s autocd
|
||
|
fi
|
||
|
|
||
4 years ago
|
CONFIG="${XDG_CONFIG_HOME:-$HOME/.config}/bash"
|
||
|
|
||
6 years ago
|
source-file /etc/bash_completion
|
||
4 years ago
|
source-file "${CONFIG}/environment.sh"
|
||
|
source-file "${CONFIG}/aliases.sh"
|
||
|
source-file "${CONFIG}/functions.sh"
|
||
|
source-file "${CONFIG}/path.sh"
|
||
|
source-file "${CONFIG}/prompt.sh"
|
||
|
source-file "${CONFIG}/completion.sh"
|
||
6 years ago
|
source-file ~/opt/bash/env
|
||
|
|
||
|
unset -f source-file
|
||
4 years ago
|
|
||
|
# append to the history file, don't overwrite it
|
||
|
shopt -s histappend
|
||
|
|
||
|
# check the window size after each command and, if necessary,
|
||
|
# update the values of LINES and COLUMNS.
|
||
|
shopt -s checkwinsize
|
||
|
|
||
|
# Disable capslock
|
||
|
if [[ -x $(which setxkbmap) ]]; then
|
||
|
if [[ $(uname) == Linux ]]; then
|
||
|
setxkbmap -option ctrl:nocaps
|
||
|
fi
|
||
|
fi
|
||
|
|
||
|
# make less more friendly for non-text input files, see lesspipe(1)
|
||
|
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
|
||
|
|
||
|
# enable color support of ls and also add handy aliases
|
||
|
if [ -x /usr/bin/dircolors ]; then
|
||
|
test -r ~/.dircolors && (eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)")
|
||
|
fi
|
||
|
|
||
|
if [ "$TERM" == xterm ]; then
|
||
|
export TERM=xterm-256color
|
||
|
fi
|