From 795495b864206b8b64ca28d2dca26bea9a732514 Mon Sep 17 00:00:00 2001 From: omarriott Date: Wed, 5 Dec 2012 22:27:16 +1100 Subject: [PATCH 01/10] Fix a typo in git documentation --- modules/git/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/git/README.md b/modules/git/README.md index 806bc9ca..f3cf1ecb 100644 --- a/modules/git/README.md +++ b/modules/git/README.md @@ -292,7 +292,7 @@ Second, format how the above attributes are displayed in prompts. 'prompt' ' git(%b)' \ 'rprompt' '[%R]' -Last, add `$git_info[prompt]` to `$PROMPT` and `$git_info[prompt]` to +Last, add `$git_info[prompt]` to `$PROMPT` and `$git_info[rprompt]` to `$RPROMPT` respectively and call `git-info` in the `prompt_name_preexec` hook function. From 29647947fe29c6adecae436c1f6135ad35c5348e Mon Sep 17 00:00:00 2001 From: Jeff Sandberg Date: Sat, 8 Dec 2012 13:06:19 -0700 Subject: [PATCH 02/10] [Fix #335] Prevent rbenv from hashing gems at startup --- modules/ruby/init.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/ruby/init.zsh b/modules/ruby/init.zsh index b5ab77d0..b287cbb2 100644 --- a/modules/ruby/init.zsh +++ b/modules/ruby/init.zsh @@ -17,11 +17,11 @@ if [[ -s "$HOME/.rvm/scripts/rvm" ]]; then # Load manually installed rbenv into the shell session. elif [[ -s "$HOME/.rbenv/bin/rbenv" ]]; then path=("$HOME/.rbenv/bin" $path) - eval "$(rbenv init - zsh)" + eval "$(rbenv init - --no-rehash zsh)" # Load package manager installed rbenv into the shell session. elif (( $+commands[rbenv] )); then - eval "$(rbenv init - zsh)" + eval "$(rbenv init - --no-rehash zsh)" # Install local gems according to operating system conventions. else From decf3cd87590e2c172b5620c74e5a000284b88aa Mon Sep 17 00:00:00 2001 From: Shahar Mintz Date: Mon, 10 Dec 2012 16:09:27 +0200 Subject: [PATCH 03/10] Fix auto completion for SSH hosts when saved with a non-standard port --- modules/completion/init.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/completion/init.zsh b/modules/completion/init.zsh index de59a5d2..c33c0f77 100644 --- a/modules/completion/init.zsh +++ b/modules/completion/init.zsh @@ -96,7 +96,7 @@ zstyle ':completion::*:(-command-|export):*' fake-parameters ${${${_comps[(I)-va # Populate hostname completion. zstyle -e ':completion:*:hosts' hosts 'reply=( - ${=${${(f)"$(cat {/etc/ssh_,~/.ssh/known_}hosts(|2)(N) 2>/dev/null)"}%%[#| ]*}//,/ } + ${=${=${=${${(f)"$(cat {/etc/ssh_,~/.ssh/known_}hosts(|2)(N) 2>/dev/null)"}%%[#| ]*}//\]:[0-9]*/ }//,/ }//\[/ } ${=${(f)"$(cat /etc/hosts(|)(N) <<(ypcat hosts 2>/dev/null))"}%%\#*} ${=${${${${(@M)${(f)"$(cat ~/.ssh/config 2>/dev/null)"}:#Host *}#Host }:#*\**}:#*\?*}} )' From 37f65b3f86219363afaf10c6330c30d73c190562 Mon Sep 17 00:00:00 2001 From: huyz Date: Tue, 11 Dec 2012 21:37:17 -0800 Subject: [PATCH 04/10] Check for the existence of .zcompdump before compiling --- runcoms/zlogin | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runcoms/zlogin b/runcoms/zlogin index 9e315775..e27e2332 100644 --- a/runcoms/zlogin +++ b/runcoms/zlogin @@ -9,7 +9,7 @@ { # Compile the completion dump to increase startup speed. zcompdump="${ZDOTDIR:-$HOME}/.zcompdump" - if [[ "$zcompdump" -nt "${zcompdump}.zwc" || ! -s "${zcompdump}.zwc" ]]; then + if [[ -s "$zcompdump" && (! -s "${zcompdump}.zwc" || "$zcompdump" -nt "${zcompdump}.zwc") ]]; then zcompile "$zcompdump" fi From a120602dfa24f342d4c9021b54bbf17a452697a7 Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Thu, 20 Dec 2012 19:02:16 -0500 Subject: [PATCH 05/10] [Fix #338] Remove vi jk and kj bindings --- modules/editor/init.zsh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/modules/editor/init.zsh b/modules/editor/init.zsh index 53292923..ae253f25 100644 --- a/modules/editor/init.zsh +++ b/modules/editor/init.zsh @@ -270,10 +270,6 @@ bindkey -M vicmd "v" edit-command-line bindkey -M vicmd "u" undo bindkey -M vicmd "$key_info[Control]R" redo -# Switch to command mode. -bindkey -M viins "jk" vi-cmd-mode -bindkey -M viins "kj" vi-cmd-mode - if (( $+widgets[history-incremental-pattern-search-backward] )); then bindkey -M vicmd "?" history-incremental-pattern-search-backward bindkey -M vicmd "/" history-incremental-pattern-search-forward From 6cd1f66cd42b2afe04461d05907354615ebacabb Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Thu, 20 Dec 2012 19:11:17 -0500 Subject: [PATCH 06/10] [Fix #348] Clarify how GNU utilities are wrapped --- modules/gnu-utility/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/gnu-utility/README.md b/modules/gnu-utility/README.md index b0dc1eed..b3b6ded1 100644 --- a/modules/gnu-utility/README.md +++ b/modules/gnu-utility/README.md @@ -7,8 +7,8 @@ Installing GNU utilities on non-GNU systems in `$PATH` without a prefix, i.e. `ls` instead of `gls`, is not recommended since scripts that target other utilities will be broken. -However, for interactive use, prefixed commands can be wrapped in their -non-prefixed counterparts. +This module wraps GNU utilities in functions without a prefix for interactive +use. This module must be loaded **before** the *utility* module. From e5cfdba26d95830a8b4553fbde15aab2d2fddda2 Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Thu, 20 Dec 2012 19:27:50 -0500 Subject: [PATCH 07/10] Update external completions --- modules/completion/external | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/completion/external b/modules/completion/external index 9ef8d2f0..2166ab8a 160000 --- a/modules/completion/external +++ b/modules/completion/external @@ -1 +1 @@ -Subproject commit 9ef8d2f088d302fdedfa89b9cfd88ef926166a7c +Subproject commit 2166ab8a6c57d1d9115e34f51c3dc05ba15480c5 From bf957d7cc45c1a5f25046f7105cf28c63ee3e3ae Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Thu, 20 Dec 2012 19:30:08 -0500 Subject: [PATCH 08/10] Update external syntax-highlighting --- modules/syntax-highlighting/external | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/syntax-highlighting/external b/modules/syntax-highlighting/external index 45194671..a0862053 160000 --- a/modules/syntax-highlighting/external +++ b/modules/syntax-highlighting/external @@ -1 +1 @@ -Subproject commit 45194671af8e1d6b37b16e214a58674762ab8e49 +Subproject commit a0862053f57e3d8d6e0dbc34e55be13d9e4fb668 From c7373690836a13fbadd84bbe5949c534db3fd7ca Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Thu, 20 Dec 2012 19:49:07 -0500 Subject: [PATCH 09/10] Add an alias to ammend a git commit, including the message --- modules/git/README.md | 1 + modules/git/alias.zsh | 1 + 2 files changed, 2 insertions(+) diff --git a/modules/git/README.md b/modules/git/README.md index f3cf1ecb..6eeb3216 100644 --- a/modules/git/README.md +++ b/modules/git/README.md @@ -56,6 +56,7 @@ Aliases - `gcO` checks out paths to work tree using the *HEAD* commit. - `gcf` amends the tip of the current branch using the same log message as *HEAD*. + - `gcF` amends the tip of the current branch. - `gcp` applies changes introduced by existing commits. - `gcP` applies changes introduced by existing commits without committing. - `gcr` reverts existing commits by reverting patches and recording new diff --git a/modules/git/alias.zsh b/modules/git/alias.zsh index 8d84d923..9af1c8a7 100644 --- a/modules/git/alias.zsh +++ b/modules/git/alias.zsh @@ -48,6 +48,7 @@ alias gcm='git commit --message' alias gco='git checkout' alias gcO='git checkout HEAD --' alias gcf='git commit --amend --reuse-message HEAD' +alias gcF='git commit --amend' alias gcp='git cherry-pick --ff' alias gcP='git cherry-pick --no-commit' alias gcr='git revert' From cda21aef7c8a6337c9cc4f5f64ff8cf690db6448 Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Fri, 21 Dec 2012 19:38:55 -0500 Subject: [PATCH 10/10] [Fix #329] Add giddie theme --- modules/prompt/functions/prompt_giddie_setup | 59 ++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 modules/prompt/functions/prompt_giddie_setup diff --git a/modules/prompt/functions/prompt_giddie_setup b/modules/prompt/functions/prompt_giddie_setup new file mode 100644 index 00000000..01453edf --- /dev/null +++ b/modules/prompt/functions/prompt_giddie_setup @@ -0,0 +1,59 @@ +# +# A colourful, friendly, multiline theme with some handy features: +# +# Authors: +# Paul Gideon Dann +# +# Features: +# - Simple VCS branch, staged, and unstaged indication. +# - Prompt character is different in a VCS repository. +# - Last command exit status is displayed when non-zero. +# +# Screenshots: +# http://i.imgur.com/rCo3S.png +# + +function prompt_giddie_precmd { + # Replace "/home/" with "~" + _prompt_giddie_pwd="${PWD/#$HOME/~}" + + # Choose prompt symbol based on whether we are in a repository. + if (( $+commands[git] )) && git rev-parse 2> /dev/null; then + _prompt_giddie_symbol='±' + vcs_info + else + _prompt_giddie_symbol=')' + fi +} + +function prompt_giddie_setup { + setopt LOCAL_OPTIONS + unsetopt XTRACE KSH_ARRAYS + prompt_opts=(cr percent subst) + + # Load required functions. + autoload -Uz vcs_info + autoload -Uz add-zsh-hook + + # Add hook for calling vcs_info before each command. + add-zsh-hook precmd prompt_giddie_precmd + + zstyle ':prezto:module:editor:info:completing' format '%F{green}...%f' + zstyle ':prezto:module:editor:info:keymap:alternate' format '%F{yellow}--- VI-COMMAND ---%f' + zstyle ':vcs_info:*' enable git + zstyle ':vcs_info:*' check-for-changes true + zstyle ':vcs_info:*' formats ' on %F{magenta}%b%f%c%u' + zstyle ':vcs_info:*' actionformats ' on %F{magenta}%b%f%c%u %F{yellow}(%a)%f' + zstyle ':vcs_info:*' stagedstr '%F{green}+%f' + zstyle ':vcs_info:*' unstagedstr '%F{green}!%f' + + # Define prompts. + PROMPT='%(?..%F{red}%B-> [%?]%b%f +)%F{magenta}%n%f@%F{yellow}%m%f|%F{green}${_prompt_giddie_pwd}%f${vcs_info_msg_0_} +%F{blue}${_prompt_giddie_symbol}%f ' + RPROMPT= + SPROMPT='zsh: correct %F{magenta}%R%f to %F{green}%r%f [nyae]? ' +} + +prompt_giddie_setup "$@" +