-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bashrc
56 lines (45 loc) · 1.81 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
# From a combination of dotfiles
# See:
# https://github.com/fastai/dotfiles/blob/master/.bashrc.local
# https://github.com/geohot/configuration/blob/master/.bashrc
# https://github.com/daler/dotfiles/blob/master/.bashrc
# Load the shell dotfiles, and then some:
# * ~/.path can be used to extend `$PATH`.
# * ~/.extra can be used for other settings you don’t want to commit.
for file in ~/.{path,exports,bash_prompt,functions,aliases,extra}; do
[ -r "$file" ] && [ -f "$file" ] && source "$file";
done;
unset file;
[ -z "$PS1" ] && return # exit early if not interactive
shopt -s checkwinsize # updates size of terminal after commands
# Enable some Bash 4 features when possible:
# * `autocd`, e.g. `**/qux` will enter `./foo/bar/baz/qux`
# * Recursive globbing, e.g. `echo **/*.txt`
for option in autocd globstar; do
shopt -s "$option" 2> /dev/null || true
done;
if [ -f /etc/bash_completion ]; then
source /etc/bash_completion;
fi
# makes less work on things like tarballs and images
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
if [[ $OSTYPE == darwin* ]]; then
test -f ~/.git-completion.bash && source ~/.git-completion.bash
fi
# Rust cargo support
if [ -f $HOME/.cargo/env ]; then
. "$HOME/.cargo/env"
fi
# New bash shells spawned by tmux will silently break conda environments by
# placing the system path in front of the conda env path -- even though the
# prompt still indicates an active environment. This can be quite confusing.
#
# So if we're starting a bash shell under tmux, deactivate all environments.
#
# The `ca` and `conda_deactivate_all` functions used here are defined in the
# .functions file, which in turn was sourced at the beginning of this file.
if command -v conda > /dev/null; then
if [ ! -z $TMUX ]; then
conda_deactivate_all
fi
fi