mirror of
				https://github.com/dcarrillo/prezto.git
				synced 2025-11-04 05:09:09 +00:00 
			
		
		
		
	[#23] Convert editor into a module
This commit is contained in:
		
							
								
								
									
										1
									
								
								init.zsh
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								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
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
@@ -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'
 | 
			
		||||
 
 | 
			
		||||
@@ -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'
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user