Commit graph

1778 commits

Author SHA1 Message Date
Fabian Boehm
dfaafd733a docs: Simplify exporting section 2022-12-21 16:24:00 +01:00
Fabian Boehm
d2cd6c1cd6 docs: Remove the term "wrapper"
This committed the sin of introducing a concept by giving it two
names:

> An alias, or wrapper, around ``ls`` might look like this

The term "wrapper" doesn't pull its weight here. It's simpler to just
call them aliases throughout. We do use "a simple wrapping function"
in another place, but that's to define "alias", not as a separate name.
2022-12-21 16:24:00 +01:00
Fabian Boehm
7435a2614d docs: Link to abbr more 2022-12-21 16:24:00 +01:00
Fabian Boehm
285b0602e4 docs: Fix link 2022-12-19 20:22:27 +01:00
Fabian Boehm
f82e00dbf6 docs: Some on completions 2022-12-19 19:46:16 +01:00
Fabian Boehm
8dd89ff9dd docs: Some work on commands
The difference between keywords and "decorations" isn't important here.
2022-12-19 19:39:47 +01:00
Fabian Boehm
8284e0499f docs: Some work on redirections 2022-12-19 19:39:47 +01:00
Johannes Altmanninger
daa9e1c466 abbr.rst: fix --set-cursor example
Since the --set-cursor argument is now optional, we must not separate it
from the option.
2022-12-17 18:09:54 +01:00
Johannes Altmanninger
622a0278bc interactive.rst: fix broken cross-reference 2022-12-17 18:09:54 +01:00
Fabian Boehm
9b45904539 docs/bind: Explain commandline -f
Fixes #9399
2022-12-16 20:41:57 +01:00
Fabian Boehm
95d672534e docs: Explain how to skip abbrs 2022-12-16 17:10:45 +01:00
Fabian Boehm
0e194adb70 docs: More on abbr 2022-12-15 17:54:16 +01:00
Fabian Boehm
886b4b92b2 docs/abbr: Explain ctrl-space
This is now more important because we have regexes and global abbrs
2022-12-13 18:32:56 +01:00
ridiculousfish
b2ee9c73e1 Call out more forcefully that abbreviations are interactive only 2022-12-10 16:29:46 -08:00
ridiculousfish
d8dbb9b259 Switch abbreviation '-r' flag from --rename to --regex
This will be the more common option and provides consistency with
`string`.
2022-12-10 16:21:39 -08:00
ridiculousfish
e08f4db1f9 Rename abbreviation cursor "sentinel" to "marker"
Also default the marker to '%'. So you may write:

    abbr -a L --position anywhere --set-cursor "% | less"

or set an explicit marker:

   abbr -a L --position anywhere --set-cursor=! "! | less"
2022-12-10 16:15:03 -08:00
ridiculousfish
01039537b0 Remove abbreviation triggers
Per code review, this does not add enough value to introduce now.
Leaving the feature in history should want want to revisit this
in the future.
2022-12-10 16:15:00 -08:00
ridiculousfish
35a4688650 Rename abbreviation triggers
This renames abbreviation triggers from `--trigger-on entry` and
`--trigger-on exec` to `--on-space` and `--on-enter`. These names are less
precise, as abbreviations trigger on any character that terminates a word
or any key binding that triggers exec, but they're also more human friendly
and that's a better tradeoff.
2022-12-10 15:38:50 -08:00
ridiculousfish
5841e9f712 Remove '--quiet' feature of abbreviations
Per code review, this is too risky to introduce now. Leaving the feature
in history should want want to revisit this in the future.
2022-12-10 15:38:50 -08:00
ridiculousfish
22bd43f9d5 Document new abbreviation features 2022-12-10 15:38:50 -08:00
ridiculousfish
1402bae7f4 Re-implement abbreviations as a built-in
Prior to this change, abbreviations were stored as fish variables, often
universal. However we intend to add additional features to abbreviations
which would be very awkward to shoe-horn into variables.

Re-implement abbreviations using a builtin, managing them internally.

Existing abbreviations stored in universal variables are still imported,
for compatibility. However new abbreviations will need to be added to a
function. A follow-up commit will add it.

Now that abbr is a built-in, remove the abbr function; but leave the
abbr.fish file so that stale files from past installs do not override
the abbr builtin.
2022-12-10 15:29:03 -08:00
Fabian Boehm
d640e0d0d6 docs/language: Some slight tweaks
It reads nicer to not have the "see also" thing right in the first
paragraph. I'm not even done reading this, why are you sending me
elsewhere?

(of course if it's a hotlink on a specific word that's different)
2022-12-07 21:47:00 +01:00
Fabian Boehm
02e11773ad docs/css: Make h4s visible
Otherwise this just looks like normal text. Same size as h3 for now,
we might want to think about another indicator - underlines?
background color?
2022-12-07 21:47:00 +01:00
Fabian Boehm
e34f0e7c9f docs: Add some more envvars to reference
(and fix a couple of references)
2022-12-01 18:00:06 +01:00
Fabian Boehm
65a00c80b3 docs: Explain what times output means 2022-12-01 17:56:57 +01:00
Fabian Boehm
e551f93f6d docs/set: Don't hide -u so much
It's fine if it doesn't show up in the synopsis above, but putting it
under "Notes" is just too awkward.

It's a short option that exists, and so it should be documented.
2022-11-10 11:34:50 +01:00
Aaron Gyes
6859a4c6f6 add missing space 2022-11-09 18:42:44 -08:00
Aaron Gyes
154b809c98 html docs: Make prompt (> ) portion of example code unselectable
It goofs up copy-and-pasting. Really annoying, especially
if there are multiple lines.
2022-11-09 18:31:04 -08:00
Aaron Gyes
c107b57562 fixup unintentional NOTES newline 2022-11-09 18:04:44 -08:00
Aaron Gyes
32e770a4c2 set docs: improve syopsis, fix formatting, hide -u
I tried to make the synopsis a little less theoretical with
the placeholders and instead introduced the actual scope
options, long and short once, then refer to them as -Uflg from
then on.

I mentioned that list indicies are accepted / work to erase stuff.

In the list of options, we pretend like --unexport is long-only.
Especially with --unpath and --path, and what would go wrong
if one confused it with --univeral, and how rarely it's used,
I think it's better this way. I mention it as a synonym later
in the document so that it's not literally undocumented.

Changed phrasing such as:

"Causes the specified shell variable to be given a global scope"

Which can be read as we are taking a shell variable that exists
and giving it global scope, upgrading it to global (retaining
the value).

Redid the example section using the > syntax for things entered
into a prompt, with shell output following. The explanatory

Added in missing newlines at the ends of sentences.
2022-11-09 17:50:48 -08:00
Mahmoud Al-Qudsi
37b0f4dabc Document escape of new lines
I'm not sure if line continuations are covered anywhere else in the docs, but I
think the escapes section of the language page is a good place to mention them.
2022-11-09 13:01:09 -06:00
Mahmoud Al-Qudsi
6ac18defd2 Add status current-commandline
Makes it possible to retrieve the currently executing command line as
opposed to the currently executing command (`status current-command`).

Closes #8905.
2022-10-26 12:15:02 -05:00
Mahmoud Al-Qudsi
e3c67ae229 Reword debugging section in language docs
- Clean up the wording a little.
- Highlight the limitations of the "debugger" more clearly and don't mislead
  people into thinking it's possible to really interactively set/remove
  breakpoints except in select circumstances.

Sidenote: I can't believe we're using a markup language that doesn't support
nested inline markup. What a crying shame, rST!
2022-10-23 12:51:12 -05:00
Fabian Boehm
23b5390a0c docs: Mention --profile 2022-10-23 13:43:02 +02:00
Fabian Boehm
4001e2fe19 docs: Mention function name restriction in "identifiers" 2022-10-23 13:39:44 +02:00
Fabian Boehm
358214938a docs: Don't double-document --argument-names 2022-10-23 13:36:56 +02:00
Fabian Boehm
5ba9c7c2ca docs: Move event documentation to the events section
This was a bit awkward in the function page.
2022-10-23 11:39:13 +02:00
Fabian Boehm
8c362c89b5
git prompt: Interpret values of "1", "yes" or "true" as true for bools instead of relying on defined-or-not (#9274)
This allows explicitly turning these settings off by setting the variable to e.g. 0.

See #7120
2022-10-21 20:22:20 +02:00
Fabian Boehm
a4dc6dcb74 docs: Add some more mentions
We should have more cross-linking and mentions of our builtins and
functions, so people can find the dang things.
2022-10-20 19:33:57 +02:00
Fabian Boehm
b6c1ecb288 docs: Add something on how we find commands 2022-10-20 19:31:18 +02:00
Mahmoud Al-Qudsi
994049d33b Document support for erasing from multiple scopes 2022-10-20 11:21:05 -05:00
Fabian Boehm
2419809a26 Fix formatting for isatty
(this did not recognize `[FILE DESC]` because of the space)
2022-10-19 20:10:26 +02:00
Fabian Boehm
98552817f5 Document fish_clipboard_copy/paste 2022-10-19 20:10:26 +02:00
Fabian Boehm
054f9baf88 Add a fish_delta helper function
This helps figuring out which functions, completions and config you've overridden.
2022-10-19 20:06:35 +02:00
Michael Jarvis
ad696a1ec3
Fix warning 20221018 (#9287)
* Fix Sphinx warning:

../CHANGELOG.rst:2: WARNING: Explicit markup ends without a blank line; unexpected unindent.

* Fix Sphinx warning:

fish-shell/doc_src/language.rst:129: WARNING: Explicit markup ends without a blank line; unexpected unindent.
2022-10-18 18:23:12 +02:00
Mahmoud Al-Qudsi
dd0fd88736 Clarify and expand scope documentation
The function scope was not mentioned at all, even though it can be manually
specified.
2022-10-15 16:04:09 -05:00
Sietse Brouwer
cd91b39675
docs: bind: explain more fully how modes work (#9278)
* docs: bind: explain more fully how modes work

* Fix rst
2022-10-14 18:53:21 +02:00
Fabian Boehm
d7f36fab44 docs: Fix some of the escaping section
No more need to escape `^`, be fancy with the backslash space to make
it actually, you know, render in the output.
2022-10-12 18:18:27 +02:00
Fabian Boehm
1e7a4b076d vi-mode: Bind "/" to history-pager
This is unused currently, so we can just use it here. Ctrl-s as the
inverse stays because that's shared.

Fixes #2271
2022-10-11 17:47:13 +02:00
Fabian Boehm
52dcfe11af Make \x the same as \X
Up to now, in normal locales \x was essentially the same as \X, except
that it errored if given a value > 0x7f.

That's kind of annoying and useless.

A subtle change is that `\xHH` now represents the character (if any)
encoded by the byte value "HH", so even for values <= 0x7f if that's
not the same as the ASCII value we would diverge.

I do not believe anyone has ever run fish on a system where that
distinction matters. It isn't a thing for UTF-8, it isn't a thing for
ASCII, it isn't a thing for UTF-16, it isn't a thing for any extended
ASCII scheme - ISO8859-X, it isn't a thing for SHIFT-JIS.

I am reasonably certain we are making that same assumption in other
places.

Fixes #1352
2022-10-09 15:24:01 +02:00
Fabian Boehm
a99f588328 docs: More on bool flags
Instead of duplicating this, just point above.
2022-10-07 16:11:45 +02:00
Fabian Boehm
e62af43d12 docs: Fix how bool flag vars are set
This was changed for #4226, shortly after argparse was implemented.

Fixes #9265
2022-10-07 15:48:24 +02:00
Fabian Boehm
a4ff61ffa4 docs: Minor formatting fixes 2022-10-06 21:30:13 +02:00
Alexo
88ced9fb0f
docs: remove redundant '$' in read.rst (#9263)
`:envvar:` automatically prepends a `$` before the variable name provided in between the backticks.
2022-10-06 14:29:17 -05:00
Sergei Shilovsky
e274ef6c0d
commandline --selection-start and --selection-end implementation
Fixes #9197
2022-10-05 18:51:00 +02:00
Mahmoud Al-Qudsi
e2d37152ad Move short old-style example to end 2022-10-04 12:56:46 -05:00
Mahmoud Al-Qudsi
57175a80c0 complete docs: When to use old-style for short options
There are many applications with "primitive" argument parsing capabalities that
cannot handle munging two short options together (`-xf` for `-x -f`) or a short
option and its required value (`-dall` for `-d all`). To prevent fish from
suggesting munged arguments/payloads, the options (both long and short, not just
long!) can be specified as `-o` or `--old-option` but none of this is
documented.
2022-10-04 12:56:46 -05:00
Fabian Boehm
8deab8d9ce docs/string: Document shorten return value and --quiet 2022-10-04 18:47:37 +02:00
Fabian Boehm
cb28b39b24 string shorten: Make max of 0 mean no shortening
This makes it easier to just slot in `string shorten` wherever,
without having to do a weird "if test $max -gt 0" check.
2022-10-04 18:44:21 +02:00
Fabian Boehm
a7f3af921f docs: Document type/builtin exit status
Fixes #9252
2022-09-30 18:50:14 +02:00
Fabian Boehm
521dc5c5d0 docs: Explain SIGPIPE and how it relates to $pipestatus 2022-09-30 18:32:43 +02:00
Mahmoud Al-Qudsi
e930dc92b0 Make stylistic grammatical change to complete docs
Use a hyphen when referring to "xxx-style" completions.
2022-09-26 14:08:34 -05:00
ridiculousfish
07c09bdee2 Tutorial: Merge the footnotes on aliases and abbreviations together
@mqudsi's feedback from #9226
2022-09-24 15:15:33 -07:00
ridiculousfish
39f3f75f5b Correct abbreviations typo and doc link 2022-09-24 15:14:31 -07:00
Luca Trevisani
064699cade Add reference to abbreviations 2022-09-24 15:10:11 -07:00
ridiculousfish
692a2fc135 Sphinx: disable hyphenation
Hyphenation in our documentation is aggressive, even to the point of caus-
ing options themselves to be broken across lines. This makes the document-
ation hard to read, especially when you have an option like `string colle-
ct` which gets a weird hyphen.

Remove the hyphenation from the CSS.
2022-09-24 12:36:39 -07:00
Fabian Boehm
1204cf5eb6 docs/read: Improve examples a bit 2022-09-24 10:56:43 +02:00
Fabian Boehm
38b24c2325 docs: Use :doc: role when linking to commands
This makes it so we link to the very top of the document instead of a
special anchor we manually include.

So clicking e.g. :doc:`string <cmds/string>` will link you to
cmds/string.html instead of cmds/string.html#cmd-string.

I would love to have a way to say "this document from the root of the
document path", but that doesn't appear to work, I tried
`/cmds/string`.

So we'll just have to use cmds/string in normal documents and plain
`string` from other commands.
2022-09-24 10:56:43 +02:00
Fabian Boehm
17426d4741 docs: Write an example for interactive read 2022-09-23 16:25:35 +02:00
Luca Trevisani
86138db9f5 Fix Control+C key binding description 2022-09-20 23:21:16 +02:00
tocic
ade61fd50f docs: Fix typos 2022-09-17 21:31:06 +08:00
Mitchell Kember
ee1018ab53
Document that break cannot be used in switch 2022-09-17 00:12:10 -05:00
Fabian Boehm
47574de6b1 docs/path: Fix typos 2022-09-16 15:54:23 +02:00
Mitchell Kember
3e7ccefe11 Fix diagnostic flag in set_color docs 2022-09-15 20:01:04 +02:00
Fabian Boehm
ee6270301b docs: Moar history pager 2022-09-10 20:44:15 +02:00
Fabian Boehm
79642995f1 docs: ctrl-r is only history pager in emacs mode
We do not currently have a vi-binding for it because ctrl-r is redo
there.
2022-09-10 15:17:56 +02:00
Fabian Boehm
41c22d5e60 Add string shorten
This is essentially the inverse of `string pad`.
Where that adds characters to get up to the specified width,
this adds an ellipsis to a string if it goes over a specific maximum width.
The char can be given, but defaults to our ellipsis string.
("…" if the locale can handle it and "..." otherwise)

If the ellipsis string is empty, it just truncates.

For arguments given via argv, it goes line-by-line,
because otherwise length makes no sense.

If "--no-newline" is given, it adds an ellipsis instead and removes all subsequent lines.

Like pad and `length --visible`, it goes by visible width,
skipping recognized escape sequences, as those have no influence on width.

The default target width is the shortest of the given widths that is non-zero.

If the ellipsis is already wider than the target width,
we truncate instead. This is safer overall, so we don't e.g. move into a new line.
This is especially important given our default ellipsis might be width 3.
2022-09-09 18:49:57 +02:00
Fabian Boehm
09a50a2b1e Fix typo 2022-09-08 22:50:28 +02:00
Fabian Boehm
dbeb667ff4 Document history pager 2022-09-08 22:50:00 +02:00
Johannes Altmanninger
a6ff72bd64 faq.rst: fix typo 2022-08-31 07:49:49 +02:00
Fabian Boehm
a42a651d0a Use color for $fish_color_valid_path if it exists
This otherwise threw away the color. Since that's just information
that is thrown away, let's just use it.

Fixes #9159.
2022-08-25 17:42:42 +02:00
Fabian Boehm
c753f22003 docs: Format path synopsis
This was written while we changed how our synopses are formatted, so
we missed adding a "synopsis" marker to it.

The tokenizer here is a bit cheesy, so we can't mark continuation
lines with a "\", and we also can't mark the general options with a
":=". Tbh that's not a big deal.

Fixes #9154
2022-08-25 13:06:57 +02:00
Fabian Boehm
7e75118956 Document math's lack of bitnot
Fixes #9148
2022-08-23 19:55:55 +02:00
Johannes Altmanninger
20a3599b10 faq.rst: correct explanation of Ctrl-R/Ctrl-S bindings in history pager 2022-08-13 21:11:54 +02:00
Fabian Boehm
18df41e5e6 Document ctrl-r harder, add something on set -x 2022-08-12 21:28:11 +02:00
pagedown
9c16677706 help: Handle the missing builtin aliases : and [ 2022-08-12 20:45:20 +02:00
Fabian Boehm
df7b97d99d Link to correct path subcommand
Resolve is indeed the same as resolve
2022-08-08 21:13:10 +02:00
Fabian Boehm
39fbc27d8d Clarify math documentation
The words "rounded down" here get us into some trouble.
2022-08-06 10:58:46 +02:00
SeekingBlues
f9786673e3 Fix typo for or input function 2022-08-05 18:32:32 +02:00
Fabian Boehm
177cfbc605 docs/path: Add some more on resolve/normalize dichotomy 2022-08-02 19:58:43 +02:00
Johannes Altmanninger
453aac14af Advance pager history search with Control-R/Control-S
Note that every change to the search field still starts a new search, from
the end of history. We could change this in future but it's unclear to me
what the expected behavior is. I don't find the traditional readline behavior
very intuitive.
2022-07-30 23:27:24 +02:00
Johannes Altmanninger
dcff0a2f2b Add Control+R incremental history search in pager
This reimplements ridiculousfish/control_r which is a more future-proof
approach than #6686.
Pressing Control+R shows history in our pager and allows to search filter
commands with the pager search field.

On the surface, this works just like in other shells; though there are
some differences.

- Our pager shows multiple results at a time.
- Other shells allow to use up arrow/down arrow to select adjacent entries
  in history. Shouldn't be hard to implement but the hidden state might
  confuse users and it doesn't play well with up-or-search, so this is
  left out.

Users might expect the history pager to use subsequence matching (fuzzy
matching) like the completion pager, however due to the history pager design it
uses substring matching.  We could change this in future, however that means
we would also want to change the ordering from "reverse-chronological" to
"longest common subsequence" (e.g. what fuzzy finders do), because otherwise
a query "fis" might give this ordering:

            fsck /dev/disk/by-partlabel/Linux\x20filesystem
            fish

which is probably not what the user wants.

The pager shows only a small number of history items at a time.  This is
because, as explained above, the history pager does not support subsequence
matching, so navigating it does not scale well.

Closes #602
2022-07-30 23:27:24 +02:00
Michael Forster
91c68ec1af Add fish_cursor_selection_mode documentation 2022-07-30 09:49:23 -07:00
David Adam
4bad88f0df update Vi key binding documentation to reflect reality
PR #6777 changed all the keys to uppercase, but many Vi commands are case
sensitive.

PR #7908 changed the "u" binding but the documentation still had the old
meaning.
2022-07-21 22:57:37 +08:00
Fabian Boehm
547a4b2baf docs: Link some more to $PATH 2022-07-18 20:53:37 +02:00
Fabian Boehm
603a8e31e3 docs: Link fish_greeting function from FAQ
And explain the variable more in fish_greeting.

Closes #9056
2022-07-18 20:52:16 +02:00
Fabian Boehm
5dfb64b547
Add path mtime (#9057)
This can be used to print the modification time, like `stat` with some
options.

The reason is that `stat` has caused us a number of portability
headaches:

1. It's not available everywhere by default
2. The versions are quite different

For instance, with GNU stat it's `stat -c '%Y'`, with macOS it's `stat
-f %m`.

So now checking a cache file can be done just with builtins.
2022-07-18 20:39:01 +02:00
Aaron Gyes
92eb6024ed Document the three new [ operators
Explain test(1)'s -ef, -nt, -ot features.
2022-07-16 12:40:36 -07:00
Fabian Boehm
98ba66ed8e set_color: Print the given colors with --print-colors 2022-07-01 21:28:35 +02:00
Fabian Boehm
0a73b182c0 bind: Document --silent
See #9045
2022-07-01 20:46:52 +02:00