-
Notifications
You must be signed in to change notification settings - Fork 0
/
rc.common-post
141 lines (119 loc) · 3.51 KB
/
rc.common-post
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
#!/usr/bin/env bash
# OS specific settings
if [[ $system == 'Linux' ]]; then
alias ls='ls -hpF --color=auto'
alias rm='rm -I'
alias grep='grep --color=auto'
alias egrep='egrep --color=auto'
alias open='xdg-open'
if [[ -n "$DISPLAY" ]]; then
# Map caps lock key to ctrl
setxkbmap -option ctrl:nocaps
fi
fi
if [[ $system == 'OSX' ]]; then
export CLICOLOR=1
if [[ -x /usr/local/bin/gls ]]; then
alias ls='/usr/local/bin/gls -hpF --color=auto'
else
alias ls='ls -hG'
fi
fi
# Directory colors
if [[ -f ~/.dircolors && ( -x /usr/local/bin/dircolors || -x /usr/bin/dircolors ) ]]; then
eval `dircolors $HOME/.dircolors`
fi
if [[ -f ~/.dircolors && ( -x /usr/local/bin/gdircolors ) ]]; then
eval `gdircolors $HOME/.dircolors`
fi
# rbenv
if [[ -d $HOME/.rbenv/bin ]]; then
eval "$(rbenv init -)"
fi
# Generic colou?ri[sz]er
#. $rcfiles/home/.grc/grc.bashrc
# Proxy helper
if [[ -f $HOME/.homesick/repos/yaprox/yaprox.sh ]]; then
. $HOME/.homesick/repos/yaprox/yaprox.sh
fi
# Turn off Ctrl-s XOFF
# Commented out pending further investigation (x key stopped working)
# http://unix.stackexchange.com/questions/72086/ctrl-s-hang-terminal-emulator
#stty ixon
stty ixany
stty ixoff -ixon
stty stop undef
stty start undef
# End magic mumbo jumbo block
# Base16 Shell (slow loading)
if [[ "${RUNCOM_LOAD_BASE16}" = 1 ]]; then
BASE16_SHELL="$HOME/.local/share/base16/templates/shell/"
[ -n "$PS1" ] && [ -s $BASE16_SHELL/profile_helper.sh ] && eval "$($BASE16_SHELL/profile_helper.sh)"
fi
# Source custom functions, including `command_exists` which is used below.
. "$rcfiles/functions"
# Replacement commands
# Use bat if available
#command_exists bat && alias cat='bat'
if command_exists bat; then
alias cat='bat'
export MANPAGER="sh -c 'col -bx | bat -l man -p'"
fi
# Use exa/colorls if available
#if [[ -f ~/.cargo/bin/exa ]]; then
if command_exists exa; then
alias ls='exa --color-scale'
alias l='ls --all'
alias ll='ls --all --long --header --git'
alias lt='ls --all --long --tree'
elif [[ -f ~/.rbenv/shims/colorls ]]; then
alias ls='colorls'
alias l='colorls -A'
alias ll='colorls -A -l'
alias lt='colorls --tree'
source "$(dirname $(gem which colorls))/tab_complete.sh"
else
alias l='ls -A --color'
alias ll='ls -lAh --color'
alias lt='tree'
alias lsa='ls -lAh --color'
fi
# fasd navigator
eval "$(fasd --init auto)"
# nvm (slow loading)
if [[ "${IS_PRUNCOM}" = 1 ]]; then
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
else
# TODO: temporary disabling
#alias nvm='[ -s "$NVM_DIR/nvm.sh" ] && unalias nvm && . "$NVM_DIR/nvm.sh" && nvm $@'
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
fi
# Custom aliases
. "$rcfiles/aliases"
# Alias to fix typos
if [[ -x /usr/bin/thefuck ]]; then
eval "$(thefuck --alias)"
fi
# Pipenv autocompletion
#if [[ -f ~/.local/bin/pipenv ]]; then
#eval $(~/.local/bin/pipenv --completion)
#fi
# Cleanup
unset rcfiles
unset system
# Source additional local settings
if [ -f ~/.localenv-post ]; then
. ~/.localenv-post
fi
# Source optional additional settings
if [[ -f $HOMESHICK_REPOS/pruncom/rc.pruncom-post ]]; then
. "$HOMESHICK_REPOS/pruncom/rc.pruncom-post"
fi
# Autostart tmux if told to
# Source: https://wiki.archlinux.org/index.php/tmux#Start_tmux_on_every_shell_login
if [[ "${RUNCOM_AUTOSTART_SINGLE_TMUX_SESSION}" = 1 ]]; then
if which tmux >/dev/null 2>&1; then
#if not inside a tmux session, and if no session is started, start a new session
test -z "$TMUX" && (tmux attach || tmux new-session 'nice glances')
fi
fi