-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathbashrc
57 lines (46 loc) · 1.75 KB
/
bashrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/env bash
# bashrc _▄▄
# _▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄█●_█
# █ - ◄█▘ ◦ ▝█ -▄█ █
# ▜▄▄█▄▄█▄▄█▄▄█▄▄███▄▄▛
# github.com/rafi/.config
# Abort if not running interactively
[[ $- == *i* ]] || return 0
# Remove mappings. See all: stty -a
stty stop undef # Remove the ^Q mapping
stty start undef # Remove the ^S mapping
# Bash settings
shopt -s cdspell # Auto-corrects cd misspellings
# shopt -s dirspell # Auto-corrects cd misspellings
shopt -s cmdhist # Save multi-line commands in history as single line
shopt -s dotglob # Include dotfiles in pathname expansion
shopt -s expand_aliases # Expand aliases
shopt -s extglob # Enable extended pattern-matching features
shopt -s histreedit # Add failed commands to the bash history
shopt -s histappend # Append each session's history to $HISTFILE
shopt -s histverify # Edit a recalled history line before executing
if [[ $DISPLAY ]]; then
shopt -s checkwinsize # Update LINES and COLUMNS after each command
fi
# Enable readline vi-mode for myself only
# See ./functions/ssh.bash for implementation
if [ "${LC_IDENTIFICATION:-$USER}" = rafi ] \
|| [[ "${LC_IDENTIFICATION:-$USER}" == rafael* ]]
then
set -o vi
fi
# Source all extra functions
for func in "$XDG_CONFIG_HOME/bash/functions/"*.bash; do
# shellcheck disable=1090
source "$func"
done
unset func
# Load bash completions
source "$XDG_CONFIG_HOME/bash/completion"
# Load bash aliases
source "$XDG_CONFIG_HOME/bash/aliases"
# Load CLI utilities
source "$XDG_CONFIG_HOME/bash/utils"
# Clean-up Apple's useless garbage
[ -f .DS_Store ] && rm -f .DS_Store
# vim: set ft=sh ts=2 sw=2 tw=80 noet :