Last active
September 20, 2017 13:30
-
-
Save rjksn/5359bceac07ef803b9aa566400b81142 to your computer and use it in GitHub Desktop.
Bash Settings
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Git Bash Command Line | |
gitBranch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} | |
export PS1="\[\033[90m\]\u@\h \[\033[38;5;39m\]\w\[\033[38;5;220m\]\$(gitBranch)\[\033[00m\] $ " | |
alias ls='ls -GFh' | |
alias ..='cd ..' | |
alias cd..='cd ..' | |
alias cdsage="cd web/app/themes/*" | |
alias cdunsage="cd ../../../.." | |
gitpush() { | |
#do things with parameters like $1 such as | |
git add . | |
git commit -am "$1" | |
git push | |
} | |
art() { | |
if [ -e artisan ] | |
then | |
php artisan $1 $2 $3 | |
else | |
echo -e "\033[38;5;220mPlease run this in a Laravel project root folder.\033[00m" | |
fi | |
} | |
artmi() { | |
php artisan migrate | |
} | |
site() { | |
cd ~/sites/$1 | |
} | |
alias homestead='function __homestead() { (cd ~/Homestead && vagrant $*); unset -f __homestead; }; __homestead' | |
# | |
# Stolen from Homestead/Vagrant | |
# | |
# make less more friendly for non-text input files, see lesspipe(1) | |
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" | |
# 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 | |
# colored GCC warnings and errors | |
export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' | |
# some more ls aliases | |
alias ll='ls -alF' | |
alias la='ls -A' | |
alias l='ls -CF' | |
# Add an "alert" alias for long running commands. Use like so: | |
# sleep 10; alert | |
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"' | |
# Alias definitions. | |
# You may want to put all your additions into a separate file like | |
# ~/.bash_aliases, instead of adding them here directly. | |
# See /usr/share/doc/bash-doc/examples in the bash-doc package. | |
if [ -f ~/.bash_aliases ]; then | |
. ~/.bash_aliases | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment