summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2013-08-17 22:16:13 +0200
committerAlexander Sulfrian <alexander@sulfrian.net>2013-08-17 22:16:13 +0200
commite766d9fe1d0c5677214a0a100edf43e7056d7662 (patch)
treeeb93e10c81714e8ea7dd826fbcd7d217ced1dc87
downloaddotfiles-mini-e766d9fe1d0c5677214a0a100edf43e7056d7662.tar.gz
dotfiles-mini-e766d9fe1d0c5677214a0a100edf43e7056d7662.tar.bz2
dotfiles-mini-e766d9fe1d0c5677214a0a100edf43e7056d7662.zip
initial commit
-rw-r--r--bash/.gitignore1
-rw-r--r--bash/bashrc29
-rwxr-xr-xbin/copy14
-rwxr-xr-xbin/t36
-rw-r--r--git/config32
-rw-r--r--git/globalignore7
-rw-r--r--tmux/tmux.conf61
7 files changed, 180 insertions, 0 deletions
diff --git a/bash/.gitignore b/bash/.gitignore
new file mode 100644
index 0000000..8e50fd2
--- /dev/null
+++ b/bash/.gitignore
@@ -0,0 +1 @@
+bash_history
diff --git a/bash/bashrc b/bash/bashrc
new file mode 100644
index 0000000..f1fd127
--- /dev/null
+++ b/bash/bashrc
@@ -0,0 +1,29 @@
+# git foo
+if [ -d "${HOME}/.${REMOTE_USER}/git" ]; then
+ export GIT_CONFIG_PARAMETERS="'include.path=~/.${REMOTE_USER}/git/config'
+ 'core.excludesfile=~/.${REMOTE_USER}/git/globalignore'"
+fi
+
+# path
+export PATH="${HOME}/bin:${HOME}/server/bin:${PATH}"
+if [ -n "${REMOTE_USER}" -a -d "${HOME}/.${REMOTE_USER}/bin/" ]; then
+ export PATH="${HOME}/.${REMOTE_USER}/bin/:${PATH}"
+fi
+
+# own history
+export HISTFILE="${HOME}/.${REMOTE_USER}/bash/bash_history"
+export HISTSIZE=5000
+export HISTCONTROL="ignoreboth:erasedups"
+export HISTTIMEFORMAT="%F %T "
+
+# other stuff
+ncolors=$(tput colors)
+
+if [ -n "$ncolors" ] && [ $ncolors -ge 8 ]; then
+ # color support
+ export PS1="\[\033[1;36m\]\u@\h\[\033[0m\] \[\033[1;35m\]\w\[\033[0m\] \[\033[1;34m\]\$\[\033[0m\] "
+else
+ export PS1="\u@\h \w \$ "
+fi
+
+alias tmux='t'
diff --git a/bin/copy b/bin/copy
new file mode 100755
index 0000000..68d10ca
--- /dev/null
+++ b/bin/copy
@@ -0,0 +1,14 @@
+#!/usr/bin/env bash
+
+if [[ -z "$1" ]] ; then
+ echo "Usage:"
+ echo -en "\t"
+ echo "$(basename $0) <files/directories>"
+ exit 1
+fi
+
+# encode files suitable for copy&paste into other terminals
+STR=$(tar cjf - "$@" | base64; exit $PIPESTATUS) || exit $?
+echo "cat << E=O=F | base64 -d | tar xj"
+echo "$STR"
+echo "E=O=F"
diff --git a/bin/t b/bin/t
new file mode 100755
index 0000000..c6a1be3
--- /dev/null
+++ b/bin/t
@@ -0,0 +1,36 @@
+#!/usr/bin/env bash
+
+real_tmux() {
+ if [ -n "${REMOTE_USER}" -a -e "${HOME}/.${REMOTE_USER}/tmux/tmux.conf" ]; then
+ \tmux -f "${HOME}/.${REMOTE_USER}/tmux/tmux.conf" -S "${HOME}/.${REMOTE_USER}/tmux/socket" "$@"
+ else
+ \tmux "$@"
+ fi
+}
+
+exec_real_tmux() {
+ if [ -n "${REMOTE_USER}" -a -e "${HOME}/.${REMOTE_USER}/tmux/tmux.conf" ]; then
+ exec \tmux -f "${HOME}/.${REMOTE_USER}/tmux/tmux.conf" -S "${HOME}/.${REMOTE_USER}/tmux/socket" "$@"
+ else
+ exec \tmux "$@"
+ fi
+}
+
+if [[ "x$1" == x ]] ; then
+ real_tmux list-sessions ||
+ {
+ real_tmux new-session -d
+ }
+
+ exec_real_tmux attach-session -d
+fi
+
+if [ -z "$2" -a "$1" != "att" -a "$1" != "ls" ]; then
+ if real_tmux has-session -t "$1"; then
+ exec_real_tmux attach-session -t "$1"
+ else
+ exec_real_tmux new-session -s "$1"
+ fi
+fi
+
+exec_real_tmux $@
diff --git a/git/config b/git/config
new file mode 100644
index 0000000..dce751c
--- /dev/null
+++ b/git/config
@@ -0,0 +1,32 @@
+[user]
+ name = Alexander Sulfrian
+ email = alex@spline.inf.fu-berlin.de
+
+[color]
+ diff = auto
+ status = auto
+ branch = auto
+
+[alias]
+ s = status
+ d = diff
+ co = checkout
+ ci = commit
+ b = branch
+ sta = stash
+ civ = commit -v
+ cim = commit -m
+ k = !gitk --all
+ fm = merge --ff-only
+ nfm = merge --no-ff
+ tags = tag
+ l = log --graph --all --abbrev-commit --decorate --format=oneline
+
+[core]
+ pager = less -X -R -F
+
+[merge]
+ log = true
+
+[rerere]
+ enabled = true
diff --git a/git/globalignore b/git/globalignore
new file mode 100644
index 0000000..c2e7b7d
--- /dev/null
+++ b/git/globalignore
@@ -0,0 +1,7 @@
+.promptignore
+\#*#
+.\#*
+*~
+*.pyc
+.ropeproject/
+.dir-locals.el
diff --git a/tmux/tmux.conf b/tmux/tmux.conf
new file mode 100644
index 0000000..75b71a4
--- /dev/null
+++ b/tmux/tmux.conf
@@ -0,0 +1,61 @@
+# .tmux.conf
+
+## if the terminal gets SLOW, turn title-setting off
+#set -g set-titles off
+
+# ctrl-a is just better to type
+set -g prefix C-a
+unbind C-b
+
+# send the prefix to client inside window (ala nested sessions)
+bind a send-prefix
+
+# toggle last window like screen
+bind C-a last-window
+
+# ctrl-a left/right (even multiple times) to step through shells
+bind -r Right next-window
+bind -r Left previous-window
+# ctrl-up for scrolling within the 'screen'
+# bind -n C-Up copy-mode
+
+# start numbering sessions at 1, not 0
+set -g base-index 1
+# set hist-limit to 5000
+set -g history-limit 15000
+# turn the repeat-time up (0.5s is a little short)
+set -g repeat-time 1000
+# visual bell =)
+set -g visual-bell on
+
+# ctrl+left/right cycles thru windows
+bind -n C-right next
+bind -n C-left prev
+
+# listen for activity on all windows
+set -g bell-action any
+
+# choose-session with C-a _
+bind _ choose-session
+
+# bashrc makes takes care of window titles
+setw -g automatic-rename off
+
+# more colors
+set -g default-terminal "screen-256color"
+
+# display time
+set -g display-time 200
+
+# pimp the status bar
+set -g status-fg white
+set -g status-bg black
+set -g status-utf8 on
+set -g status-left-length 50
+set -g status-left "#[fg=red,bold]$USER#[fg=yellow,bold]@#[fg=green,bold]#H#[fg=colour250]:#S #[fg=white]| #[fg=yellow]#(date +%d.%b.%y) #[fg=white]|"
+set -g status-right "#[fg=red,bold](#(cat /proc/loadavg | head -c 14))"
+
+## and the notification messages
+set -g message-bg red
+set -g message-fg white
+set -g message-attr bold