On Mon, Feb 2, 2009 at 00:59, Axel Liljencrantz <liljencra...@gmail.com> wrote:
>
> This is a very nice explanation. Would you care to submit is as a patch to
> doc_src/faq.hdr?
>
> :)
>
Patch attached, though I'm not sure it belongs there.
It's just one of dozens "I'm used to X in shell S, how do I do it in
fish?" questions.
It's more or less included in http://www.fishshell.org/wiki/moin.cgi/BashToFish.
(It also belongs in TcshToFish, which doesn't exist yet because only I'm lazy.)
And I believe the FAQ by it's nature should live in the wiki, not in
doxygen source.
In fact, I think all documentation should be wikified. I understand
that has some drawbacks compared to sources that live under version
control (though tools git-wiki, or even Trac, shorten this gap). But
docs like the FAQ, or BashToFish, have an "aposteriori" nature - it
makes a lot of sense to improve them after a version was released, so
they are well-suited to live in the wiki.
--
Beni <c...@users.sf.net> (I read email only on weekends)
diff -rN -u old-fish/doc_src/faq.hdr new-fish/doc_src/faq.hdr
--- old-fish/doc_src/faq.hdr 2009-02-08 03:16:17.000000000 +0200
+++ new-fish/doc_src/faq.hdr 2009-02-08 03:16:18.000000000 +0200
@@ -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 @@
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.
*/
------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users