summaryrefslogtreecommitdiff
path: root/Etc/FAQ.yo
diff options
context:
space:
mode:
Diffstat (limited to 'Etc/FAQ.yo')
-rw-r--r--Etc/FAQ.yo46
1 files changed, 45 insertions, 1 deletions
diff --git a/Etc/FAQ.yo b/Etc/FAQ.yo
index c23dff5b2..9b7e558a6 100644
--- a/Etc/FAQ.yo
+++ b/Etc/FAQ.yo
@@ -126,6 +126,7 @@ Chapter 3: How to get various things to work
3.25. How do I get coloured prompts on my colour xterm?
3.26. Why is my output duplicated with `tt(foo 2>&1 >foo.out | bar)'?
3.27. What are these `^' and `~' pattern characters, anyway?
+3.28. How do I edit the input buffer in $EDITOR?
Chapter 4: The mysteries of completion
4.1. What is completion?
@@ -305,7 +306,7 @@ sect(On what machines will it run?)
sect(What's the latest version?)
- Zsh 5.0.8 is the latest production version. For details of all the
+ Zsh 5.1 is the latest production version. For details of all the
changes, see the NEWS file in the source distribution.
A beta of the next version is sometimes available. Development of zsh is
@@ -777,6 +778,27 @@ label(23)
mytt(function) to define a function, which doesn't expand aliases. It is
possible to argue for extra warnings somewhere in this mess.
+ One workaround for this is to use the "function" keyword instead:
+ verb(
+ alias l='/bin/ls -F'
+ function l { /bin/ls -la "$@" | more }
+ )
+ The mytt(l) after mytt(function) is not expanded. Note you don't need
+ the mytt(LPAR()RPAR()) in this case, although it's harmless.
+
+ You need to be careful if you are defining a function with multiple
+ names; most people don't need to do this, so it's an unusual problem,
+ but in case you do you should be aware that in versions of the shell
+ before 5.1 names after the first em(were) expanded:
+ verb(
+ function a b c { ... }
+ )
+ Here, mytt(b) and mytt(c), but not mytt(a), have aliases expanded.
+ This oddity was fixed in version 5.1.
+
+ The rest of this item assumes you use the (more common,
+ but equivalent) mytt(LPAR()RPAR()) definitions.
+
Bart Schaefer's rule is: Define first those aliases you expect to
use in the body of a function, but define the function first if the
alias has the same name as the function.
@@ -1701,11 +1723,17 @@ sect(What's wrong with cut and paste on my xterm?)
already active, and needs to be turned off when the first command is
executed. The shell doesn't even know if the remaining text is input
to a command or for the shell, so there's simply nothing it can do.
+
However, if you have problems you can trick it: type `tt({)' on a line
by itself, then paste the input, then type `tt(})' on a line by
itself. The shell will not execute anything until the final brace is
read; all input is read as continuation lines (this may require the
fixes referred to above in order to be reliable).
+
+ As of 5.0.9, this trick is not necessary on terminal emulators that
+ support the em(bracketed paste) feature (this includes most modern
+ terminal emulators). See the description of tt($zle_bracketed_paste)
+ in the tt(zshparam) manual page for details.
)
@@ -1924,6 +1952,22 @@ label(327)
)
+sect(How do I edit the input buffer in $EDITOR?)
+label(328)
+
+ When typing a long command interactively, it's possible to edit it in $EDITOR
+ before execution by using the tt(edit-command-line) ZLE widget. For example,
+ after putting
+ verb(
+ autoload -U edit-command-line;
+ zle -N edit-command-line;
+ bindkey '^Fc' edit-command-line;
+ )
+ in your tt(~/.zshrc), typing mytt(^F c) will open the entered-so-far
+ command-line for editing. The command will not be automatically executed;
+ quitting the editor will only return to zsh's command-line editing mode.
+
+
chapter(The mysteries of completion)