-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bashrc
101 lines (72 loc) · 2.09 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
#
# ~/.bashrc
#
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
__prepend_path() {
PATH="$1:$PATH"
}
__prepend_path ~/.local/bin
__prepend_path ~/.bin
__prepend_path ~/go/bin
__prepend_path ~/.cargo/bin
__prepend_path ~/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin
__prepend_path ~/.luarocks/bin
__prepend_path ~/.tools/vendor/bin
__prepend_path ~/.tools/node_modules/.bin
__prepend_path ~/ide/bin
export LC_ALL="en_US.UTF-8"
export LANG="en_US.UTF-8"
export GOFLAGS="-modcacherw"
export GOPATH="$HOME/go"
export EDITOR="nvim"
export VISUAL="nvim"
export PAGER="less -R"
export MANPAGER="nvim +Man!"
export FZF_DEFAULT_OPTS="--layout=reverse --marker='>' --pointer='>'"
export FZF_DEFAULT_COMMAND="fd --type f --hidden --exclude '.git'"
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
export FZF_ALT_C_COMMAND="fd --type d --hidden --exclude '.git'"
export LIBRARY_PATH="$HOME/.local/lib"
export ANSIBLE_NOCOWS=1
# Disable makepkg compression.
export PKGEXT=".pkg.tar"
export NODE_OPTIONS="--max_old_space_size=4096"
export HISTFILE="$HOME/.local/state/.bash_history"
export GPG_TTY="$(tty)"
export SHELL="$(which bash)"
[[ -f ~/.bash_aliases ]] && . ~/.bash_aliases
if test -f /usr/share/LS_COLORS/dircolors.sh; then
. /usr/share/LS_COLORS/dircolors.sh
fi
if test -d /usr/share/fzf; then
source /usr/share/fzf/completion.bash
source /usr/share/fzf/key-bindings.bash
fi
if test -f /usr/share/bash-completion/bash_completion; then
. /usr/share/bash-completion/bash_completion
fi
. ~/.local/share/tusk/tusk-completion.bash
# TODO
# if type -p direnv; then
# eval "$(direnv hook bash)"
# fi
PROMPT_COMMAND=__prompt_command # Function to generate PS1 after CMDs
shopt -s histappend
__prompt_command() {
local EXIT="$?" # This needs to be first
PS1=""
history -a
history -c
history -r
local RCol='\[\e[0m\]'
local Red='\[\e[0;31m\]'
local Gre='\[\e[0;32m\]'
local BrBlu='\[\e[0;36m\]'
local userHostColor="${USERHOST_COLOR:-$BrBlu}"
PS1+="${RCol}[\t] ${userHostColor}\u@\h ${Gre}\w"
if [ $EXIT != 0 ]; then
PS1+=" ${Red}[${EXIT}]"
fi
PS1+=" ${RCol}\n> "
}