Permalink
Browse files

Hey dotfiles, woohogst ;)

  • Loading branch information...
0 parents commit 5bb86f847c86632a9af0943ab8a93661d8c13a71 @littke committed May 3, 2011
Showing with 353 additions and 0 deletions.
  1. +14 −0 .bash_profile
  2. +156 −0 .bashrc
  3. +13 −0 .gitconfig
  4. +20 −0 .gitignore
  5. +2 −0 .gvimrc
  6. +11 −0 .inputrc
  7. +78 −0 .pythonrc.py
  8. +12 −0 .screenrc
  9. +47 −0 .vimrc
@@ -0,0 +1,14 @@
+source .bashrc
+
+##
+# Your previous /Users/littke/.bash_profile file was backed up as /Users/littke/.bash_profile.macports-saved_2011-01-22_at_21:30:39
+##
+
+# MacPorts Installer addition on 2011-01-22_at_21:30:39: adding an appropriate PATH variable for use with MacPorts.
+export PATH=$PATH:/opt/local/bin:/opt/local/sbin
+# Finished adapting your PATH environment variable for use with MacPorts.
+
+
+export MAGICK_HOME="$HOME/bin/ImageMagick-6.6.7"
+export PATH="$PATH:$MAGICK_HOME/bin"
+export DYLD_LIBRARY_PATH="$MAGICK_HOME/lib/"
156 .bashrc
@@ -0,0 +1,156 @@
+# ~/.bashrc: executed by bash(1) for non-login shells.
+# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
+# for examples
+
+
+export EDITOR=vim
+export PYTHONSTARTUP=~/.pythonrc.py
+
+
+# If not running interactively, don't do anything
+[ -z "$PS1" ] && return
+
+# don't put duplicate lines in the history. See bash(1) for more options
+# don't overwrite GNU Midnight Commander's setting of `ignorespace'.
+export HISTCONTROL=$HISTCONTROL${HISTCONTROL+,}ignoredups
+# ... or force ignoredups and ignorespace
+export HISTCONTROL=ignoreboth
+
+HISTTIMEFORMAT="%Y%m%d %H:%M:%S "
+
+# append to the history file, don't overwrite it
+shopt -s histappend
+
+HISTSIZE=2000
+
+# check the window size after each command and, if necessary,
+# update the values of LINES and COLUMNS.
+shopt -s checkwinsize
+
+# make less more friendly for non-text input files, see lesspipe(1)
+#[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
+
+# set variable identifying the chroot you work in (used in the prompt below)
+if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
+ debian_chroot=$(cat /etc/debian_chroot)
+fi
+
+# set a fancy prompt (non-color, unless we know we "want" color)
+case "$TERM" in
+ xterm-color) color_prompt=yes;;
+esac
+
+# uncomment for a colored prompt, if the terminal has the capability; turned
+# off by default to not distract the user: the focus in a terminal window
+# should be on the output of commands, not on the prompt
+force_color_prompt=yes
+
+if [ -n "$force_color_prompt" ]; then
+ if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
+ # We have color support; assume it's compliant with Ecma-48
+ # (ISO/IEC-6429). (Lack of such support is extremely rare, and such
+ # a case would tend to support setf rather than setaf.)
+ color_prompt=yes
+ else
+ color_prompt=
+ fi
+fi
+
+symbolic_hostname="`cat /etc/symbolic_hostname 2> /dev/null`.d"
+if [ "$symbolic_hostname" == ".d" ]; then
+ symbolic_hostname=`hostname`
+fi
+
+if [ "$color_prompt" = yes ]; then
+
+ # Blue for own comp
+ if [ "$HOSTNAME" = "Tesla.local" ] || [ "$HOSTNAME" = "Tesla" ] || [ "$HOSTNAME" = "tesla.local" ] || [ "$HOSTNAME" = "tesla" ] || [ "$HOSTNAME" = "Snowstorm.local" ] || [ "$HOSTNAME" = "Snowstorm" ] || [ "$HOSTNAME" = "caramac" ] || [ "$HOSTNAME" = "caramac.local" ]; then
+ color="4"
+
+ # Green for dev
+ elif [ "$HOSTNAME" = "machine-097.d.spotify.net" ] || [ "$HOSTNAME" = "machine-077.d.spotify.net" ] || [ "$HOSTNAME" = "richard.dev.spotify.net" ] || [ "$HOSTNAME" = "carrot" ]; then
+ color="2"
+
+ # Yellow for testing and unstable
+ elif [ "$HOSTNAME" = "machine-084.d.spotify.net" ] || [ "$HOSTNAME" = "machine-090.d.spotify.net" ] || [ "$HOSTNAME" = "machine-081.d.spotify.net" ] || [ "$HOSTNAME" = "machine-060.d.spotify.net" ] || [ "$HOSTNAME" = "www-001.testing.spotify.net" ] || [ "$HOSTNAME" = "www-001.stable.spotify.net" ] || [ "$HOSTNAME" = "product-user-001.unstable.spotify.net" ] || [ "$HOSTNAME" = "www-001.unstable.spotify.net" ]; then
+ color="3"
+
+ # Red for production or unknown
+ else
+ color="1"
+ fi
+ PS1='${debian_chroot:+($debian_chroot)}\[\033[01;3${color}m\]\u@$symbolic_hostname\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
+else
+ PS1='${debian_chroot:+($debian_chroot)}\u@$symbolic_hostname:\w\$ '
+fi
+unset color_prompt force_color_prompt
+
+# If this is an xterm set the title to user@host:dir
+#case "$TERM" in
+#xterm*|rxvt*)
+# PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]1"
+# ;;
+#*)
+# ;;
+#esac
+
+# If this is an xterm set the title to user@host:dir
+ case "$TERM" in
+ xterm*|rxvt*)
+ PROMPT_COMMAND='echo -ne "\033]0;${HOSTNAME}: ${PWD/$HOME/~}\007"'
+ ;;
+ *)
+ ;;
+ esac
+
+
+
+# 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
+
+# enable color support (linux) of ls and also add handy aliases
+if [ -x /usr/bin/dircolors ]; then
+ eval "`dircolors -b`"
+ alias ls='ls --color=auto'
+fi
+
+# Enable color coding support for OS X
+export CLICOLOR=1
+# LSCOLORS needs to be tweaked
+export LSCOLORS=ExFxCxDxBxegedabagacad
+
+# some more ls aliases
+alias ll='ls -la'
+#alias la='ls -A'
+#alias l='ls -CF'
+alias rm='rm -i'
+alias ssh='ssh -A'
+alias cp='cp -i'
+alias mv='mv -i'
+alias l='ls -la --color=auto'
+alias sl='cowsay "slow down boi!";sleep 10'
+alias py='python '
+alias cdiff='bash ~/src/misc/coloured_svn_diff.sh'
+alias gst='git status'
+alias gd='git diff'
+alias grep='grep --color=auto'
+
+# enable programmable completion features (you don't need to enable
+# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
+# sources /etc/bash.bashrc).
+if [ -f /etc/bash_completion ]; then
+ . /etc/bash_completion
+fi
+
+# Open MacVim when typing 'gvim'
+function photoshop { open -a /Applications/Adobe\ Photoshop\ CS4/Adobe\ Photoshop\ CS4.app $*; }
+
+export MAGICK_HOME="$HOME/bin/ImageMagick-6.6.7"
+export PATH="$PATH:$MAGICK_HOME/bin"
+export DYLD_LIBRARY_PATH="$MAGICK_HOME/lib/"
@@ -0,0 +1,13 @@
+[user]
+ name = Jonatan Littke
+ email = jonatan.littke@gmail.com
+
+[color]
+ #ui = always
+ ui = never
+
+[core]
+ editor = vim
+ excludesfile = ~/.gitignore
+[branch]
+ autosetuprebase = always
@@ -0,0 +1,20 @@
+.CFUserTextEncoding
+.DS_Store
+.Trash/
+.Xauthority
+.adobe/
+.appcfg_cookies
+.appcfg_nag
+.bash_history
+.cpan/
+.cups/
+.dropbox/
+.fontconfig/
+.lesshst
+.pyhistory
+.sqlite_history
+.ssh/
+.subversion/
+.viminfo.tmp
+.viminfo
+/*/
@@ -0,0 +1,2 @@
+set lines=70
+set columns=250
@@ -0,0 +1,11 @@
+#Home/End
+"\e[1~": beginning-of-line
+"\e[4~": end-of-line
+
+#Ctrl-right Ctrl-Left
+"\e[5D": beginning-of-line
+"\e[5C": end-of-line
+
+#Word moving using Ctrl-key ?
+"\ef": forward-word
+"\eb": backward-word
@@ -0,0 +1,78 @@
+"""Features:
+ * Tab completion on Linux and OS x
+ * Color prompt
+ * Command history
+ * Pretty printing
+"""
+
+def setup():
+ # Imports we need
+ import sys, os, readline, atexit, rlcompleter, pprint
+
+ # Bind tab for completion - both os and linux
+ # readline.parse_and_bind("bind -e")
+ # readline.parse_and_bind("bind ^I rl_complete")
+ # readline.parse_and_bind("bind ^R em-inc-search-prev")
+ readline.parse_and_bind("tab: complete")
+
+ # Color Support
+ class TermColors(dict):
+ """Gives easy access to ANSI color codes. Attempts to fall back to no color
+ for certain TERM values. (Mostly stolen from IPython.)"""
+
+ COLOR_TEMPLATES = (
+ ("Black" , "0;30"),
+ ("Red" , "0;31"),
+ ("Green" , "0;32"),
+ ("Brown" , "0;33"),
+ ("Blue" , "0;34"),
+ ("Purple" , "0;35"),
+ ("Cyan" , "0;36"),
+ ("LightGray" , "0;37"),
+ ("DarkGray" , "1;30"),
+ ("LightRed" , "1;31"),
+ ("LightGreen" , "1;32"),
+ ("Yellow" , "1;33"),
+ ("LightBlue" , "1;34"),
+ ("LightPurple" , "1;35"),
+ ("LightCyan" , "1;36"),
+ ("White" , "1;37"),
+ ("Normal" , "0"),
+ )
+
+ NoColor = ''
+ _base = '\001\033[%sm\002'
+
+ def __init__(self):
+ if os.environ.get('TERM') in ('xterm', 'xterm-color', 'xterm-256color', 'linux',
+ 'screen', 'screen-256color', 'screen-bce'):
+ self.update(dict([(k, self._base % v) for k,v in self.COLOR_TEMPLATES]))
+ else:
+ self.update(dict([(k, self.NoColor) for k,v in self.COLOR_TEMPLATES]))
+ _c = TermColors()
+
+ # Some fancy prompts
+ sys.ps1 = '%s>>> %s' % (_c['Green'], _c['Normal'])
+ sys.ps2 = '%s... %s' % (_c['Red'], _c['Normal'])
+
+ # Enable Pretty Printing for stdout
+ def my_displayhook(value):
+ if value is not None:
+ _ = value
+ pprint.pprint(value)
+ sys.displayhook = my_displayhook
+
+ # Read the existing history if there is one
+ histfile = "%s/.pyhistory" % os.environ["HOME"]
+ if os.path.exists(histfile):
+ readline.read_history_file(histfile)
+
+ # Set maximum number of items that will be written to the history file
+ readline.set_history_length(1000)
+
+ def savehist():
+ readline.write_history_file(histfile)
+ atexit.register(savehist)
+
+setup()
+del setup
@@ -0,0 +1,12 @@
+# removes startup message
+startup_message off
+
+# fix scrolling
+termcapinfo xterm-color ti@:te@
+
+# Change scrollback to 10000 lines
+defscrollback 10000
+
+# testing status line
+hardstatus alwayslastline
+hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B} %d/%m %{W}%c %{g}]'
47 .vimrc
@@ -0,0 +1,47 @@
+set nowrap
+syntax on
+set background=dark
+
+colorscheme desert " this colorscheme works well both in a GUI and a terminal
+
+set encoding=utf-8 " use utf-8 in Vim
+set fileencodings=utf-8,latin1 " automatically detect utf-8 and latin1
+
+" make it easier to jump in the file:
+"map <s-j> 6j
+"map <s-k> 6k
+
+set autoindent " automatically indent new lines...
+set smartindent " ... and be clever about it
+set expandtab " expand tabs to spaces...
+set smarttab " ... even when indenting
+set shiftwidth=4 " indent using 2 spaces...
+set tabstop=4 " ... because a tab is 2 spaces
+
+set number " display line numbers
+set ruler " display position of the cursor
+
+"set paste "avoid weird tabbing when pasting (disabled to keep smartindent to work)
+
+set ignorecase " ignore case when searching...
+set smartcase " ... unless pattern contains uppercase characters
+set incsearch " show match for partly typed search
+set hlsearch " highlight matches
+set mouse=a " enable mouse
+
+set showcmd " show typed keys in the status line
+set wildmenu " show match for partly typed commands in the command line
+set title " let vim set the title of the window
+let &titlestring = expand("%:n") . "%(\ %M%)" . " @ " . hostname() " and modify it to include the host name
+
+autocmd FileType html set shiftwidth=4 tabstop=4
+autocmd FileType css set shiftwidth=4 tabstop=4
+
+" make sure comments in python doesn't go to the beginning of line when trying to add them
+" (http://stackoverflow.com/questions/2063175/vim-insert-mode-comments-go-to-start-of-line)
+autocmd BufRead *.py inoremap # X<c-h>#
+
+filetype plugin on " plugins are enabled
+
+" Visually select the text that was last edited/pasted
+nmap gV `[v`]

0 comments on commit 5bb86f8

Please sign in to comment.