From 1d2cd99e961ad350c85e785192388410c230eb8a Mon Sep 17 00:00:00 2001 From: "David Adam (zanchey)" Date: Mon, 20 May 2013 10:14:13 +0800 Subject: [PATCH] FAQ: add questions from beta site --- doc_src/faq.hdr | 82 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) diff --git a/doc_src/faq.hdr b/doc_src/faq.hdr index 528f5c230..0da40b498 100644 --- a/doc_src/faq.hdr +++ b/doc_src/faq.hdr @@ -1,5 +1,13 @@ /** \page faq Frequently asked questions +- How do I set or clear an environment variable? +- How do I run a command every login? What's fish's equivalent to .bashrc? +- How do I set my prompt? +- How do I run a command from history? +- How do I run a subcommand? The backtick doesn't work! +- How do I get the exit status of a command? +- How do I customize my syntax highlighting colors? +- How do I update man page completions? - Why does cd, pwd and other fish commands always resolve symlinked directories to their canonical path? - I accidentally entered a directory path and fish changed directory. What happened? - The open command doesn't work. @@ -11,6 +19,80 @@
+\section faq-envvar How do I set or clear an environment variable? + +Use the set command: + +
set -x key value
+set -e key
+ +
+ +\section faq-login-cmd How do I run a command every login? What's fish's equivalent to .bashrc? + +Edit the file ~/.config/fish/config.fish, creating it if it does not +exist. (Note the leading period.) + +
+ +\section faq-prompt How do I set my prompt? + +The prompt is the output of the \c fish_prompt function. Put it in +~/.config/fish/functions/fish_prompt.fish. For example, a simple +prompt is: +
function fish_prompt
+  set_color $fish_color_cwd
+  echo -n (prompt_pwd)
+  set_color normal
+  echo -n ' > '
+end
+ +You can also use the Web configuration tool, +fish_config, to preview +and choose from a gallery of sample prompts. + +
+ +\section faq-cmd-history How do I run a command from history? + +Type some part of the command, and then hit the up or down arrow keys to +navigate through history matches. + +
+ +\section faq-subcommand How do I run a subcommand? The backtick doesn't work! + +\c fish uses parentheses for subcommands. For example: + +
for i in (ls)
+  echo $i
+end
+ +
+ +\section faq-exit-status How do I get the exit status of a command? + +Use the \c $status variable. This replaces the \c $? variable used in some +other shells. + +
+ +\section faq-customize-colors How do I customize my syntax highlighting colors? + +Use the web configuration tool, +fish_config, or alter the +\c fish_color family of environment variables. + +
+ +\section faq-update-manpage-completions How do I update man page completions? + +Use the +fish_update_completions +command. + +
+ \section faq-cwd-symlink Why does cd, $PWD and and various fish commands always resolve symlinked directories to their canonical path?