-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshellrc
More file actions
executable file
·96 lines (84 loc) · 2.8 KB
/
shellrc
File metadata and controls
executable file
·96 lines (84 loc) · 2.8 KB
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
#
# .shellrc
# Init file for customizations which are agnostic to the shell being used.
#
# Shell-specific pyenv initialization
if [ -n "$ZSH_VERSION" ]; then
# ZSH-specific pyenv setup
if command -v pyenv > /dev/null 2>&1; then
eval "$(pyenv init --path)"
eval "$(pyenv init -)"
fi
elif [ -n "$BASH_VERSION" ]; then
# BASH-specific pyenv setup
if command -v pyenv > /dev/null 2>&1; then
eval "$(pyenv init -)"
fi
fi
# My prompt - ZSH and Bash compatible
if [ -n "$ZSH_VERSION" ]; then
# ZSH prompt with colors
autoload -U colors && colors
export PS1="%{$fg_bold[cyan]%}%* %{$fg_no_bold[green]%}%~ %{$reset_color%}%# "
elif [ -n "$BASH_VERSION" ]; then
# Bash prompt
export PS1="\[\e[1;36m\]\t \[\e[0;32m\]\w \[\e[0m\]\$ "
fi
# Use colors.
export CLICOLOR=1
export LSCOLORS=ExFxCxDxBxegedabagacad
# Store brew base directory for future use in this script
if command -v brew >/dev/null 2>&1; then
brew_prefix=$(brew --prefix)
fi
# Setup environment variables
if [ -f ~/Developer/github/mayank-io/dotfiles/env ]
then
source ~/Developer/github/mayank-io/dotfiles/env
fi
# Include alias file (if present) containing aliases for ssh, etc.
if [ -f ~/Developer/github/mayank-io/dotfiles/aliases ]
then
source ~/Developer/github/mayank-io/dotfiles/aliases
fi
# Initialize macOS preferences
if [ -f ~/Developer/github/mayank-io/dotfiles/osxrc ]; then
source ~/Developer/github/mayank-io/dotfiles/osxrc
fi
# Python virtualenv setup
if command -v pyenv >/dev/null 2>&1; then
export WORKON_HOME=$HOME/.virtualenvs
mkdir -p $WORKON_HOME
# Find virtualenvwrapper.sh in pyenv
if [ -f "$(pyenv prefix)/bin/virtualenvwrapper.sh" ]; then
export VIRTUALENVWRAPPER_PYTHON=$(pyenv which python3)
source "$(pyenv prefix)/bin/virtualenvwrapper.sh"
fi
fi
# NVM setup
export NVM_DIR="$HOME/.nvm"
# Try different NVM installation paths
if [ -s "/opt/homebrew/opt/nvm/nvm.sh" ]; then
# Apple Silicon Homebrew path
\. "/opt/homebrew/opt/nvm/nvm.sh"
elif [ -s "/usr/local/opt/nvm/nvm.sh" ]; then
# Intel Homebrew path
\. "/usr/local/opt/nvm/nvm.sh"
elif [ -s "$NVM_DIR/nvm.sh" ]; then
# Manual installation path
\. "$NVM_DIR/nvm.sh"
fi
# Load NVM completion
if [ -n "$ZSH_VERSION" ]; then
# ZSH completion
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
elif [ -n "$BASH_VERSION" ]; then
# Bash completion - try Homebrew paths first, then manual installation
if [ -s "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" ]; then
\. "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm"
elif [ -s "/usr/local/opt/nvm/etc/bash_completion.d/nvm" ]; then
\. "/usr/local/opt/nvm/etc/bash_completion.d/nvm"
elif [ -s "$NVM_DIR/bash_completion" ]; then
\. "$NVM_DIR/bash_completion"
fi
fi