Permalink
Browse files

first commit

  • Loading branch information...
0 parents commit 03ce1197a4bdfa237e618810304aaac38b0fff89 @Sannis committed Apr 6, 2012
Showing with 153 additions and 0 deletions.
  1. +4 −0 .bash_aliases
  2. +35 −0 .bash_prompt
  3. +24 −0 .bashrc
  4. +69 −0 .dir_colors
  5. +19 −0 .gitconfig
  6. +2 −0 .gitignore
@@ -0,0 +1,4 @@
+alias gitk='gitk --all &'
+alias ll='ls -l --color'
+alias la='ls -la --color'
+
@@ -0,0 +1,35 @@
+# Git info in prompt
+# http://henrik.nyh.se/2008/12/git-dirty-prompt
+# http://www.simplisticcomplexity.com/2008/03/13/show-your-git-branch-name-in-your-prompt/
+# TODO: Add https://gist.github.com/31967 (arrows and last command result status)
+function parse_git_branch_name {
+ git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/\1/"
+}
+function parse_git_push_queue {
+ git log --no-color --oneline origin/$(parse_git_branch_name)...$(parse_git_branch_name) 2> /dev/null | wc -l | grep -v -P "^0$" | sed -e "s/\(.*\)/\(+\1\)/"
+}
+function parse_git_dirty {
+ [[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
+}
+function git_prompt_suffix {
+ parse_git_branch_name | sed -e "s/\(.*\)/\(\1$(parse_git_dirty)$(parse_git_push_queue)\)/"
+}
+
+# SVN info in prompt
+# http://hocuspokus.net/2009/07/add-git-and-svn-branch-to-bash-prompt/
+# TODO: Add https://sites.google.com/site/demonkutya/testpage/addfancysvnbranchstatustoyourcommandprompt
+function parse_svn_url() {
+ svn info 2>/dev/null | sed -ne 's#^URL: ##p'
+}
+function parse_svn_repository_root() {
+ svn info 2>/dev/null | sed -ne 's#^Repository Root: ##p'
+}
+function parse_svn_branch_name() {
+ parse_svn_url | sed -e 's#^'"$(parse_svn_repository_root)"'##g'
+}
+function svn_prompt_suffix() {
+ parse_svn_branch_name | awk '{print "("$1")" }'
+}
+
+# Combine prompt
+export PS1='\u@\h: \W $(git_prompt_suffix)$(svn_prompt_suffix)> '
24 .bashrc
@@ -0,0 +1,24 @@
+# .bashrc
+
+# Source global definitions
+if [ -f /etc/bashrc ]; then
+ . /etc/bashrc
+fi
+
+# User specific aliases
+if [ -f ~/.bash_aliases ]; then
+ . ~/.bash_aliases
+fi
+
+# User specific prompt
+if [ -f ~/.bash_prompt ]; then
+ . ~/.bash_prompt
+fi
+
+# History settings
+set -o history
+HISTFILESIZE=1000000000
+HISTSIZE=1000000
+HISTCONTROL=ignoredups
+#shopt -s histappend
+
@@ -0,0 +1,69 @@
+# Below are the color init strings for the basic file types. A color init
+# string consists of one or more of the following numeric codes:
+# Attribute codes:
+# 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed
+# Text color codes:
+# 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white
+# Background color codes:
+# 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white
+NORMAL 00 # global default, although everything should be something.
+FILE 00 # normal file
+DIR 01;34 # directory
+LINK 00;36 # symbolic link
+FIFO 40;33 # pipe
+SOCK 01;35 # socket
+DOOR 01;35 # door
+BLK 40;33;01 # block device driver
+CHR 40;33;01 # character device driver
+ORPHAN 41;33;01 # symlink to nonexistent file
+MISSING 41;33;01 # and missing
+
+# This is for files with execute permission:
+EXEC 00;32
+
+# List any file extensions like '.gz' or '.tar' that you would like ls
+# to colorize below. Put the extension, a space, and the color init string.
+# (and any comments you want to add after a '#')
+
+# executables (bright green)
+.cmd 01;32
+.exe 01;32
+.com 01;32
+.btm 01;32
+.bat 01;32
+.sh 01;32
+.csh 01;32
+
+# archives or compressed (bright red)
+.tar 01;31
+.tgz 01;31
+.arj 01;31
+.taz 01;31
+.lzh 01;31
+.zip 01;31
+.z 01;31
+.Z 01;31
+.gz 01;31
+.bz2 01;31
+.bz 01;31
+.tz 01;31
+.rpm 01;31
+.cpio 01;31
+
+# image formats
+.jpg 01;35
+.gif 01;35
+.bmp 01;35
+.xbm 01;35
+.xpm 01;35
+.png 01;35
+.tif 01;35
+
+# sound formats
+.aiff 00;32
+.au 00;32
+.mid 00;32
+.mp3 00;32
+.ogg 00;32
+.voc 00;32
+.wav 00;32
@@ -0,0 +1,19 @@
+[color]
+ branch = auto
+ diff = auto
+ status = auto
+[alias]
+ br = branch
+ st = status
+ ci = commit
+ df = diff
+ co = checkout
+ p = push --verbose
+ pf = push --verbose --force
+ pt = push --verbose --tags
+ pl = pull --verbose
+ l = log --decorate
+ gr = log --decorate --graph --full-history --all --pretty=format:%h%x09%d%x20%s
+ grc = log --decorate --graph --full-history --all --color --pretty=tformat:%x1b[31m%h%x09%x1b[32m%d%x1b[0m%x20%s%x20%x1b[33m(%an)%x1b[0m
+[merge]
+ verbosity = 3
@@ -0,0 +1,2 @@
+.DS_Store
+.idea

0 comments on commit 03ce119

Please sign in to comment.