Switch from oh-my-zsh to zplug

This commit is contained in:
2016-04-03 15:21:55 +01:00
parent a11830872a
commit 9b549a09a5
11 changed files with 76 additions and 155 deletions

View File

@@ -1,19 +0,0 @@
# History search with peco
#
# Search shell history with peco: https://github.com/peco/peco
# Adapted from: https://github.com/mooz/percol#zsh-history-search
if which peco &> /dev/null; then
function peco_select_history() {
local tac
(which gtac &> /dev/null && tac="gtac") || \
(which tac &> /dev/null && tac="tac") || \
tac="tail -r"
BUFFER=$(fc -l -n 1 | eval $tac | \
peco --layout=bottom-up --query "$LBUFFER")
CURSOR=$#BUFFER # move cursor
zle -R -c # refresh
}
zle -N peco_select_history
bindkey '^R' peco_select_history
fi

View File

@@ -1,50 +0,0 @@
# A script to make using 256 colors in zsh less painful.
# P.C. Shyamshankar <sykora@lucentbeing.com>
# https://github.com/sykora/etc/blob/master/zsh/functions/spectrum/
typeset -Ag FX FG BG
FX=(
reset ""
bold "" no-bold ""
italic "" no-italic ""
underline "" no-underline ""
blink "" no-blink ""
reverse "" no-reverse ""
)
for color in {000..255}; do
FG[$color]="[38;5;${color}m"
BG[$color]="[48;5;${color}m"
done
#
# Powerline-Arrow theme
#
PROMPT='%n@%m %{$FG[000]%}%{$BG[235]%}⮀%{$reset_color%}%{$BG[235]%} %~ $(check_git_prompt_info)%{$reset_color%} $ '
local return_code="%(?..%{$fg[cyan]%}%? ↵%{$reset_color%})"
RPROMPT="${return_code}"
ZSH_THEME_GIT_PROMPT_PREFIX="%{$FG[236]%}%{$BG[237]%}⮀ %{$FG[014]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}%{$FG[238]%}⮀%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$FG[001]%}*%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN=" "
# Git sometimes goes into a detached head state. git_prompt_info doesn't
# return anything in this case. So wrap it in another function and check
# for an empty string. -- Brorrowed from Soliah.zsh-theme :)
function check_git_prompt_info() {
if git rev-parse --git-dir > /dev/null 2>&1; then
if [[ -z $(git_prompt_info) ]]; then
echo "%{$fg[cyan]%}(detached%{$fg[magenta]%}*%{$fg[cyan]%})%{$reset_color%}"
else
echo "$(git_prompt_info)"
fi
else
echo "%{$reset_color%}%{$FG[236]%}⮀"
fi
}

View File

View File

@@ -3,7 +3,7 @@ PROMPT='%n@%m %~$(check_git_prompt_info)$ %{$reset_color%}'
local return_code="%(?..%{$fg[cyan]%}%? ↵%{$reset_color%})"
RPROMPT="${return_code}"
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[cyan]%}("
ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[cyan]%}("
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}*%{$fg[cyan]%})%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[cyan]%})%{$fg[blue]%}"
@@ -15,9 +15,9 @@ ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[cyan]%})%{$fg[blue]%}"
function check_git_prompt_info() {
if git rev-parse --git-dir > /dev/null 2>&1; then
if [[ -z $(git_prompt_info) ]]; then
echo " %{$fg[cyan]%}(detached%{$fg[magenta]%}*%{$fg[cyan]%})%{$reset_color%}"
echo "%{$fg[cyan]%}(detached%{$fg[magenta]%}*%{$fg[cyan]%})%{$reset_color%}"
else
echo " $(git_prompt_info)"
echo "$(git_prompt_info)"
fi
fi
}

1
shell/zsh/zplug Submodule

Submodule shell/zsh/zplug added at 78cfe440ec

3
shell/zsh/zplug-cache/.gitignore vendored Normal file
View File

@@ -0,0 +1,3 @@
.cache
repos/*
zcompdump

View File