@ -80,7 +80,7 @@ zle -N edit-command-line
#
# Runs bindkey but for all of the keymaps. Running it with no arguments will
# print out the mappings for all of the keymaps.
function bindkey-all {
bindkey-all( ) {
local keymap = ''
for keymap in $( bindkey -l) ; do
[ [ " $# " -eq 0 ] ] && printf "#### %s\n" " ${ keymap } " 1>& 2
@ -89,7 +89,7 @@ function bindkey-all {
}
# Exposes information about the Zsh Line Editor via the $editor_info associative
# array.
function editor-info {
editor-info( ) {
# Clean up previous $editor_info.
unset editor_info
typeset -gA editor_info
@ -117,7 +117,7 @@ zle -N editor-info
# Reset the prompt based on the current context and
# the ps-context option.
function zle-reset-prompt {
zle-reset-prompt( ) {
if zstyle -t ':prezto:module:editor' ps-context; then
# If we aren't within one of the specified contexts, then we want to reset
# the prompt with the appropriate editor_info[keymap] if there is one.
@ -133,13 +133,13 @@ function zle-reset-prompt {
zle -N zle-reset-prompt
# Updates editor information when the keymap changes.
function zle-keymap-select {
zle-keymap-select( ) {
zle editor-info
}
zle -N zle-keymap-select
# Enables terminal application mode and updates editor information.
function zle-line-init {
zle-line-init( ) {
# The terminal must be in application mode when ZLE is active for $terminfo
# values to be valid.
if ( ( $+terminfo[ smkx] ) ) ; then
@ -153,7 +153,7 @@ function zle-line-init {
zle -N zle-line-init
# Disables terminal application mode and updates editor information.
function zle-line-finish {
zle-line-finish( ) {
# The terminal must be in application mode when ZLE is active for $terminfo
# values to be valid.
if ( ( $+terminfo[ rmkx] ) ) ; then
@ -167,14 +167,14 @@ function zle-line-finish {
zle -N zle-line-finish
# Toggles emacs overwrite mode and updates editor information.
function overwrite-mode {
overwrite-mode( ) {
zle .overwrite-mode
zle editor-info
}
zle -N overwrite-mode
# Enters vi insert mode and updates editor information.
function vi-insert {
vi-insert( ) {
zle .vi-insert
zle editor-info
}
@ -182,21 +182,21 @@ zle -N vi-insert
# Moves to the first non-blank character then enters vi insert mode and updates
# editor information.
function vi-insert-bol {
vi-insert-bol( ) {
zle .vi-insert-bol
zle editor-info
}
zle -N vi-insert-bol
# Enters vi replace mode and updates editor information.
function vi-replace {
vi-replace ( ) {
zle .vi-replace
zle editor-info
}
zle -N vi-replace
# Expands .... to ../..
function expand-dot-to-parent-directory-path {
expand-dot-to-parent-directory-path( ) {
if [ [ $LBUFFER = *.. ] ] ; then
LBUFFER += '/..'
else
@ -206,7 +206,7 @@ function expand-dot-to-parent-directory-path {
zle -N expand-dot-to-parent-directory-path
# Displays an indicator when completing.
function expand-or-complete-with-indicator {
expand-or-complete-with-indicator( ) {
local indicator
zstyle -s ':prezto:module:editor:info:completing' format 'indicator'
print -Pn " $indicator "
@ -216,7 +216,7 @@ function expand-or-complete-with-indicator {
zle -N expand-or-complete-with-indicator
# Inserts 'sudo ' at the beginning of the line.
function prepend-sudo {
prepend-sudo( ) {
if [ [ " $BUFFER " != su( do | ) \ * ] ] ; then
BUFFER = " sudo $BUFFER "
( ( CURSOR += 5 ) )