summary refs log tree commit diff
path: root/bashrc
blob: ffede15769cfa6676cfdfd2096423f74be11258e (plain) (blame)
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
export EDITOR="emacsclient -a ''"
export HISTFILE=
export LANG="en_US.UTF-8"
export LC_ALL="$LANG"
export LC_CTYPE="$LANG"
export PAGER="less"
export TZ=America/Los_Angeles
export GOPATH="${HOME}/gocode"

[ -z "$PS1" ] && return

[ "${BASH_VERSINFO}" -gt 3 ] && shopt -s autocd

# prompts
export PS1="\W % "

alias e="$EDITOR"
alias et="emacsclient -nw"

alias cp="cp -i"
alias l="ls"
alias la="ls -a"
alias ll="ls -lh"
alias lt="ls -lhtr"
alias mv="mv -i"
alias rm="rm -i"

# finally, build the path and source a few files
__add_to_path_if_exists() {
  [ -d "$1" ] && export PATH="$1:$PATH"
}

__source_file_if_exists() {
  [ -s "$1" ] && source "$1"
}

__add_to_path_if_exists "${HOME}/bin"
__add_to_path_if_exists "${GOPATH}/bin"
__add_to_path_if_exists "${HOME}/src/source/dist"
__add_to_path_if_exists "/opt/twitter/opt/go/libexec/bin"
__add_to_path_if_exists "/opt/twitter/bin"

DOTFILES_DIR=$(dirname $(realpath $BASH_SOURCE))
__add_to_path_if_exists "${DOTFILES_DIR}/bin"

__source_file_if_exists "/opt/google-cloud-sdk/path.bash.inc"
__source_file_if_exists "/opt/google-cloud-sdk/completion.bash.inc"
__source_file_if_exists "/opt/twitter/rvm/scripts/rvm"