-
-
Save vasigorc/dc6a1f5747d6a0090c654f863962b239 to your computer and use it in GitHub Desktop.
mTypeHK .bashrc with Fedora // Git aliases . Put it in your home directory
This file contains hidden or 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
#!/bin/bash | |
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
} | |
PS1='\[\e[1;34m\]\u\[\e[m\] \[\e[0;32m\]\w\[\e[m\] $(parse_git_branch) \[\e[1;34m\]\$ \[\e[m\]\[\e[0;37m\]' | |
#PS1='\[\e[1;34m\]\u\[\e[m\] \[\e[0;32m\]\w\[\e[m\] \[\e[1;34m\]\$ \[\e[m\]\[\e[0;37m\]' | |
# If not running interactively, don't do anything | |
[[ $- != *i* ]] && return | |
### FUNCTIONS | |
# Extract | |
arc () { | |
if [ -f $1 ] ; then | |
case $1 in | |
*.tar.bz2) tar xvjf $1 ;; | |
*.tar.gz) tar xvzf $1 ;; | |
*.bz2) bunzip2 $1 ;; | |
*.rar) unrar x $1 ;; | |
*.gz) gunzip $1 ;; | |
*.tar) tar xvf $1 ;; | |
*.tbz2) tar xvjf $1 ;; | |
*.tgz) tar xvzf $1 ;; | |
*.zip) unzip $1 ;; | |
*.Z) uncompress $1 ;; | |
*.7z) 7z x $1 ;; | |
*) echo "don't know how to extract '$1'..." ;; | |
esac | |
else | |
echo "'$1' is not a valid file!" | |
fi | |
} | |
# Makes directory then moves into it | |
function mkcdr { | |
mkdir -p -v $1 | |
cd $1 | |
} | |
# Creates an archive from given directory | |
mktar() { tar cvf "${1%%/}.tar" "${1%%/}/"; } | |
mktgz() { tar cvzf "${1%%/}.tar.gz" "${1%%/}/"; } | |
mktbz() { tar cvjf "${1%%/}.tar.bz2" "${1%%/}/"; } | |
### ALIAS | |
# List | |
alias ls='ls --color=auto' | |
alias la='ls -a --color=auto' | |
alias ll='ls -l --color=auto' | |
alias lsd='ls -dl */' | |
alias lr='ls -lR' | |
# Navigation | |
alias ..='cd ..' | |
alias ...='cd ../..' | |
alias ....='cd ../../..' | |
alias .....='cd ../../../..' | |
alias ......='cd ../../../../..' | |
alias back='cd $OLDPWD' | |
# Package Management | |
alias ys='yum search' | |
alias yu='sudo yum -R 3 -y upgrade' | |
alias yg='sudo yum install -y' | |
alias yr='sudo yum remove -y' | |
alias yc='sudo yum clean packages -y' | |
# Editors | |
alias vi='vim' | |
alias v='vim' | |
alias sv='sudo vim' | |
alias st='sublime' | |
# Tools | |
alias df='df -h' # This handy tool tells you how much space you have left on a drive | |
alias lock='xscreensaver-command -lock' | |
alias matrix='cat /dev/urandom' | |
alias removesvn='rm -rf `find . -type d -name .svn`' | |
alias syslog='sudo cat /var/log/messages' | |
alias beets='beet import ~/Music' | |
# Git | |
alias ga='git add' | |
alias gb='git branch' | |
alias gba='git branch -a' | |
alias gca='git commit -a -m' | |
alias gcm='git commit -a -m "Minor"' | |
alias gc='git commit -v' | |
alias gcl='git clone' | |
alias gd='git diff | mate' | |
alias gl='git pull' | |
alias gp='git push' | |
alias gst='git status' | |
alias gx='git push origin master' | |
#GIT SVN | |
alias go='git svn dcommit' | |
alias gsc='git svn clone' | |
alias gsp='git svn rebase' | |
# SSH | |
alias sshs='sudo service sshd start' | |
alias sshstatus='sudo service sshd status' | |
# Common | |
alias grep='grep --color=auto' | |
alias p='python' | |
# Dotfiles | |
alias brc='vim /home/io/.bashrc && source ~/.bashrc' | |
alias vrc='vim /home/io/.vimrc' | |
export PATH=$PATH:/usr/local/bin/ | |
export BROWSER=/usr/bin/google-chrome | |
export UAEDITOR=sublime | |
export EDITOR=sublime | |
export VISUAL=sublime |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment