Commit Graph

384 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
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
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
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
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