From dd5c929439fef12c852aee5da752237a4f760739 Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Sun, 24 Feb 2013 16:20:59 -0500 Subject: [PATCH] Add several aliases --- .bashrc | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/.bashrc b/.bashrc index dc61894..215c30f 100755 --- a/.bashrc +++ b/.bashrc @@ -7,8 +7,7 @@ usern=$(whoami) function prompt { ctime=$(date +%T) prmpt="[${PWD}][${ctime}]" - cols=$(tput cols) - let FILLS=${cols}-${#prmpt} + let FILLS=${COLUMNS}-${#prmpt} LINE="" if [[ "$PWD" =~ "/home/$usern" ]]; then @@ -34,19 +33,27 @@ PROMPT_COMMAND=prompt # [----------------------------------------------------------------------------] # [----------------------------- ALIAS ---------------------------------------] # [----------------------------------------------------------------------------] + # Common parameters -if [ "$OSTYPE" == "linux-gnu" ]; then - alias ls='ls -v --color=auto' - alias ll='ls -lavh' - alias grep='grep --color' -else - alias ls='ls' - alias ll='ls -la' - alias grep='grep' -fi +alias ls='ls -v --color=auto' +alias ll='ls -lavh' +alias grep='grep --color' alias sudo='sudo env PATH=$PATH' +alias ..='cd ..' +alias ...='cd ../..' +alias ....='cd ../../..' + +# for git +alias get='git' +alias ga='git add' +alias gaa='git add .' +alias gs='git status' +alias gl='git log' +alias gcm='git commit -m' +alias gcf='git commit -F' + # [----------------------------------------------------------------------------] # [------------------------------ OTHER ---------------------------------------] # [----------------------------------------------------------------------------]