From 48c07394277f5f3fd4f6ab03a8b35cf98e5f99bb Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Thu, 10 Dec 2015 11:35:28 -0500 Subject: [PATCH] Update prompt without zprezto --- aliases | 2 + zsh/atomaka.zsh-theme | 49 ------------------- .../functions/prompt_atomaka_setup => prompt} | 13 ++--- zshrc | 10 ++-- 4 files changed, 12 insertions(+), 62 deletions(-) delete mode 100644 zsh/atomaka.zsh-theme rename zsh/{modules/prompt/functions/prompt_atomaka_setup => prompt} (88%) diff --git a/aliases b/aliases index e47e75b..1d98e16 100644 --- a/aliases +++ b/aliases @@ -1,3 +1,5 @@ +alias ..="cd .." +alias ...="cd ../.." alias ....="cd ../../.." alias .....="cd ../../../.." alias a="ls -l --human-readable --all --color=auto" diff --git a/zsh/atomaka.zsh-theme b/zsh/atomaka.zsh-theme deleted file mode 100644 index 7a6ddde..0000000 --- a/zsh/atomaka.zsh-theme +++ /dev/null @@ -1,49 +0,0 @@ -# ZSH Theme - Preview: ADD PREVIEW -# Based on bira theme. Based on gnzh. - -# load some modules -autoload -U colors zsh/terminfo # Used in the colour alias below -colors -setopt prompt_subst - -# make some aliases for the colors: (coud use normal escap.seq's too) -for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE GRAY; do - eval PR_$color='%{$fg[${(L)color}]%}' -done -eval PR_NO_COLOR="%{$terminfo[sgr0]%}" -eval PR_BOLD="%{$terminfo[bold]%}" - -# Show username -eval PR_USER='${PR_GREEN}%n${PR_NO_COLOR}' - -# Check if we are on SSH or not -if [[ -n "$SSH_CLIENT" || -n "$SSH2_CLIENT" ]]; then - eval PR_HOST='${PR_YELLOW}%M${PR_NO_COLOR}' #SSH -else - eval PR_HOST='${PR_GREEN}%M${PR_NO_COLOR}' # no SSH -fi - - -local PR_PROMPT="%(?.$PR_GREEN->.$PR_RED->%{%})$PR_NO_COLOR" -local return_code="%(?..%{$PR_RED%}%?%{$PR_NO_COLOR%})" - -local current_time="[$PR_BOLD%D{%I:%M:%S}$PR_NO_COLOR]" -local user_host='${PR_USER}${PR_CYAN}@${PR_HOST}' -local current_dir='%{$PR_BOLD$PR_BLUE%}%~%{$PR_NO_COLOR%}' -local rvm_ruby='' -if which rvm-prompt &> /dev/null; then - rvm_ruby='%{$PR_RED%}‹$(rvm-prompt i v g s)›%{$PR_NO_COLOR%}' -else - if which rbenv &> /dev/null; then - rvm_ruby='%{$PR_RED%}‹$(rbenv version | sed -e "s/ (set.*$//")›%{$PR_NO_COLOR%}' - fi -fi -local git_branch='$(git_prompt_info)%{$PR_NO_COLOR%}' - -#PROMPT="${user_host} ${current_dir} ${rvm_ruby} ${git_branch}$PR_PROMPT " -PROMPT="${current_time} ${user_host} ${current_dir} ${rvm_ruby} ${git_branch} -|$PR_PROMPT " -RPS1="${return_code}" - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$PR_YELLOW%}[" -ZSH_THEME_GIT_PROMPT_SUFFIX="] %{$PR_NO_COLOR%}" diff --git a/zsh/modules/prompt/functions/prompt_atomaka_setup b/zsh/prompt similarity index 88% rename from zsh/modules/prompt/functions/prompt_atomaka_setup rename to zsh/prompt index 3f3111a..9a29992 100644 --- a/zsh/modules/prompt/functions/prompt_atomaka_setup +++ b/zsh/prompt @@ -1,5 +1,3 @@ -pmodload 'helper' - function prompt_atomaka_pwd { local pwd="${PWD/#$HOME/~}" @@ -19,15 +17,15 @@ function prompt_atomaka_userhost { eval PR_HOST='%F{green}%M%f' # no SSH fi - _prompt_atomaka_userhost='${PR_USER}%F{cyan}@${PR_HOST}%f' + _prompt_atomaka_userhost="${PR_USER}%F{cyan}@${PR_HOST}%f" } function prompt_atomaka_ruby { if which rvm-prompt &> /dev/null; then - _prompt_atomaka_ruby='[%F{red}$(rvm-prompt i v g s)%f]' + _prompt_atomaka_ruby="[%F{red}$(rvm-prompt i v g s)%f]" else if which rbenv &> /dev/null; then - _prompt_atomaka_ruby='[%F{red}$(rbenv version | sed -e "s/ (set.*$//")%f]' + _prompt_atomaka_ruby="[%F{red}$(rbenv version | sed -e "s/ (set.*$//")%f]" fi fi } @@ -46,12 +44,13 @@ function prompt_atomaka_vcs { zstyle ':vcs_info:*:prompt:*' formats "${branch_format}" zstyle ':vcs_info:*:prompt:*' nvcsformats "" - _prompt_atomaka_vcs='${vcs_info_msg_0_}' + _prompt_atomaka_vcs="${vcs_info_msg_0_}" } function prompt_atomaka_precmd { setopt LOCAL_OPTIONS unsetopt XTRACE KSH_ARRAYS + setopt prompt_subst # Format PWD. prompt_atomaka_pwd @@ -80,8 +79,6 @@ function prompt_atomaka_setup { # Add hook for calling git-info before each command. add-zsh-hook precmd prompt_atomaka_precmd - zstyle ':prezto:module:editor:info:completing' format '%B%F{red}...%f%b' - # keep this SPROMPT='zsh: correct %F{red}%R%f to %F{green}%r%f [nyae]? ' diff --git a/zshrc b/zshrc index 2fd22f9..ef8153e 100644 --- a/zshrc +++ b/zshrc @@ -27,18 +27,18 @@ HISTSIZE=20000 HISTFILE=~/.zsh_history SAVEHIST=20000 +# autocorrect +autoload -U compinit +compinit + # Make sure C-s works in vim stty start undef stty stop undef -# load zprezto -if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then - source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" -fi - # Aliases/Functions files source $HOME/.aliases source $HOME/.functions +source $HOME/.zsh/prompt if [[ "$OSTYPE" == darwin* ]]; then source $HOME/.aliases-mac