-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhome.bashrc.mac
38 lines (33 loc) · 956 Bytes
/
home.bashrc.mac
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
#!/bin/sh
# Set PS1 {{{
# If id command returns zero, you've root access.
if [ $(id -u) -eq 0 ];
then # you are root, set red colour prompt
PS1="\\[$(tput setaf 1)\\]\u@\h: \w $(tput sgr0)\\]# "
else # normal
PS1="\u@\h: \w \$ "
fi
#}}}
## Safety features ## {{{
alias cp='cp -i'
alias mv='mv -i'
alias rm='rm -I' # 'rm -i' prompts for every file
# safer alternative w/ timeout, not stored in history
# alias rm=' timeout 3 rm -Iv --one-file-system'
alias ln='ln -i'
alias cls=' echo -ne "\033c"' # clear screen for real (it does not work in Terminology)
# }}}
# My aliases {{{
alias q='exit'
alias :q='exit'
alias l='ls -lhAF --color'
alias vim="/usr/local/bin/vim -p"
# }}}
EDITOR=vim; export EDITOR
VISUAL=vim; export VISUAL
# TMUX {{{
if which tmux 2>&1 >/dev/null; 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)
fi
# }}}