aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc_src/faq.hdr
diff options
context:
space:
mode:
authorGravatar axel <axel@liljencrantz.se>2009-02-17 07:19:40 +1000
committerGravatar axel <axel@liljencrantz.se>2009-02-17 07:19:40 +1000
commit0dd8ae4843a823cbe124d8d8b86d2ba60e44ed08 (patch)
tree137a9e056eaaf03c1be6497948f548c755cca692 /doc_src/faq.hdr
parent8a93b6f26db4626e8f107a4f30aa20e3268581be (diff)
Added faw entry on history editing, written by Beni Cherniavsky
darcs-hash:20090216211940-ac50b-4175fb2ae8ec2f5a67ac3c6a33a48bc5ac35eea2.gz
Diffstat (limited to 'doc_src/faq.hdr')
-rw-r--r--doc_src/faq.hdr21
1 files changed, 21 insertions, 0 deletions
diff --git a/doc_src/faq.hdr b/doc_src/faq.hdr
index 213749bb..99ad3623 100644
--- a/doc_src/faq.hdr
+++ b/doc_src/faq.hdr
@@ -7,6 +7,7 @@
- <a href='#faq-default'>How do I make fish my default shell?</a>
- <a href='#faq-titlebar'>I'm seeing weird output before each prompt when using screen. What's wrong?</a>
- <a href='#faq-greeting'>How do I change the greeting message?</a>
+- <a href='#faq-history'>Why doesn't history substitution ("!$" etc.) work?</a>
<hr>
@@ -136,5 +137,25 @@ the greeting use:
set fish_greeting
</pre>
+<hr>
+
+\section faq-history Why doesn't history substitution ("!$" etc.) work?
+
+Because history substitution is an awkward interface that was invented before
+interactive line editing was even possible. Fish drops it in favor of
+perfecting the interactive history recall interface. Switching requires a
+small change of habits: if you want to modify an old line/word, first recall
+it, then edit. E.g. don't type "sudo !!" - first press Up, then Home, then
+type "sudo ".
+
+Fish history recall is very simple yet effective:
+
+ - As in any modern shell, the Up arrow recalls whole lines, starting from the last line executed. A single press replaces "!!", later presses replace "!-3" and the like.
+ - If the line you want is far back in the history, type any part of the line and then press Up one or more times. This will constrain the recall to lines that include this text, and you will get to the line you want much faster. This replaces "!vi", "!?bar.c" and the like.
+ - Alt+Up recalls individual arguments, starting from the last argument in the last line executed. A single press replaces "!$", later presses replace "!!:4" and the like.
+ - If the argument you want is far back in history (e.g. 2 lines back - that's a lot of words!), type any part of it and then press Alt+Up. This will show only arguments containing that part and you will get what you want much faster. Try it out, this is very convenient!
+ - If you want to reuse several arguments from the same line ("!!:3*" and the like), consider recalling the whole line and removing what you don't need (Alt+D and Alt+Backspace are your friends).
+
+See <a href='index.html#editor'>documentation</a> for more details about line editing in fish.
*/