-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbashrc
80 lines (66 loc) · 2.08 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
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options
export HISTCONTROL=ignoredups
# ... and ignore same sucessive entries.
export HISTCONTROL=ignoreboth
export HISTSIZE=50000
# If this is an xterm set the title to user@host:dir and set PS1
case "$TERM" in
xterm*|rxvt*|screen*)
if [[ "$OSTYPE" == "darwin"* ]]; then
PS1="\\$> \[$(tput sgr0)\]"
else
PROMPT_COMMAND+='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007"'
# only show hostname if remote
if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then
host="@\h"
fi
# will break if the source git stuff above failed
PS1='\[\e[00;32m\]\u${host}\[\e[0m\]\[\e[00;37m\]:\[\e[0m\]\[\e[00;36m\][\W$(__git_ps1 " (%s)")]:\[\e[0m\]\[\e[00;37m\] \[\e[0m\]'
fi
;;
*)
;;
esac
# enable color support of ls and also add handy aliases
if [ "$TERM" != "dumb" ] && [ -x /usr/bin/dircolors ]; then
eval "`dircolors -b`"
alias ls='ls --color=auto'
#alias dir='ls --color=auto --format=vertical'
#alias vdir='ls --color=auto --format=long'
alias grep='grep --color=auto'
#alias fgrep='fgrep --color=auto'
#alias egrep='egrep --color=auto'
fi
# some aliases
alias ll='ls -lh'
alias la='ls -A'
alias l='ls -CF'
alias rm="rm -i"
alias mv="mv -i"
alias cp="cp -i"
if [[ "$OSTYPE" == "linux-gnu" ]]; then
alias open='xdg-open'
elif [[ "$OSTYPE" == "darwin*" ]]; then
# ...
:
fi
# brew and completion
[[ -s /opt/homebrew/bin/brew ]] && eval $(/opt/homebrew/bin/brew shellenv)
if [ -f $(brew --prefix)/etc/bash_completion ]; then
. $(brew --prefix)/etc/bash_completion
fi
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
export CLICOLOR=1
export LSCOLORS=ExFxCxDxBxegedabagacad
export EDITOR=vim
# Stop the annoying: default ... shell ... zsh
export BASH_SILENCE_DEPRECATION_WARNING=1
#colors tmux
alias tmux='TERM=xterm-256color tmux'
export PIP_REQUIRE_VIRTUALENV=true