-
Notifications
You must be signed in to change notification settings - Fork 0
/
exports.symlink
91 lines (73 loc) · 1.97 KB
/
exports.symlink
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
#!/usr/bin/env bash
_RESET="\033[00m"
_RED="\033[31m"
_GREEN="\033[32m"
_YELLOW="\033[33m"
_BLUE="\033[34m"
_MAGENTA="\033[35m"
_CYAN="\033[36m"
_GRAY="\033[37m"
_DARKORANGEISH="\033[2;33m"
# GO
export GOPATH=${HOME}/src/go
if [[ -d "${GOPATH}" ]]; then
export PATH=${PATH}:${GOPATH}/bin
fi
tnl_last_exit() {
local ec=$?
if [[ ${ec} -ne 0 ]]; then
echo -n ":${ec}"
fi
}
tnl_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/:\1/'
}
tnl_background_jobs() {
if [[ -x $GOPATH/bin/jobs-info-to-ps1 ]]; then
jobs -p -r | jobs-info-to-ps1
fi
}
_MYHOST="\h"
if [[ -n "${SSH_CLIENT}" ]]; then
_MYHOST="\[${_CYAN}\]${_MYHOST}\[${_RESET}\]"
fi
_MYPROMPT="\u@${_MYHOST}:\w\[${_RED}\]\$(tnl_last_exit)\[${_RESET}\]"
_MYPROMPT="${_MYPROMPT}\[${_YELLOW}\]\$(tnl_background_jobs)\[${_RESET}\]"
_MYPROMPT="${_MYPROMPT}\[${_GREEN}\]\$(tnl_git_branch)\[${_RESET}\]"
export PS1=${_MYPROMPT}'\$ '
# No pyc files
export PYTHONDONTWRITEBYTECODE=1
# Sublime text if not over SSH, nvim or vim as last resort.
if [[ "$(command -v subl 2>/dev/null)" && -z "${SSH_TTY}" ]]; then
export EDITOR="subl -w"
elif [[ $(command -v nvim 2>/dev/null) ]]; then
export EDITOR=nvim
else
export EDITOR=vim
fi
export GIT_EDITOR=${EDITOR}
export GUI_EDITOR=${EDITOR}
# Don't clear the screen after quitting a manual page
export MANPAGER="less -X"
# Larger bash history (allow 32³ entries; default is 500)
export HISTSIZE=32768
export HISTFILESIZE=$HISTSIZE
# Skip duplicates and commands with start with space
export HISTCONTROL=ignoreboth
# Notes
if [[ -d ${HOME}/Dropbox ]]; then
export NOTES_DIRECTORY=${HOME}/Dropbox/notes
if [[ ! -d ${NOTES_DIRECTORY} ]]; then
mkdir -p ${NOTES_DIRECTORY}
fi
fi
# Localisation
export LC_CTYPE=en_US.UTF-8
export LC_ALL=en_US.UTF-8
# AWS
export AWS_DEFAULT_REGION=eu-central-1
export BOTO_DEFAULT_REGION=${AWS_DEFAULT_REGION}
export GOOGLE_DEFAULT_REGION=europe-north1
# Terminal
export TERM=xterm-256color
export TMUX_TMPDIR=${HOME}/tmp