-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.bash_extra
48 lines (38 loc) · 1.37 KB
/
.bash_extra
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
# No annoying bell or visual bell
set bell-style none
# Dont override files with >, force >|
set -o noclobber
# Allow forward search with C^s
stty stop ""
# Enable cyclic tabbing
bind '"\t":menu-complete'
# Enable some Bash 4 features when possible:
# * `autocd`, e.g. `**/qux` will enter `./foo/bar/baz/qux`
# * Recursive globbing, e.g. `echo **/*.txt`
# * Case insensitive globbing
# * Append to hist file rather than append, usefull when multiplexing
# * Autocorrect typos in pathnames
for option in globstar nocaseglob histappend cdspell; do
shopt -s "$option" 2> /dev/null
done
# Add tab completion for SSH hostnames based on ~/.ssh/config, ignoring wildcards
[ -e "$HOME/.ssh/config" ] && complete -o "default" -o "nospace" -W "$(grep "^Host" ~/.ssh/config | grep -v "[?*]" | cut -d " " -f2)" scp sftp ssh
# Add tab completion for `defaults read|write NSGlobalDomain`
# You could just use `-g` instead, but I like being explicit
complete -W "NSGlobalDomain" defaults
# If possible, add tab completion for many more commands
which brew &>/dev/null
if [ $? -eq 0 ]; then
if [ -f "$(brew --prefix)"/etc/bash_completion ]; then
. "$(brew --prefix)"/etc/bash_completion
fi
fi
# Init fasd
if type fasd &>/dev/null; then
eval "$(fasd --init auto)";
_fasd_bash_hook_cmd_complete v;
fi;
if type grunt &>/dev/null; then
eval "$(grunt --completion=bash)"
fi;
# vim: set ft=sh: