From 1330e6e7925ab2cb5586f2bb70fd3b269e74ca4e Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Wed, 28 Mar 2012 14:42:34 -0400 Subject: [PATCH] [#23] Convert editor into a module --- init.zsh | 1 - editor.zsh => modules/editor/init.zsh | 10 +++++----- templates/zshrc | 4 ++-- themes/sorin/prompt_sorin_setup | 2 +- 4 files changed, 8 insertions(+), 9 deletions(-) rename editor.zsh => modules/editor/init.zsh (96%) diff --git a/init.zsh b/init.zsh index c042c8b..4e0d181 100644 --- a/init.zsh +++ b/init.zsh @@ -50,7 +50,6 @@ autoload -Uz compinit && compinit -i source "${0:h}/helper.zsh" source "${0:h}/environment.zsh" source "${0:h}/terminal.zsh" -source "${0:h}/editor.zsh" # Source modules defined in ~/.zshrc. for omodule in "$omodules[@]"; do diff --git a/editor.zsh b/modules/editor/init.zsh similarity index 96% rename from editor.zsh rename to modules/editor/init.zsh index a2de304..93d4fef 100644 --- a/editor.zsh +++ b/modules/editor/init.zsh @@ -19,7 +19,7 @@ zstyle ':omz:prompt:vi' insert '>>>' zstyle ':omz:prompt:vi' command '<<<' # Indicator to notify of generating completion. -zstyle ':omz:editor' completing '...' +zstyle ':omz:module:editor' completing '...' # Beep on error in line editor. setopt BEEP @@ -96,7 +96,7 @@ zle -N expand-dot-to-parent-directory-path # Displays an indicator when completing. function expand-or-complete-with-indicator { local indicator - zstyle -s ':omz:editor' completing 'indicator' + zstyle -s ':omz:module:editor' completing 'indicator' print -Pn "$indicator" zle expand-or-complete-prefix zle redisplay @@ -204,7 +204,7 @@ for keymap in 'emacs' 'viins'; do bindkey -M "$keymap" "$keyinfo[Control]I" expand-or-complete-prefix # Expand .... to ../.. - if zstyle -t ':omz:editor' dot-expansion; then + if zstyle -t ':omz:module:editor' dot-expansion; then bindkey -M "$keymap" "." expand-dot-to-parent-directory-path fi @@ -217,12 +217,12 @@ for keymap in 'emacs' 'viins'; do done # Do not expand .... to ../.. during incremental search. -if zstyle -t ':omz:editor' dot-expansion; then +if zstyle -t ':omz:module:editor' dot-expansion; then bindkey -M isearch . self-insert 2> /dev/null fi # Set the key layout. -zstyle -s ':omz:editor' keymap 'keymap' +zstyle -s ':omz:module:editor' keymap 'keymap' if [[ "$keymap" == (emacs|) ]]; then bindkey -e elif [[ "$keymap" == vi ]]; then diff --git a/templates/zshrc b/templates/zshrc index 16528df..ba7f393 100644 --- a/templates/zshrc +++ b/templates/zshrc @@ -6,10 +6,10 @@ # # Set the key mapping style to 'emacs' or 'vi'. -zstyle ':omz:editor' keymap 'emacs' +zstyle ':omz:module:editor' keymap 'emacs' # Auto convert .... to ../.. -zstyle ':omz:editor' dot-expansion 'no' +zstyle ':omz:module:editor' dot-expansion 'no' # Set case-sensitivity for completion, history lookup, etc. zstyle ':omz:*:*' case-sensitive 'no' diff --git a/themes/sorin/prompt_sorin_setup b/themes/sorin/prompt_sorin_setup index 7d48852..1bc2cef 100644 --- a/themes/sorin/prompt_sorin_setup +++ b/themes/sorin/prompt_sorin_setup @@ -25,7 +25,7 @@ function prompt_sorin_setup { autoload -Uz add-zsh-hook add-zsh-hook precmd prompt_sorin_precmd - zstyle ':omz:editor' completing '%B%F{red}...%f%b' + zstyle ':omz:module:editor' completing '%B%F{red}...%f%b' zstyle ':omz:prompt:vi' insert '' zstyle ':omz:prompt:vi' command ' %F{yellow}❮%f%B%F{red}❮%f%b%F{red}❮%f' zstyle ':omz:module:git:prompt' action ':%%B%F{yellow}%s%f%%b'