Commits

Ben Bass committed e8978ca

initial files

  • Participants

Comments (0)

Files changed (3)

+alias svnrev="svn info ${SVN_ROOT} | awk '/Revision:/ {print $2}'"
+alias svndiff="svn diff --diff-cmd svnmeld"
+alias svnlog="svn up; svn log --stop-on-copy"
+alias svnlogdiff="svndiff -r \$(svn log --stop-on-copy --xml | xpath -q -e '//log/logentry[last()]/@revision' | cut -d '\"' -f 2):HEAD"
+alias webserve="python -m SimpleHTTPServer"
+alias sf="find . ! \( -name .svn -prune \) -a -type f -print0 | xargs -0 grep -Hn --color"
+alias sn="find . ! \( -name .svn -prune \) -a -type f -name"
+alias http_head="curl -I"
+alias cdtemp='td=$(mktemp -d); pushd $td; bash; popd;'  # TODO: add a trap to remove on exit
+alias pp="egrep '^\s*(def|class) '"
+
+en () {
+  MY_EDITOR=$VISUAL
+  if [[ -z $MY_EDITOR ]] ; then
+    MY_EDITOR=$EDITOR
+  fi
+  if [[ -z $MY_EDITOR ]] ; then
+    MY_EDITOR=/usr/bin/vim
+  fi
+  find . ! \( -name .svn -prune \) -a -type f -name $1 | xargs $EDITOR
+}
+
+map () { prog=$1; shift; for arg in $@; do eval $prog $arg; done }
+
+# mcd is part of mtools by default (change MSDOS directory)
+mcd () {
+  mkdir -p $1 && cd $1
+}
+
+sl () {
+ sed -n "$1p"
+}
+
+if [[ $(uname) = 'Darwin' ]] ; then
+    alias gvim=mvim
+    alias vim='mvim -v'
+    alias aplay="sox -r 8000 -b 8 -c 1 -t raw -e unsigned-integer - -d"
+fi
+
+function rmake {
+  pushd . > /dev/null
+  while true ; do
+    if [[ -e Makefile ]]; then
+      make $@
+      break
+    fi
+    if [[ $PWD = '/' ]] ; then
+      break
+    fi
+    cd ..
+  done
+  popd > /dev/null
+}
+# Our .tmux.conf file
+
+# Setting the prefix from C-b to C-a
+# START:prefix
+set -g prefix C-a  
+# END:prefix
+# Free the original Ctrl-b prefix keybinding
+# START:unbind
+unbind C-b 
+# END:unbind
+#setting the delay between prefix and command
+# START:delay
+set -sg escape-time 1
+# END:delay
+# Ensure that we can send Ctrl-A to other apps
+# START:bind_prefix
+bind C-a send-prefix
+# END:bind_prefix
+
+# Set the base index for windows to 1 instead of 0
+# START:index
+set -g base-index 1
+# END:index
+
+# Set the base index for panes to 1 instead of 0
+# START:panes_index
+setw -g pane-base-index 1
+# END:panes_index
+
+# Reload the file with Prefix r
+# START:reload
+bind r source-file ~/.tmux.conf \; display "Reloaded!"
+# END:reload
+
+# splitting panes
+# START:panesplit
+bind | split-window -h
+bind - split-window -v
+# END:panesplit
+
+# moving between panes
+# START:paneselect
+bind h select-pane -L 
+bind j select-pane -D 
+bind k select-pane -U
+bind l select-pane -R    
+# END:paneselect
+
+# Quick pane selection
+# START:panetoggle
+bind -r C-h select-window -t :-
+bind -r C-l select-window -t :+
+# END:panetoggle
+
+# Pane resizing
+# START:paneresize
+bind -r H resize-pane -L 5 
+bind -r J resize-pane -D 5 
+bind -r K resize-pane -U 5 
+bind -r L resize-pane -R 5
+# END:paneresize
+# mouse support - set to on if you want to use the mouse
+# START:mouse
+setw -g mode-mouse off 
+# END:mouse
+set -g mouse-select-pane off 
+set -g mouse-resize-pane off 
+set -g mouse-select-window off
+
+# Set the default terminal mode to 256color mode
+# START:termcolor
+set -g default-terminal "screen-256color"
+# END:termcolor
+
+# enable activity alerts
+#START:activity
+setw -g monitor-activity on
+set -g visual-activity on
+#END:activity
+
+# set the status line's colors
+# START:statuscolor
+set -g status-fg white
+set -g status-bg black
+# END:statuscolor
+
+# set the color of the window list
+# START:windowstatuscolor
+setw -g window-status-fg cyan 
+setw -g window-status-bg default 
+setw -g window-status-attr dim
+# END:windowstatuscolor
+
+# set colors for the active window
+# START:activewindowstatuscolor
+setw -g window-status-current-fg white 
+setw -g window-status-current-bg red 
+setw -g window-status-current-attr bright
+# END:activewindowstatuscolor
+
+# pane colors
+# START:panecolors
+set -g pane-border-fg green
+set -g pane-border-bg black
+set -g pane-active-border-fg white
+set -g pane-active-border-bg yellow
+# END:panecolors
+
+# Command / message line
+# START:cmdlinecolors
+set -g message-fg white
+set -g message-bg black
+set -g message-attr bright
+# END:cmdlinecolors
+
+# Status line left side
+# START:statusleft
+set -g status-left-length 40 
+set -g status-left "#[fg=green]Session: #S #[fg=yellow]#I #[fg=cyan]#P"
+# END:statusleft
+
+#START:utf8
+set -g status-utf8 on
+#END:utf8
+
+# Status line right side
+# 15% | 28 Nov 18:15
+# START: statusright
+set -g status-right "#[fg=cyan]%d %b %R"
+# END:statusright
+
+# Update the status bar every sixty seconds
+# START:updateinterval
+set -g status-interval 60
+# END:updateinterval
+
+# Center the window list
+# START:centerwindowlist
+set -g status-justify centre
+# END:centerwindowlist
+
+# enable vi keys.
+# START:vikeys
+setw -g mode-keys vi
+# END:vikeys
+" Use Vim settings, rather than Vi settings (much better!).
+" This must be first, because it changes other options as a side effect.
+set nocompatible
+
+" Make backspace behave in a sane manner.
+set backspace=indent,eol,start
+
+" Switch syntax highlighting on
+syntax on
+
+" Enable file type detection and do language-dependent indenting.
+filetype plugin indent on
+
+" from http://ianrolfe.livejournal.com/39474.html
+" For some reason home and end keys are not mapping properly
+" Home key
+imap <esc>OH <esc>0i
+cmap <esc>OH <home>
+nmap <esc>OH 0
+" End key
+nmap <esc>OF $
+imap <esc>OF <esc>$a
+cmap <esc>OF <end>
+
+set gfn=Monospace\ 8
+set t_Co=256
+
+set wildmode=longest,list,full
+set wildmenu
+
+set nobackup
+set nowritebackup
+set noswapfile
+set lines=40
+set columns=80
+
+set expandtab
+set tabstop=4
+set shiftwidth=4
+:map <C-Up> :bn<Return>
+:map <C-Down> :bp<Return>
+filetype plugin indent on
+augroup mkd
+    autocmd BufRead *.mkd  set ai formatoptions=tcroqn2 comments=n:>
+augroup END
+set incsearch
+set showmatch
+set ignorecase
+set smartcase
+autocmd FileType python set omnifunc=pythoncomplete#Complete
+set complete-=i
+:nnoremap <Tab> :bnext<CR>
+:nnoremap <S-Tab> :bprevious<CR>
+:map <End> <End>
+:map <Home> <Home>
+set list listchars=trail:_
+highlight SpecialKey ctermfg=DarkGray ctermbg=yellow
+set hidden
+set backspace=2
+set ruler
+"set smartindent
+"set autoindent
+set spelllang=en_gb
+set guioptions-=T
+
+" line numbering
+set number
+set numberwidth=4
+
+" Informative status line
+set statusline=%F%m%r%h%w\ [TYPE=%Y\ %{&ff}]\ [%l/%L\ (%p%%)]
+
+" various post-write hooks for quality checking
+au BufWritePost *.py !flake8 --ignore=E501 %
+au BufWritePost *.js !jshint %
+
+" Pathogen load
+filetype off
+
+call pathogen#infect()
+call pathogen#helptags()
+filetype plugin indent on
+syntax on