-
Notifications
You must be signed in to change notification settings - Fork 0
/
bashrc
101 lines (89 loc) · 2.05 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#
# $Version$
# $Revision$
#
# BASH startup
#
. $HOME/.rcenv
# Options
#
set -o noclobber
set -o physical
shopt -s cdspell
shopt -s extglob
shopt -s dotglob
shopt -s cmdhist
shopt -s lithist
shopt -s progcomp
shopt -s checkhash
shopt -s histreedit
shopt -s promptvars
shopt -s cdable_vars
shopt -s checkwinsize
shopt -s hostcomplete
shopt -s expand_aliases
shopt -s interactive_comments
HISTTIMEFORMAT="%d/%m/%y %T "
# Key bindings
#
bind 'TAB:menu-complete'
bind 'set show-all-if-ambiguous on'
# Completions
#
if [ ! -z "$HOMEBREW" ]
then
if [ -r "$HOMEBREW/etc/profile.d/bash_completion.sh" ]
then
source "/opt/homebrew/etc/profile.d/bash_completion.sh"
else
if [[ -d "${HOMEBREW}/etc/bash_completion.d" ]]
then
for COMPLETION in "${HOMEBREW}/etc/bash_completion.d/"*
do
[[ -r "${COMPLETION}" ]] && source "${COMPLETION}"
done
fi
fi
if [[ -d "${HOMEBREW}/share/bash_completion" ]]
then
for COMPLETION in "${HOMEBREW}/sahre/bash_completion/"*
do
[[ -r "${COMPLETION}" ]] && source "${COMPLETION}"
done
fi
fi
if [ -f "$SHARE/bash_completion/bash_completion.sh" ]; then
. $SHARE/bash_completion/bash_completion
fi
complete -A setopt set
complete -A user groups
complete -A binding bind
complete -A helptopic help
complete -A alias {,un}alias
complete -A signal -P '-' kill
complete -A stopped -P '%' fg bg
complete -A job -P '%' jobs disown
complete -A variable readonly unset
complete -A file -A directory ln chmod
complete -A user -A hostname finger pinky
complete -A directory find cd pushd {mk,rm}dir
complete -A file cat pico nano vi vim view emacs
complete -A file -A directory -A user chown
complete -A file -A directory -A group chgrp
complete -o default -W 'Makefile' -P '-o ' qmake
complete -A command man which whatis sudo info apropos
# Prompts
#
if [ $(id -u) -eq 0 ]; then
rgb_usr="${rgb_red}"
else
rgb_usr="${rgb_green}"
fi
PS1="${rgb_usr}$(whoami)${rgb_std}@$(hostname -s) \w ${rgb_usr}\\\$${rgb_restore} "
# FZF integration
#
if type fzf &>/dev/null
then
source <(fzf --bash)
fi
# $Id$