forked from DanielFGray/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprofile
60 lines (50 loc) · 1.49 KB
/
profile
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
# vim: ft=sh
if [[ -n "$BASH_VERSION" && -f "$HOME/.bashrc" ]]; then
source "$HOME/.bashrc"
IFS=: read -ra current_path <<< "$PATH"
elif [[ -n "$ZSH_VERSION" ]]; then
IFS=: read -rA current_path <<< "$PATH"
fi
has() {
for c; do
command -v "$c" &> /dev/null || return 1
done
}
dirs=()
has cope_path && dirs+=( "$(cope_path)" )
has ruby gem && dirs+=( "$(ruby -e 'print Gem.user_dir')/bin" )
dirs+=(
"$HOME/.rakudobrew/bin"
"$HOME/.rvm/bin"
"$HOME/.npm/bin"
"$HOME/.yarn/bin"
"$HOME/.cabal/bin"
"$HOME/.cargo/bin"
"$HOME/.go/bin"
"$HOME/.perlbrew/bin"
"$HOME/bin"
"$HOME/.bin"
"$HOME/.local/bin"
)
for d in "${dirs[@]}"; do
if [[ -d "$d" && ! " ${current_path[*]} " = *" $d "* ]]; then
PATH="$d:$PATH"
fi
done
export PATH
if has fzf; then
has fnd && {
export FZF_DEFAULT_COMMAND='fnd -no-hidden'
export FZF_CTRL_T_COMMAND='fnd -no-hidden'
export FZF_ALT_C_COMMAND='fnd -no-hidden -type d'
}
export FZF_DEFAULT_OPTS='--bind="Ctrl-A:toggle-all,`:jump,Ctrl-d:half-page-down,Ctrl-u:half-page-up" --inline-info --cycle --jump-labels="asdfghjkl;qwertyuiopzxcvbnm1234567890"'
export FZF_CTRL_R_OPTS='--reverse -e --height='50%' --bind="?:toggle-preview" --preview="echo {}" --preview-window="down:3:wrap:hidden"'
fi
if has rustc racer; then
export RUST_SRC_PATH="$HOME/.multirust/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src"
fi
if has x-www-browser; then
export BROWSER='x-www-browser'
fi
# export PATH="$HOME/.cargo/bin:$PATH"