60 lines
1.4 KiB
Bash
60 lines
1.4 KiB
Bash
# Asara's bashrc
|
|
|
|
# Check if the shell is non-interactive
|
|
if [[ $- != *i* ]]; then
|
|
# Shell is non-interactive. Be done now!
|
|
return
|
|
fi
|
|
|
|
# Ignore duplicate commands and commands starting with a space for Bash history
|
|
HISTCONTROL=ignoredups:ignorespace
|
|
|
|
# Bash History file size
|
|
HISTSIZE=100000
|
|
HISTFILESIZE=2000000
|
|
|
|
# fix text wrap based on windows size
|
|
shopt -s checkwinsize
|
|
# append to the history file, don't overwrite it
|
|
shopt -s histappend
|
|
# entering directory name will automatically cd to it.
|
|
shopt -s autocd
|
|
# make multiline input single line in history (i.e. \)
|
|
shopt -s cmdhist
|
|
|
|
# enable color support of ls and also add handy aliases
|
|
if [ -x /usr/bin/dircolors ]; then
|
|
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
|
|
alias ls='ls --color=auto'
|
|
alias dir='dir --color=auto'
|
|
alias vdir='vdir --color=auto'
|
|
|
|
alias grep='grep --color=auto'
|
|
alias fgrep='fgrep --color=auto'
|
|
alias egrep='egrep --color=auto'
|
|
fi
|
|
|
|
# some ls aliases
|
|
alias ll='ls -alF'
|
|
alias la='ls -A'
|
|
alias l='ls -CF'
|
|
|
|
# IP
|
|
alias ipme='wget -qO - icanhazip.com'
|
|
alias speedtest='wget --output-document=/dev/null http://speedtest.wdc01.softlayer.com/downloads/test500.zip'
|
|
|
|
# Bash Prompt
|
|
PS1="\[\033[35m\]\t\[\033[m\]-\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[31;1m\]\w\[\033[m\]\$ "
|
|
|
|
# Export environmental variables
|
|
export EDITOR=vim
|
|
export VISUAL=vim
|
|
export BROWSER=firefox
|
|
|
|
# Source external file
|
|
if [[ -f ~/.customrc ]]; then
|
|
. ~/.customrc
|
|
fi
|
|
|
|
bash ~/.motd
|