summaryrefslogtreecommitdiff
path: root/bash_profile
blob: 9dc06672d9c4a9aa833f5ec7fd88df42b4cf700d (plain)
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
#!/bin/bash
#
# BASH PROFILE
#

# Helper Functions
exists() {
	command -v $1 >/dev/null 2>&1
}

# Custom Scripts
scripts="~/repos/scripts"
[ -d "$scripts" ] && PATH=$PATH:$scripts

# Node/NPM: make global pkg installs use ~/.local
exists node && export NODE_PATH=~/.local/lib/node_modules:$NODE_PATH
exists npm && export npm_config_prefix=~/.local
export PATH=~/.local/bin:$PATH

# Editor
if exists vim; then
	export EDITOR=vim
	export VISUAL=$EDITOR
fi

# History
export HISTFILE=~/.cache/bash_history

# Less
export LESS="-R"
export LESSCHARSET=utf-8
export LESSHISTFILE=~/.cache/less_history
export LESS_TERMCAP_mb=$'\e[01;33m' # begin blinking
export LESS_TERMCAP_md=$'\e[01;33m' # begin bold
export LESS_TERMCAP_me=$'\e[0m'     # end all modes
export LESS_TERMCAP_so=$'\e[7m'     # start standout mode
export LESS_TERMCAP_se=$'\e[0m'     # end standout-mode
export LESS_TERMCAP_us=$'\e[1;37m'  # start underlining
export LESS_TERMCAP_ue=$'\e[0m'     # end underline

# Load bashrc
[[ -f ~/.bashrc ]] && source ~/.bashrc