-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.bashrc
131 lines (108 loc) · 2.95 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# Emacs doom {{{
if [ -d "$HOME/.emacs.d" ]; then
export PATH="$HOME/.emacs.d/bin:$PATH"
fi
# }}}
# nvm {{{
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && . "$NVM_DIR/bash_completion"
# }}}
# rbenv {{{
export RBENV_ROOT="$HOME/.rbenv"
if [ -d "$RBENV_ROOT" ]; then
export PATH="$RBENV_ROOT/bin:$PATH"
eval "$(rbenv init -)"
fi
# }}}
# pyenv {{{
export PYENV_ROOT="$HOME/.pyenv"
if [ -d "$PYENV_ROOT" ]; then
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
fi
# }}}
# goenv {{{
export GOENV_DISABLE_GOPATH=1
export GOENV_ROOT="$HOME/.goenv"
if [ -d "$GOENV_ROOT" ]; then
export PATH="$GOENV_ROOT/bin:$PATH"
eval "$(goenv init -)"
export GOROOT=$GOENV_ROOT/versions/$(goenv version-name)
fi
export GOPATH=$HOME/go
export GOBIN=$GOPATH/bin
export PATH="$PATH:$GOBIN"
# export PATH="$PATH:$GOBIN:$GOROOT/bin"
export GO111MODULE=auto
# }}}
# exenv {{{
export EXENV_ROOT="$HOME/.exenv"
if [ -d "$EXENV_ROOT" ]; then
export PATH="$EXENV_ROOT/bin:$PATH"
eval "$(exenv init -)"
fi
# }}}
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# Color Bash Prompt
# inspired by the oh-my-zsh's gentoo
PS1='\[\e[1;32m\]\u@\h\[\e[m\]\[\e[1;34m\] \w \$ \[\e[0m\]'
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth
# append to the history file, don't overwrite it
shopt -s histappend
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
#alias dir='dir --color=auto'
#alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi
# include .alias if it exists
if [ -f "$HOME/.alias" ]; then
. "$HOME/.alias"
fi
# include .bashrc.local if it exists
if [ -f "$HOME/.bashrc.local" ]; then
. "$HOME/.bashrc.local"
fi
# Alias definitions.
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias ga='git add'
alias gb='git branch'
alias gc='git commit'
alias gd='git diff'
alias gst='git status'
alias gco='git checkout'
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
# User configuration
export SSH_KEY_PATH="~/.ssh/id_rsa"
export TERM=xterm-256color
export ALTERNATE_EDITOR=""
# Press Ctrl+D forty-two times before it actually quits the shell
export IGNOREEOF=42
# Preferred editor for local and remote sessions
if [[ -n $SSH_CONNECTION ]]; then
export EDITOR='vim'
else
if which mvim >/dev/null; then
export EDITOR="mvim"
else
export EDITOR='vim'
fi
fi