Skip to content
Browse files

add linux stuff

  • Loading branch information...
1 parent d800b78 commit 01b3c144843128aa1061c2e59094f41a031c7cfa UNSET TODO committed Nov 29, 2010
Showing with 38 additions and 10 deletions.
  1. +20 −5 .bash/bashrc
  2. +7 −0 .bash_logout
  3. +7 −4 .gitconfig
  4. +4 −1 .profile
View
25 .bash/bashrc
@@ -4,36 +4,50 @@
# Environment
#
-export GREP_OPTIONS='--color=auto' # highlight matches using color
export LESS="--RAW-CONTROL-CHARS" # interpret any embedded ansi escapes
export PAGER='less' # use less to view manpages, etc
+[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" # let less show non-text files too
export PS1="\\u@\h \\w\\$ " # simple prompt shows user, host and path
stty -ixon # disable XON/XOFF flow control so terminal will pass ^S and ^Q
[ -f /etc/bash_completion ] && source /etc/bash_completion
-[ -d ~/bin ] && export PATH=~/bin:"$PATH"
+[ -d "$HOME/bin" ] && export PATH="$HOME/bin:$PATH"
# Disable annoying ~ expansion
# http://www.linuxquestions.org/questions/linux-software-2/how-to-stop-bash-from-replacing-%7E-with-home-username-643162/#post3162026
_expand() { return 0; }
__expand_tilde_by_ref() { return 0; }
+#
+# Colors
+#
+
+if [ -x /usr/bin/dircolors ]; then
+ # use ~/.dircolors if user has specified one
+ test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
+ alias ls='ls --color=auto'
+fi
+
+export GREP_OPTIONS='--color=auto'
#
# History
#
-shopt -s histappend # Append each(!) history entry from all terminals realtime(not after sesion ending)
+shopt -s histappend # Append to history file instead of overwriting
shopt -s cmdhist # store multiline commands as 1 line
shopt -s cdspell # spelling error correction
shopt -s checkwinsize # check the window size after each command and, if necessary, update the values of LINES and COLUMNS.
export HISTCONTROL="ignoreboth" # store duplicate lines once, ignore lines beginning with a space
export HISTIGNORE="&:ls:[bf]g:exit:%[0-9]" # ignore simple commands
export HISTFILESIZE=5000 # history file size
+# this doesn't seem to work, might have to switch to zsh
+# export PROMPT_COMMAND="history -n; history -a" # store & reload history every time prompt is displayed, http://briancarper.net/blog/248/
+
#
# Aliases
@@ -44,9 +58,10 @@ alias ...='cd ../..'
alias md='mkdir -p'
alias mdcd='f () { mkdir -p $1 && cd $1; }; f'
-alias ll='ls -l'
+alias l='ls -CF'
alias la='ls -A'
-alias l='ls -l'
+alias ll='ls -lF'
+alias lla='ls -alF'
alias tf='tail -f'
View
7 .bash_logout
@@ -0,0 +1,7 @@
+# ~/.bash_logout: executed by bash(1) when login shell exits.
+
+# when leaving the console clear the screen to increase privacy
+
+if [ "$SHLVL" = 1 ]; then
+ [ -x /usr/bin/clear_console ] && /usr/bin/clear_console -q
+fi
View
11 .gitconfig
@@ -5,10 +5,11 @@
email = UNSET TODO
[push]
default = tracking
+[help]
+ autocorrect = 1
+
[color]
- branch = auto
- diff = auto
- status = auto
+ ui = auto
[color "branch"]
current = yellow reverse
local = yellow
@@ -66,7 +67,7 @@
l = log --date=relative
lg = !git ll --graph
ll = log --abbrev-commit --date=relative --pretty=format:'%C(yellow)%h%Creset %s %Cgreen(%cr) %C(bold blue) %an %Creset%C(red)%d'
- lol = log --pretty=oneline --abbrev-commit --graph --decorate
+ lol = log --oneline --abbrev-commit --graph --decorate
lp = log --patch --date=relative
lpw = log --patch --word-diff --date=relative
ls = log --stat=120,130 --date=relative
@@ -81,7 +82,9 @@
rc = rebase --continue
ri = rebase --interactive
rih = "!f() { git rebase -i HEAD$1; }; f "
+ rm-a = "!git ls-files -z --deleted | xargs -0 git rm"
rst = reset
+ s = status -sb
st = status --short --branch --untracked-files=no
sta = status --short --branch --untracked-files=normal
sv = svn
View
5 .profile
@@ -1 +1,4 @@
-[ -f ~/.bashrc ] && source ~/.bashrc
+# if we're running bash then run .bashrc
+if [ -n "$BASH_VERSION" ]; then
+ [ -f ~/.bashrc ] && source ~/.bashrc
+fi

0 comments on commit 01b3c14

Please sign in to comment.
Something went wrong with that request. Please try again.