Commit Graph

237 Commits

Author SHA1 Message Date
Johannes Altmanninger
d8e93a5956 fix sphinx warning
[ci skip]
2020-01-08 09:38:54 +01:00
Fabian Homborg
b7a0031174 docs/faq: Some minor extensions
[ci skip]
2020-01-06 21:48:35 +01:00
Fabian Homborg
4bfc7318e9 docs/time: Add a note about time command
[ci skip]
2020-01-05 22:28:39 +01:00
Fabian Homborg
23bf9661b2 Document time
This is a bit barebones, but `time` isn't super complicated to use and
it should explain the basics.

Fixes #6442

[ci skip]
2020-01-05 14:50:54 +01:00
Fabian Homborg
f3dbede2a5 Document variable overrides
[ci skip]
2020-01-05 14:44:48 +01:00
Fabian Homborg
4a47e212f8 Color the default prompt host if running via SSH
This is part of our (well, my) quest to spice up the default prompt.

In this case we color the host if $SSH_TTY is set, which is easy to
detect and helps draw attention to the host.

See #6398.
See #6375.
2019-12-30 14:03:36 +01:00
Fabian Homborg
bd8fd9fd0d docs/bind: Document and
[ci skip]
2019-12-25 10:46:46 +01:00
Fabian Homborg
c0f2e842ad Document missing bind functions
Turns out we never documented the "jump" ones.

That means the still-undocumented bind functions are

- vi-arg-digit
- vi-delete-to
- and

Mostly because I'd have to look up what they actually *do*, and
possibly rename them to be generic.

[ci skip]
2019-12-25 10:26:03 +01:00
Dan Martinez
de37e52dca Mention how functions --details handles aliases (#6423)
* Mention how `functions --details` handles aliases

* Clarify that `source` is responsible for `-` paths
2019-12-21 09:59:14 +01:00
Fabian Homborg
17b499d2ea docs/printf: Don't double "%"
This might be a leftover from doxygen, but sphinx does *not* require
"%%" here to print "%", so it shows

    %%d

instead of the correct

    %d

[ci skip]
2019-12-20 17:13:21 +01:00
David Adam
625db1d3f6 docs: add fish_cancel event
Introduced in 2dcaf4f5c0 as part of #5973.

[ci skip]
2019-12-14 22:36:07 +08:00
Dan Martinez
16dc606001 Add the --short flag to type (#6403)
* Add the `--succinct` flag to `type`

* Use `echo` rather than `printf`

* Change `succinct` to `short`; print path if known

* Clean up the printing logic ever so slightly
2019-12-11 22:24:29 +01:00
Fabian Homborg
0b36d94006 docs: Link to the fish-doc and fish-tutorial pages from fish(1)
Just a brief explanation what that page is good for and how to get the
full scoop.

Fixes #5521.

[ci skip]
2019-12-11 20:59:17 +01:00
Fabian Homborg
6da4b682db docs: Separate scripting/interactive sections
[ci skip]
2019-12-10 21:05:21 +01:00
Fabian Homborg
b491e2bbfc docs: Turn some sections into subsections
[ci skip]
2019-12-10 21:01:09 +01:00
Fabian Homborg
ea7868988a docs: Remove "simple"
This just reads condescending. The user can decide for themselves how
simple something is.

[ci skip]
2019-12-10 19:05:37 +01:00
Fabian Homborg
eb7837113f docs: File completion can indeed be enabled again
[ci skip]
2019-12-10 19:03:44 +01:00
Fabian Homborg
8a5eda3e9b docs: Some nits
[ci skip]
2019-12-10 18:47:46 +01:00
Fabian Homborg
2b6b6a0de0 docs: Link tutorial immediately 2019-12-10 18:47:14 +01:00
Fabian Homborg
d05b7614dd Reorder setup instructions
First tell them how to install (though we don't actually do that right
now), then tell them how to start it, and only *then* tell them how to
make it the default or uninstall it.

Just seems sensible to try it first then delete it.
2019-12-10 18:35:25 +01:00
Fabian Homborg
b35eca5d9b docs: Restructure introduction
Some more sections here were duplicated or not all that useful, and
it's weird to start with "Commands versus Functions".

Let's explain to people how to start fish, then let's get going.
2019-12-10 18:29:57 +01:00
Fabian Homborg
023eb48ba7 docs: More rewording
[ci skip]
2019-12-09 21:22:37 +01:00
Fabian Homborg
be8aac53a3 docs: Reword range expansion
[ci skip]
2019-12-09 21:22:37 +01:00
Fabian Homborg
c12232c24a docs: Some more wording changes
Try to sound more human, and also use footnotes. Footnotes are cool.

[ci skip]
2019-12-09 21:22:37 +01:00
Fabian Homborg
607eda7a7a docs: Streamline some of the introductory parts of index.rst
Really "what is a shell" is covered by the part where it says it
offers a commandline interface.
2019-12-09 21:22:37 +01:00
Fabian Homborg
00fc36c3eb docs: Simplify argparse docs
This was a bit stuffy and verbose, so try to make it a tad more human.

Also don't mention `fish_opt` constantly. It's not actually all that
useful as argparse isn't as difficult to use as we thought.

[ci skip]
2019-12-01 18:15:36 +01:00
Fabian Homborg
86133b0a2b Add read --tokenize
This splits a string into variables according to the shell's
tokenization rules, considering quoting, escaping etc.

This runs an automatic `unescape` on the string so it's presented like
it would be passed to the command. E.g.

    printf '%s\n' a\ b

returns the tokens

printf
%s\n
a b

It might be useful to add another mode "--tokenize-raw" that doesn't
do that, but this seems to be the more useful of the two.

Fixes #3823.
2019-12-01 18:14:26 +01:00
Fabian Homborg
1f976a5041 Disavow IRC channel
I don't know of any fish dev on there, so it's not a good channel to
reach us and I have no idea how good it is, so it's best to just ditch it.
2019-11-30 09:29:49 +01:00
David Adam
563bdf3cc7 docs: update isatty documentation to refer to terminals
Use language that is more accurate, similar to what glibc uses.

Closes #6355.
2019-11-26 18:18:16 +08:00
David Adam
b8a9f2f228 docs: restore compatibility with Sphinx < 1.8.0 2019-11-26 18:17:20 +08:00
Osamu Aoki
435556001e "eval" example to use $cmd as an array
Signed-off-by: Osamu Aoki <osamu@debian.org>
2019-11-25 13:23:21 +01:00
Osamu Aoki
d7e545d89b "source" to identify itself as a "block" first
Signed-off-by: Osamu Aoki <osamu@debian.org>
2019-11-25 13:23:21 +01:00
Johannes Altmanninger
7d5b44e828 Support FOO=bar syntax for passing variables to individual commands
This adds initial support for statements with prefixed variable assignments.
Statments like this are supported:

a=1 b=$a echo $b        # outputs 1

Just like in other shells, the left-hand side of each assignment must
be a valid variable identifier (no quoting/escaping).  Array indexing
(PATH[1]=/bin ls $PATH) is *not* yet supported, but can be added fairly
easily.

The right hand side may be any valid string token, like a command
substitution, or a brace expansion.

Since `a=* foo` is equivalent to `begin set -lx a *; foo; end`,
the assignment, like `set`, uses nullglob behavior, e.g. below command
can safely be used to check if a directory is empty.

x=/nothing/{,.}* test (count $x) -eq 0

Generic file completion is done after the equal sign, so for example
pressing tab after something like `HOME=/` completes files in the
root directory
Subcommand completion works, so something like
`GIT_DIR=repo.git and command git ` correctly calls git completions
(but the git completion does not use the variable as of now).

The variable assignment is highlighted like an argument.

Closes #6048
2019-11-25 09:20:51 +01:00
Johannes Altmanninger
08eac28bd8 Add individual documentation pages for string's subcommands
This adds string-x.rst for each subcommand x of string. The main page
(string.rst) is not changed, except that examples are shown directly after
each subcommand.  The subcommand sections in string.rst are created by
textual inclusion of parts of the string-x.rst files.

Subcommand man pages can be viewed with either of:

```
man string collect
man string-collect
string collect <press F1 or Alt-h>
string collect -h
```

While `string -h ...` still prints the full help.

Closes #5968
2019-11-07 09:54:25 +01:00
Johannes Altmanninger
12e783e30e sphinx docs: put search box above TOC
Makes it visible without having to scroll down.
[ci skip]
2019-11-05 08:47:06 +01:00
Fabian Homborg
e68c24beff docs/tutorial: Fix formatting
This removes the explicit html coloring that was used in the tutorial.
Where necessary we just add pseudo-html like `<red>...</red>` to
explain it to the users.

I don't know how to reintroduce coloring here, but it's not super
important as the user can always just check for themselves.

See #5696

[ci skip]
2019-11-04 20:08:45 +01:00
ridiculousfish
a7f1d2c0c7 Add support for fish_trace variable to trace execution
This adds support for `fish_trace`, a new variable intended to serve the
same purpose as `set -x` as in bash. Setting this variable to anything
non-empty causes execution to be traced. In the future we may give more
specific meaning to the value of the variable.

The user's prompt is not traced unless you run it explicitly. Events are
also not traced because it is noisy; however autoloading is.

Fixes #3427
2019-11-02 14:40:57 -07:00
Johannes Altmanninger
4dbb209421 Docs: escape word characters after backticks
[ci skip]
2019-11-01 19:11:51 +01:00
Fabian Homborg
9380b7ff39 history: Use --contains by default for "delete"
This just makes more sense, as people don't want to enter exact
matches if they delete interactively.

It also brings it in line with "search".

Fixes #6142
Rejects #6070
2019-11-01 08:53:24 +01:00
David Adam
d2b814bb7c docs: add link for explanation of escape key in bind documentation 2019-10-31 21:12:58 +08:00
Oleg Butuzov
0ec278d6bc Fixing broken link to bind.html 2019-10-31 21:06:14 +08:00
Johannes Altmanninger
5ce4cb66d3 fix stale doc
[ci skip]
2019-10-28 18:36:22 +01:00
ridiculousfish
2a92e66902 Support for &> and &| as convenience redirections
This adds support for &> and &| syntax, which both redirect stdout, and
also apply a redirection of stderr to stdout.
2019-10-27 15:24:57 -07:00
Bruno Heridet
655f7c8c63 doc: add link to echo in printf command
[ci skip]
2019-10-24 21:44:53 +02:00
LawAbidingCactus
305a657694 fix typos 2019-10-23 19:38:44 +02:00
Johannes Altmanninger
aa1bf9f277 sphinx: honor changes in static html assets
Also fix custom.css.
2019-10-19 14:52:24 +02:00
Delapouite
a2672dea7a doc: fix links pointing to history-search section
[ci skip]
2019-10-17 21:45:36 +02:00
Johannes Altmanninger
466b6e1b43
Merge pull request #6207 from krobelus/sphinx-toc
sphinx: highlight current page in the site navigation
2019-10-16 11:19:27 +02:00
Delapouite
e3caaed73f doc: add links between dirs, pushd and popd
[ci skip]
2019-10-16 09:05:59 +02:00
Johannes Altmanninger
cff721afda sphinx: highlight current page in the site navigation
Fixes #6189
2019-10-15 22:25:23 +02:00