-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_bashrc
126 lines (100 loc) · 3.31 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
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
# smart cd to previous directories
if [ -e "$HOME/.cd_history.sh" ]; then
source "$HOME/.cd_history.sh"
fi
# helper functions
if [ -e "$HOME/.cd_history.sh" ]; then
source "$HOME/.bash_helpers.sh"
fi
if [ -e "$HOME/.aliases" ]; then
source "$HOME/.aliases"
fi
# cd /c/Work/GitHub/kendo
cd /d/Work/github/blazor
# remove Ctrl+s mapping
bind -r '\C-s'
# disable the terminal from interpreting Ctrl+s - used for saving in vim
stty -ixon
#------------------------------------------------------------------------------
# Path
#------------------------------------------------------------------------------
export PATH
# Prepends $1 to $PATH, provided it is a directory and is not already in $PATH.
# Based on http://superuser.com/a/39995.
function prepend_to_path() {
if [ -d "$1" ] && [[ ":$PATH:" != *":$1:"* ]]; then
PATH="$1:$PATH"
fi
}
# append_to_path() {
# if [ -d "$1" ] && [[ ":$PATH:" != *":$1:"* ]]; then
# PATH="${PATH:+"$PATH:"}$1"
# fi
# }
# Include the path to Ruby gems.
prepend_to_path "$(ruby -rubygems -e 'puts Gem.user_dir')/bin"
# Include the user's private bin.
prepend_to_path "$HOME/bin"
#------------------------------------------------------------------------------
# grep
#------------------------------------------------------------------------------
# Foreground Colours
# 30 Black
# 31 Red
# 32 Green
# 33 Yellow
# 34 Blue
# 35 Magenta
# 36 Cyan
# 37 White
#
# Background Colours
# 40 Black
# 41 Red
# 42 Green
# 43 Yellow
# 44 Blue
# 45 Magenta
# 46 Cyan
# 47 White
# export GREP_COLOR='1;33'
export GREP_COLOR=33
# GREP_OPTIONS is deprecated, so we use aliases.
# alias grep='grep --color=auto'
# alias egrep='egrep --color=auto'
# alias fgrep='fgrep --color=auto'
#------------------------------------------------------------------------------
# Miscellaneous
#------------------------------------------------------------------------------
# Allow typing just 'dir' instead of 'cd dir'.
shopt -s autocd
# Attempt to save all lines of a multi-line command in the same history entry.
# This allows easy re-editing of multi-line commands.
shopt -s cmdhist
# Make the history list appended to the file named by the value of the HISTFILE
# variable when the shell exits, rather than overwriting the file.
shopt -s histappend
# Save multi-line commands to the history with embedded newlines rather than
# using semicolon separators where possible.
shopt -s lithist
# Locale. I use en_US, but for some categories, I prefer en_GB. For example, I
# prefer dd/mm/yyyy (GB) to mm/dd/yyyy (US).
export LANG=en_US.UTF-8
export LC_TIME=en_GB.UTF-8
export LC_PAPER=en_GB.UTF-8
export LC_MEASUREMENT=en_GB.UTF-8
# Make ls, du, df and possibly other programs report sizes in a human-readable
# way by default (e.g. `df` implicitly becomes `df -h`).
export BLOCKSIZE=human-readable
# used for the uru Ruby version manager
# eval "$(uru_rt admin install)"
#------------------------------------------------------------------------------
# Tricks
#------------------------------------------------------------------------------
# autocompletion of aliases, should be sourced as late as possible
if [ -e "$HOME/.bash_completion.sh" ]; then
source "$HOME/.bash_completion.sh"
fi
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"