mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-02 02:19:06 +01:00
Merge 1dbdb3779f into 3e9493fb30
This commit is contained in:
commit
53d42d47f2
6 changed files with 258 additions and 10 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -1,8 +1,5 @@
|
||||||
locals.zsh
|
locals.zsh
|
||||||
log/.zsh_history
|
log/.zsh_history
|
||||||
projects.zsh
|
projects.zsh
|
||||||
custom/*
|
|
||||||
!custom/example
|
|
||||||
!custom/example.zsh
|
|
||||||
cache
|
cache
|
||||||
*.swp
|
*.swp
|
||||||
|
|
|
||||||
142
custom/custom.zsh
Normal file
142
custom/custom.zsh
Normal file
|
|
@ -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
|
||||||
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
# Add yourself some shortcuts to projects you often work on
|
|
||||||
# Example:
|
|
||||||
#
|
|
||||||
# brainstormr=/Users/robbyrussell/Projects/development/planetargon/brainstormr
|
|
||||||
#
|
|
||||||
|
|
@ -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.
|
|
||||||
26
custom/fix-keybindings.zsh
Normal file
26
custom/fix-keybindings.zsh
Normal file
|
|
@ -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
|
||||||
|
|
||||||
90
themes/epegzz.zsh-theme
Normal file
90
themes/epegzz.zsh-theme
Normal file
|
|
@ -0,0 +1,90 @@
|
||||||
|
# based on:
|
||||||
|
# https://github.com/steeef/oh-my-zsh/blob/master/themes/steeef.zsh-theme
|
||||||
|
|
||||||
|
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}'
|
||||||
Loading…
Add table
Add a link
Reference in a new issue