From 7a3d4fbcaef3a5fb4bbf7138bd8706a780bd2fee Mon Sep 17 00:00:00 2001 From: Daniel Schaefer Date: Fri, 30 Dec 2011 22:45:32 +0100 Subject: [PATCH 1/4] remove examples --- custom/example.zsh | 5 ----- custom/example/example.plugin.zsh | 2 -- 2 files changed, 7 deletions(-) delete mode 100644 custom/example.zsh delete mode 100644 custom/example/example.plugin.zsh diff --git a/custom/example.zsh b/custom/example.zsh deleted file mode 100644 index 28ffcae25..000000000 --- a/custom/example.zsh +++ /dev/null @@ -1,5 +0,0 @@ -# Add yourself some shortcuts to projects you often work on -# Example: -# -# brainstormr=/Users/robbyrussell/Projects/development/planetargon/brainstormr -# \ No newline at end of file diff --git a/custom/example/example.plugin.zsh b/custom/example/example.plugin.zsh deleted file mode 100644 index 406f27445..000000000 --- a/custom/example/example.plugin.zsh +++ /dev/null @@ -1,2 +0,0 @@ -# Add your own custom plugins in the custom/plugins directory. Plugins placed -# here will override ones with the same name in the main plugins directory. From c4563359cbe12fbac11474584785d15974b9770c Mon Sep 17 00:00:00 2001 From: Daniel Schaefer Date: Fri, 30 Dec 2011 22:45:43 +0100 Subject: [PATCH 2/4] add epegzz theme --- themes/epegzz.zsh-theme | 96 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 themes/epegzz.zsh-theme diff --git a/themes/epegzz.zsh-theme b/themes/epegzz.zsh-theme new file mode 100644 index 000000000..0d19ceb32 --- /dev/null +++ b/themes/epegzz.zsh-theme @@ -0,0 +1,96 @@ +# prompt style and colors based on Steve Losh's Prose theme: +# http://github.com/sjl/oh-my-zsh/blob/master/themes/prose.zsh-theme +# +# vcs_info modifications from Bart Trojanowski's zsh prompt: +# http://www.jukie.net/bart/blog/pimping-out-zsh-prompt +# +# git untracked files modification from Brian Carper: +# http://briancarper.net/blog/570/git-info-in-your-zsh-prompt + +function virtualenv_info { + [ $VIRTUAL_ENV ] && echo '┄ '`basename $VIRTUAL_ENV`' ┄─' +} +PR_GIT_UPDATE=1 + +setopt prompt_subst +autoload colors +colors + +autoload -U add-zsh-hook +autoload -Uz vcs_info + +#use extended color pallete if available +turquoise="$fg[blue]" +orange="$fg[yellow]" +purple="$fg[magenta]" +hotpink="$fg[red]" +limegreen="$fg[green]" +red="$fg[red]" + +# enable VCS systems you use +zstyle ':vcs_info:*' enable git svn + +# check-for-changes can be really slow. +# you should disable it, if you work with large repositories +zstyle ':vcs_info:*:prompt:*' check-for-changes true + +# set formats +# %b - branchname +# %u - unstagedstr (see below) +# %c - stagedstr (see below) +# %a - action (e.g. rebase-i) +# %R - repository path +# %S - path in the repository +PR_RST="%{${reset_color}%}" +FMT_BRANCH="(%{$turquoise%}%b%u%c${PR_RST})" +FMT_ACTION="(%{$limegreen%}%a${PR_RST})" +FMT_UNSTAGED="%{$red%}⁺" +FMT_STAGED="%{$limegreen%}⁺" + +zstyle ':vcs_info:*:prompt:*' unstagedstr "${FMT_UNSTAGED}" +zstyle ':vcs_info:*:prompt:*' stagedstr "${FMT_STAGED}" +zstyle ':vcs_info:*:prompt:*' actionformats "${FMT_BRANCH}${FMT_ACTION}" +zstyle ':vcs_info:*:prompt:*' formats "${FMT_BRANCH}" +zstyle ':vcs_info:*:prompt:*' nvcsformats "" + + +function epegzz_preexec { + case "$(history $HISTCMD)" in + *git*) + PR_GIT_UPDATE=1 + ;; + *svn*) + PR_GIT_UPDATE=1 + ;; + esac +} +add-zsh-hook preexec epegzz_preexec + +function epegzz_chpwd { + PR_GIT_UPDATE=1 +} +add-zsh-hook chpwd epegzz_chpwd + +function epegzz_precmd { + if [[ -n "$PR_GIT_UPDATE" ]] ; then + # check for untracked files or updated submodules, since vcs_info doesn't + if [[ ! -z $(git ls-files --other --exclude-standard 2> /dev/null) ]]; then + PR_GIT_UPDATE=1 + FMT_BRANCH="%B%{$turquoise%}%b%u%c%{$hotpink%}%B⁺${PR_RST}" + else + FMT_BRANCH="%B%{$turquoise%}%b%u%c${PR_RST}" + fi + zstyle ':vcs_info:*:prompt:*' formats "on ${FMT_BRANCH}" + + vcs_info 'prompt' + PR_GIT_UPDATE= + fi +} +add-zsh-hook precmd epegzz_precmd + +local return_code="%(?..%{$fg[red]%}%B%? ⚡%b%{$reset_color%}) " + +PROMPT=$' +┌─ %B%{$purple%}%n%{$reset_color%}%b at %B%{$orange%}%m%{$reset_color%}%b in %B%{$limegreen%}%~%{$reset_color%}%b $vcs_info_msg_0_%{$reset_color%} +└─$(virtualenv_info)%{$reset_color%}➤%b ' +RPROMPT='${return_code}%F{bla}%*%b${PR_NO_COLOUR}' From e2e7f646aefba38697bb4e8e98ca1d3ac8d3fb8d Mon Sep 17 00:00:00 2001 From: Daniel Schaefer Date: Fri, 30 Dec 2011 22:56:35 +0100 Subject: [PATCH 3/4] credits --- themes/epegzz.zsh-theme | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/themes/epegzz.zsh-theme b/themes/epegzz.zsh-theme index 0d19ceb32..8db17c695 100644 --- a/themes/epegzz.zsh-theme +++ b/themes/epegzz.zsh-theme @@ -1,11 +1,5 @@ -# prompt style and colors based on Steve Losh's Prose theme: -# http://github.com/sjl/oh-my-zsh/blob/master/themes/prose.zsh-theme -# -# vcs_info modifications from Bart Trojanowski's zsh prompt: -# http://www.jukie.net/bart/blog/pimping-out-zsh-prompt -# -# git untracked files modification from Brian Carper: -# http://briancarper.net/blog/570/git-info-in-your-zsh-prompt +# based on: +# https://github.com/steeef/oh-my-zsh/blob/master/themes/steeef.zsh-theme function virtualenv_info { [ $VIRTUAL_ENV ] && echo '┄ '`basename $VIRTUAL_ENV`' ┄─' From 1dbdb3779f5d421e03cbf8105c33ec16947021eb Mon Sep 17 00:00:00 2001 From: Daniel Schaefer Date: Fri, 30 Dec 2011 23:08:37 +0100 Subject: [PATCH 4/4] add custom config --- .gitignore | 3 - custom/custom.zsh | 142 +++++++++++++++++++++++++++++++++++++ custom/fix-keybindings.zsh | 26 +++++++ 3 files changed, 168 insertions(+), 3 deletions(-) create mode 100644 custom/custom.zsh create mode 100644 custom/fix-keybindings.zsh diff --git a/.gitignore b/.gitignore index 2e8db7341..cfbdc5e91 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,5 @@ locals.zsh log/.zsh_history projects.zsh -custom/* -!custom/example -!custom/example.zsh cache *.swp diff --git a/custom/custom.zsh b/custom/custom.zsh new file mode 100644 index 000000000..b4cb93f14 --- /dev/null +++ b/custom/custom.zsh @@ -0,0 +1,142 @@ +# Set less options +if [[ -x $(which less) ]] +then + export PAGER="less" + export LESS="--ignore-case --LONG-PROMPT --QUIET --chop-long-lines -Sm --RAW-CONTROL-CHARS --quit-if-one-screen --no-init" + if [[ -x $(which lesspipe.sh) ]] + then + LESSOPEN="| lesspipe.sh %s" + export LESSOPEN + fi +fi + +# Set default editor +if [[ -x $(which vim) ]] +then + export EDITOR="vim" + export USE_EDITOR=$EDITOR + export VISUAL=$EDITOR +fi + + +# Zsh settings for history +export HISTIGNORE="&:ls:[bf]g:exit:reset:clear:cd:cd ..:cd.." +export HISTSIZE=25000 +export HISTFILE=~/.zsh_history +export SAVEHIST=10000 +setopt INC_APPEND_HISTORY +setopt HIST_IGNORE_ALL_DUPS +setopt HIST_IGNORE_SPACE +setopt HIST_REDUCE_BLANKS +setopt HIST_VERIFY + +# Say how long a command took, if it took more than 30 seconds +export REPORTTIME=30 + +# Zsh spelling correction options +#setopt CORRECT +#setopt DVORAK + +# Prompts for confirmation after 'rm *' etc +# Helps avoid mistakes like 'rm * o' when 'rm *.o' was intended +setopt RM_STAR_WAIT + +# Background processes aren't killed on exit of shell +setopt AUTO_CONTINUE + +# Don’t write over existing files with >, use >! instead +setopt NOCLOBBER + +# Don’t nice background processes +setopt NO_BG_NICE + +# Watch other user login/out +watch=notme +export LOGCHECK=60 + +# Enable color support of ls +if [[ "$TERM" != "dumb" ]]; then + if [[ -x `which dircolors` ]]; then + eval `dircolors -b` + alias 'ls=ls --color=auto' + fi +fi + +# Short command aliases +alias 'grep=grep --colour' + + +# Play safe! +alias 'rm=rm -i' +alias 'mv=mv -i' +alias 'cp=cp -i' + +# For convenience +alias 'mkdir=mkdir -p' +alias 'dus=du -ms * | sort -n' + +# Typing errors... +alias 'cd..=cd ..' + + +# Quick find +f() { + echo "find . -iname \"*$1*\"" + find . -iname "*$1*" +} + + +# some more ls aliases +alias ls="ls --color" +alias ll='ls -lh --color' +alias lla='ls -lah --color' +alias la='ls -Ah --color' +alias l='ls -CF --color' + +#export TERM="screen-256color" +export TERM=rxvt + + +alias browse="vimprobable2" +alias jump="ssh root@195.42.120.16 -p54654 -i /home/epegzz/.ssh/id_rsa.intranet.local" +alias technobase="mplayer http://listen.technobase.fm/tunein-dsl-pls" +alias housetime="mplayer http://listen.housetime.fm/tunein-dsl-pls" +alias servdir="python -m SimpleHTTPServer" +alias lsnew=" ls -al --time-style=+%D | grep `date +%D` " +alias whatip='wget -q -O - http://www.whatismyip.org && echo' +alias tmux="tmux -u" + +PATH="~/bin:/usr/local/bin:${PATH}" + + +PATH="~/bin:/usr/local/bin:${PATH}:/opt/flex-sdk/bin:/usr/lib/jvm/java-6-openjdk/bin:/usr/share/java/apache-ant/bin" +JAVA_HOME="/usr/lib/jvm/java-6-openjdk" + +export RED5_HOME="/opt/red5" + + +# needed for vcn/flashViewer and vcn/flashSender +export LIBFLASHCLIENT_DIR=/home/epegzz/Projects/vcn/libFlashClient/dist + + +# alias for t +alias t='python2.7 ~/Projects/t/t.py --task-dir ~/tasks --list tasks' +alias b='python2.7 ~/Projects/t/t.py --task-dir . --list bugs' + +# make vim 256 colors work in tmux +alias tmux='TERM=xterm-256color tmux' + +source /usr/local/bin/f.sh +alias v='f -e vim' # quick opening files with vim +alias m='f -e mplayer' # quick opening files with mplayer +alias j='d -e cd' # quick cd into directories, mimicking autojump and z + + + + + +# virtualenv stuff +export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python2.7 +export WORKON_HOME=~/.virtualenvs +source /usr/bin/virtualenvwrapper.sh + diff --git a/custom/fix-keybindings.zsh b/custom/fix-keybindings.zsh new file mode 100644 index 000000000..230dedccc --- /dev/null +++ b/custom/fix-keybindings.zsh @@ -0,0 +1,26 @@ + +# bash like history search +# PGUP, PGDN, HOME, END +bindtc () +{ + setopt localoptions + local keyval=$(echotc "$1" 2>&-) + [[ $keyval == "no" ]] && keyval="" + bindkey "${keyval:-$2}" "$3" +} + +# Bindings for PGUP, PGDN, HOME, END +bindtc kP "^[[I" history-beginning-search-backward +bindtc kN "^[[G" history-beginning-search-forward +bindtc kh "^[[7~" beginning-of-line +bindtc kH "^[[8~" end-of-line + +# Bindings for UP, DOWN, LEFT, RIGHT +bindtc ku "^[[A" up-line-or-history +bindtc kd "^[[B" down-line-or-history +bindtc kr "^[[C" forward-char +bindtc kl "^[[D" backward-char + +# make del behave +bindkey "^[[3~" delete-char +