diff options
Diffstat (limited to 'Doc/Zsh')
-rw-r--r-- | Doc/Zsh/contrib.yo | 27 | ||||
-rw-r--r-- | Doc/Zsh/zle.yo | 12 |
2 files changed, 31 insertions, 8 deletions
diff --git a/Doc/Zsh/contrib.yo b/Doc/Zsh/contrib.yo index 2648fd6c8..56eb62cfb 100644 --- a/Doc/Zsh/contrib.yo +++ b/Doc/Zsh/contrib.yo @@ -1312,12 +1312,7 @@ See the comments in the function for a few extra tips. ) findex(zed) item(tt(zed) [ tt(-f) ] var(name))( -This function uses the ZLE editor to edit a file or function. It rebinds -the return key to insert a line break, and adds bindings for `tt(^X^W)' in -the tt(emacs) keymap and `tt(ZZ)' in the tt(vicmd) keymap to accept (and -therefore write, in the case of a file) the edited file or function. -Keybindings are otherwise the standard ones; completion is available, and -styles may be set with the context prefix `tt(:completion:zed)'. +This function uses the ZLE editor to edit a file or function. Only one var(name) argument is recognized (additional arguments are ignored). If the tt(-f) option is given, the name is taken to be that of @@ -1328,6 +1323,26 @@ autoload file. Without tt(-f), var(name) is the path name of the file to edit, which need not exist; it is created on write, if necessary. + +While editing, the function sets the main keymap to tt(zed) and the +vi command keymap to tt(zed-vicmd). These will be copied from the existing +tt(main) and tt(vicmd) keymaps if they do not exist the first time tt(zed) +is run. They can be used to provide special key bindings used only in zed. + +If it creates the keymap, tt(zed) rebinds the return key to insert a line +break and `tt(^X^W)' to accept the edit in the tt(zed) keymap, and binds +`tt(ZZ)' to accept the edit in the tt(zed-vicmd) keymap. If the tt(zed) +keymap is created by hand, the user will need to bind: + +example(zle -M zed '^M' self-insert-unmeta +zle -M zed '^X^W' accept-line) + +for this behaviour, and if tt(zed-vicmd) is created by hand, + +example(zle -M zed-vicmd 'ZZ' accept-line) + +Completion is available, and styles may be set with the context prefix +`tt(:completion:zed)'. ) findex(zcp) findex(zln) diff --git a/Doc/Zsh/zle.yo b/Doc/Zsh/zle.yo index 0ebbb2739..2976cc6b5 100644 --- a/Doc/Zsh/zle.yo +++ b/Doc/Zsh/zle.yo @@ -265,7 +265,8 @@ by `tt(bindkey -m)'. findex(vared) cindex(parameters, editing) cindex(editing parameters) -item(tt(vared) [ tt(-Aache) ] [ tt(-p) var(prompt) ] [ tt(-r) var(rprompt) ] var(name))( +xitem(tt(vared) [ tt(-Aache) ] [ tt(-p) var(prompt) ] [ tt(-r) var(rprompt) ]) +item( [ -M var(main-keymap) ] [ -m var(vicmd-keymap) ] var(name))( The value of the parameter var(name) is loaded into the edit buffer, and the line editor is invoked. When the editor exits, var(name) is set to the string value returned by the editor. @@ -289,9 +290,16 @@ created automatically, even without tt(-c). If the tt(-p) flag is given, the following string will be taken as the prompt to display at the left. If the tt(-r) flag is given, the following string gives the prompt to display at the right. If the -tt(-h) flag is specified, the history can be accessed from ZLE. If the +tt(-h) flag is specified, the history can be accessed from ZLE. If the tt(-e) flag is given, typing tt(^D) (Control-D) on an empty line causes tt(vared) to exit immediately with a non-zero return value. + +The tt(-M) option gives a keymap to link to the tt(main) keymap during +editing, and the tt(-m) option gives a keymap to link to the tt(vicmd) +keymap during editing. For vi-style editing, this allows a pair of keymaps +to override tt(viins) and tt(vicmd). For emacs-style editing, only tt(-M) +is normally needed but the tt(-m) option may still be used. On exit, the +previous keymaps will be restored. ) findex(zle) cindex(widgets, rebinding) |