Commit Graph

130 Commits

Author SHA1 Message Date
ridiculousfish
09baecce5d Add self-insert-notfirst readline command
This adds a new readline command self-insert-notfirst, which is
analogous to self-insert, except that it does nothing if the cursor
is at the beginning. This will serve as a higher-performance implementation
for stripping leading spaces on paste.
2020-03-07 13:38:42 -08:00
ridiculousfish
e333f90c07 Place bind.rst readline function docs in more alphabetical order 2020-03-07 13:38:10 -08:00
Johannes Altmanninger
6d907a9346 Make default hg prompt leaner
The default hg prompt is slow on large repositories (hg status takes
2-3 seconds on mozilla-central) which is unacceptable as a default.

Mimick our git prompt: by default, only show the current branch.
If the new variable $fish_prompt_hg_show_informative_status is set,
then use the old behavior.

[ci skip]

(cherry picked from commit da7b762f4a)
2020-03-07 13:04:43 +01:00
Fabian Homborg
c37a425887 Disable svn prompt by default
This is apparently quite slow on large svn repos (like 40 seconds
slow), and we don't have a good thing to display other than the full
file information.

So we'll have to disable it for now.

Fixes #6681.

[ci skip]
2020-03-05 17:11:51 +01:00
Delapouite
764420f272 doc(ulimit): add missing backquotes around -H, -S and -a options
(cherry picked from commit a53405a7be)
2020-02-28 21:18:15 +08:00
Delapouite
f3eb996b45 doc: add interlinks between true ←→ false and and ←→ or cmds
(cherry picked from commit dce0fda2cc)
2020-02-24 20:05:21 +08:00
Delapouite
3f33576225 doc(abbr): adjust token names
(cherry picked from commit 4fba8022a9)
2020-02-23 21:48:47 +08:00
Fabian Homborg
f1c4fbaad8 docs: Correct bind docs on escape delay
We never updated that after we changed the default.

[ci skip]

(cherry picked from commit b28b14b67c)
2020-02-22 23:33:31 +08:00
Jason Nader
5932440e49 Fix broken links to index.html in cmd docs
(cherry picked from commit bc3b64bb50)
2020-01-31 23:22:43 +08:00
Fabian Homborg
1643df0d23 Docs: Clean up set_color
The wording should now be a bit nicer.

[ci skip]
2020-01-18 18:45:53 +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
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
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
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
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
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
Bruno Heridet
655f7c8c63 doc: add link to echo in printf command
[ci skip]
2019-10-24 21:44:53 +02:00
Delapouite
a2672dea7a doc: fix links pointing to history-search section
[ci skip]
2019-10-17 21:45:36 +02:00
Delapouite
e3caaed73f doc: add links between dirs, pushd and popd
[ci skip]
2019-10-16 09:05:59 +02:00
Bruno Heridet
38eb7129d3 doc: add links to bg, fg and jobs in disown command
[ci skip]
2019-10-15 12:57:01 -07:00
Mark Stosberg
087500e7b9 doc: document relative path support for source.
[ci skip]
2019-10-14 18:58:30 +02:00
Delapouite
09a97528a9 doc: add cross-refs between if and else commands 2019-10-10 18:17:10 +02:00
Bruno Heridet
7dbbd16d0a doc: add missing down-line and up-line (#6177)
[ci skip]
2019-10-08 18:01:32 +02:00
Bruno Heridet
9c651d7db0 doc: add link to feature flags in fish command
[ci skip]
2019-10-07 17:15:39 +02:00
Bruno Heridet
26adff3378 doc: add link to event handlers in emit
[ci skip]
2019-10-06 15:09:01 +02:00
domdom
0fdad2dd6a doc: mention history prefix search binds in binds.rst
Mention history-prefix-search-forward and history-prefix-search-backward in
binds.rst
2019-10-06 15:03:11 +02:00
David Adam
9516fa5017 complete: document change in 22ce8c23c6 2019-10-04 07:13:17 +08:00
Bruno Heridet
f1baa514a8 doc: add ref to cmd-breakpoint
[ci skip]
2019-10-02 15:53:22 +02:00
David Adam
e6d6c5c5c7 docs: improve realpath documentation 2019-09-17 20:48:22 +08:00
David Adam
02d82dcf85 docs: update all command synopsis formatting
Adds synopses for those commands missing them.

Moves all synopsis sections to code blocks. This improves the appearance, although highlighting as
fish code may not be the ideal appearance.
2019-09-17 17:59:04 +08:00
David Adam
c93c66f76b docs: fix formatting in prompt_pwd manual 2019-09-17 17:31:47 +08:00
David Adam
605885f851 docs: whitespace cleanup in source
Fixes some lint warnings.
2019-09-17 17:28:19 +08:00
David Adam
f11ee26aae docs: slight grammar improvement in source docs
[ci skip]
2019-09-17 16:37:35 +08:00
David Adam
4265b02eb3 docs: standardise on exit status terminology
Exit status is used in the POSIX specification and is preferred over return code/return status/exit
code.

[ci skip]
2019-09-17 16:37:01 +08:00
David Adam
2f6c8fb21a docs: source creates a new local scope
Discussed in #4443.
2019-09-17 16:25:12 +08:00
David Adam
737c2d156d history: fixup exact matching by default
Work on #6070. Fixup from 54ed2ad440.
2019-09-11 23:12:10 +08:00