-
Notifications
You must be signed in to change notification settings - Fork 0
/
bashrc
64 lines (53 loc) · 1.78 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
#
# ~/.bashrc
#
# if not running interactively, don't do anything
# NOTE: .bashrc is only sourced when bash is run interactively so this seems redundant,
# but it turns out bash will still source .bashrc in a non-interactive remote shell (eg. when run via ssh)
# see the "remote shell daemon" section here for more info:
# https://www.gnu.org/software/bash/manual/html_node/Bash-Startup-Files.html
# also here for a more detailed example:
# https://unix.stackexchange.com/a/257613
[[ $- != *i* ]] && return
# set prompt appearance
PS1='\[\e[0;32m\]\u\[\e[m\]@\[\e[0;33m\]\h\[\e[m\] \W \[\e[0;31m\]❤\[\e[m\] '
INPUTRC=~/.inputrc
# make command history bigger
HISTSIZE=1000
HISTFILESIZE=1000
# colourise man pages
man() {
LESS_TERMCAP_md=$'\e[01;31m' \
LESS_TERMCAP_me=$'\e[0m' \
LESS_TERMCAP_se=$'\e[0m' \
LESS_TERMCAP_so=$'\e[01;07m' \
LESS_TERMCAP_ue=$'\e[0m' \
LESS_TERMCAP_us=$'\e[04;32m' \
command man "$@"
}
# load aliases
. ~/.bash_aliases
# enable more autocompletion
. /usr/share/bash-completion/bash_completion
# fzf stuff
. /usr/share/fzf/key-bindings.bash
. /usr/share/fzf/completion.bash
# for whatever reason nvm doesn't put itself in the path?
# i dont know the specifics but there's probably a good reason
if test -f "/usr/share/nvm/init-nvm.sh"; then
. /usr/share/nvm/init-nvm.sh
fi
# start keychain
# turns out i actually do need this on doubleslap, otherwise using ssh is a pain in the ass lmao
# TODO: check the situation with this on cometpunch, not sure why i don't get pestered for a password on there...
if [[ $HOSTNAME == doubleslap ]]
then
eval $(keychain -q --eval id_rsa)
fi
# load pyenv (but only on cometpunch)
if [[ $HOSTNAME == cometpunch ]]
then
eval "$(pyenv init -)"
fi
# load direnv (has to go last, apparently)
eval "$(direnv hook bash)"