Commit Graph

397 Commits

Author SHA1 Message Date
Fabian Boehm
9043008933 abbr: Clarify universal variable message
And give explicit upgrade instructions.
2023-01-21 16:53:59 +01:00
mattmc3
cd17c1281d
Add argparse validation examples (#9483)
* Add argparse validation examples

* Remove invalid example
2023-01-19 11:06:51 +01:00
Fabian Boehm
8203fdf631 docs/abbr: Just explain right out that uvars don't work anymore 2023-01-14 14:19:46 +01:00
shenleban tongying
27952db9f7 docs: clearify global vs universal variable 2023-01-13 15:58:37 +01:00
Fabian Boehm
51bce422fd docs: More about envvars 2023-01-09 20:33:37 +01:00
Fabian Boehm
9e1c8a70bf docs/string: Add a -- example to the match section
This keeps tripping people up. We can't mention it *everywhere*, but
lets see if it works just in "match", since that sees to be where
people hit it most.
2023-01-08 12:44:02 +01:00
Fabian Boehm
c39c598996 docs/prompt_pwd: Fix envvar linking 2022-12-30 14:31:32 +01:00
Fabian Boehm
4c39aeed87 abbr: Let --function use a mandatory argument
This now means `abbr --add` has two modes:

```fish
abbr --add name --function foo --regex regex
```

```fish
abbr --add name --regex regex replacement
```

This is because `--function` was seen to be confusing as a boolean flag.
2022-12-24 10:29:26 +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
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
Fabian Boehm
9b45904539 docs/bind: Explain commandline -f
Fixes #9399
2022-12-16 20:41:57 +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
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