simplifying bashrc before applying ZSH features to commonize platforms.
This commit is contained in:
parent
9e1c7b3481
commit
f70893deea
1 changed files with 6 additions and 53 deletions
59
bash/.bashrc
59
bash/.bashrc
|
@ -20,14 +20,14 @@ sh_light_gray="\[\033[0;37m\]"
|
|||
sh_white="\[\033[1;37m\]"
|
||||
|
||||
# Set some defaults.
|
||||
export GOPATH="$HOME/go"
|
||||
export EDITOR="nvim"
|
||||
export PATH=".:$GOPATH/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:~/bin"
|
||||
export PATH=".:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:~/bin"
|
||||
|
||||
export LSCOLORS="ExGxBxDxCxEgEdxbxgxcxd"
|
||||
export DOTFILES_DIR=$HOME'/.dotfiles'
|
||||
|
||||
# Make a pretty prompt.
|
||||
export PROMPT_COMMAND='history -a; if [ $? -ne 0 ];then ERROR_FLAG=1;else ERROR_FLAG=;fi;$DOTFILES_DIR/check_update.sh'
|
||||
export PROMPT_COMMAND='history -a; if [ $? -ne 0 ];then ERROR_FLAG=1;else ERROR_FLAG=;fi;'
|
||||
export PS1=${HOSTCOLOUR}${sh_light_gray}'\t | \h'${sh_green}':\w'${sh_light_gray}' '${sh_light_gray}'${ERROR_FLAG:+'${sh_light_red}'}\$ '${sh_norm}
|
||||
|
||||
# New files and folders should not be world readable
|
||||
|
@ -62,8 +62,6 @@ HISTFILESIZE=100000
|
|||
|
||||
# jump down the tree.
|
||||
alias ..="cd .."
|
||||
alias ...="cd ../.."
|
||||
alias ....="cd ../../.."
|
||||
|
||||
# empty the screen (or use C-l)
|
||||
alias c="clear"
|
||||
|
@ -77,13 +75,6 @@ alias e="exit"
|
|||
# grep shortie
|
||||
alias g="grep --color=auto -i "
|
||||
|
||||
# get shortcuts.
|
||||
alias ga="git add"
|
||||
alias gc="git commit"
|
||||
alias gd="git diff"
|
||||
alias gp="git push"
|
||||
alias gs="git status"
|
||||
|
||||
# shorter ls
|
||||
alias l="ls -G"
|
||||
|
||||
|
@ -96,9 +87,6 @@ alias la="ls -alh"
|
|||
# List directories.
|
||||
alias ld="ls -Gd */"
|
||||
|
||||
# Find out what connections are happening.
|
||||
alias lsconn="sudo lsof -i -P"
|
||||
|
||||
# add some color to grep.
|
||||
alias grep="grep --color=auto"
|
||||
|
||||
|
@ -109,7 +97,7 @@ alias mkdir="mkdir -p -v "
|
|||
#alias ping="ping -c5"
|
||||
|
||||
# refresh the shell customizations without opening a new one.
|
||||
alias refresh="source ~/.bashrc"
|
||||
alias refresh="source ~/.bashrc && hash -r"
|
||||
|
||||
# A python calculator
|
||||
alias pc='python -ic "from __future__ import division; from math import *"'
|
||||
|
@ -117,13 +105,6 @@ alias pc='python -ic "from __future__ import division; from math import *"'
|
|||
# Start nano with line numbering no wrapping and autoindenting
|
||||
alias nano='nano -ciw '
|
||||
|
||||
if [[ $(uname) = 'Darwin' ]]; then
|
||||
# Open man file in Preview.app.
|
||||
pman () {
|
||||
man -t "${1}" | open -f -a /Applications/Preview.app
|
||||
}
|
||||
fi
|
||||
|
||||
# General purpose extract command.
|
||||
extract () {
|
||||
if [ -f $1 ] ; then
|
||||
|
@ -152,34 +133,13 @@ extract () {
|
|||
# General purpose backup command.
|
||||
bu () { tar czf ~/.backup/`basename $1`-`date +%Y%m%d%H%M`.tgz $1; }
|
||||
|
||||
# History Search
|
||||
h () { grep "$1" ~/.history/*; }
|
||||
|
||||
|
||||
# Search for a process:
|
||||
p () {
|
||||
if [ ! -z $1 ] ; then
|
||||
ps aux | grep $1 | grep -v grep
|
||||
else
|
||||
echo "must provide search string"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
# Find a file in the current tree.
|
||||
f () {
|
||||
if [ ! -z $1 ] ; then
|
||||
find . | grep $1
|
||||
#find . -name $1 -print;
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
|
||||
# Repeat function, do something until you ^C out of it.
|
||||
# Syntax: r sleep_time_in_seconds command_to_run
|
||||
r () {
|
||||
if [ ! -z $1 ]
|
||||
then
|
||||
if [ ! -z $2 ]
|
||||
then
|
||||
if [ ! -z $2 ]
|
||||
then
|
||||
|
@ -199,13 +159,6 @@ r () {
|
|||
fi
|
||||
}
|
||||
|
||||
# Function to count IP address found in file(s)
|
||||
count-IPs () {
|
||||
grep -E -o -h '(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)' |\
|
||||
sed -E 's/([0-9]*\.[0-9]*)\.[0-9]*\.[0-9]*/\1/' | \
|
||||
uniq -c | \
|
||||
sort -r
|
||||
}
|
||||
|
||||
# Import local extensions if needed.
|
||||
if [ -f $HOME/.bashrc_local ]; then
|
||||
|
|
Loading…
Reference in a new issue