5314 Commits

Author SHA1 Message Date
Dmitry Gerasimov
40b63c35ab completions/git: show custom aliases for --pretty option
Custom formats for --pretty/--format option can only be written in [pretty]
section, thus only this section is searched.

[ja: add ? to the regex]

Closes #11065

(cherry picked from commit dfa77e6c197bf7027b3baf408e64661e23da6ffa)
2025-02-13 00:02:13 +08:00
Dmitry Gerasimov
b72dc096f9 completions/git: update supported git format options
--format=reference is supported since git 2.25
--format=mboxrd is supported since git 2.27

(cherry picked from commit 9752b83e65da0543bd33ef68913d5c8d60b3bf0d)
2025-02-13 00:02:13 +08:00
Ilya Grigoriev
c571b65221 completions: add unbuffer completions
unbuffer is sometimes bundled with `expect` (which fish already ships
completions for), and sometimes is bundled separately. It's often
recommended for forcing colors to have color output.

https://manpages.debian.org/bookworm/expect/unbuffer.1.en.html

Ads for unbuffer:

https://wiki.archlinux.org/title/Color_output_in_console#Reading_from_stdin
https://jvns.ca/blog/2024/10/01/terminal-colours/
(cherry picked from commit 4208798585c47a142a946f5e8e81695d6fdd1893)
2025-02-13 00:01:07 +08:00
idealseal
6d7a7c2254 feat(comp): update to systemd 257
(cherry picked from commit 7accf4ffa1febcbfe2d6a90222fc573be7fe4f9a)
2025-02-11 22:53:09 +08:00
Ilya Grigoriev
0677c03689 completions/tmux: replace embedded tabs with \t
(cherry picked from commit 5dd6759d01afa1e1e901b966048e4dea93b237c7)
2025-02-11 22:32:22 +08:00
David Adam
1b6e107131 completions/elm: remove = in long options
elm's argument parser copes just fine without them

Review comment from
https://github.com/fish-shell/fish-shell/pull/10759#discussion_r1786918645

(cherry picked from commit 2849cd11aedcc4ba9d470ebab064f06d61212677)
2025-02-11 22:29:03 +08:00
Kemel Zaidan
7ea368b6d3 adds completion for the default Elm cli tool
(cherry picked from commit df6bd36e82d0529b475287a30678d230ead7847b)
2025-02-11 22:29:03 +08:00
Roland Fredenhagen
00b2009851 Complete entries for bootctl
Uses `jq` to parse and doesn't add these extra completions if not available.

(cherry picked from commit d862e7bf26b7e9c1558174c591287ed98431a690)
2025-02-11 22:29:03 +08:00
Johannes Altmanninger
65ac71edcc Make alt-{b,f} move in directory history if commandline is empty
alt-{left,right} move in the directory history (like in browsers).
Arrow keys can be inconvenient to reach on some keyboards, so
let's alias this to alt-{b,f}, which already have similar behavior.
(historically the behavior was the same; we're considering changing
that back on some platforms).

This happens to fix alt-{left,right} in Terminal.app (where we had
a workaround for some cases), Ghostty, though that alone should not
be the reason for this change.

Cherry-picked from commit f4503af037cf596f6dc4c2b2e39df703e3fd6d07.

Closes #11105
2025-02-06 19:15:03 +01:00
Fabian Boehm
378f452eaa Revert token movement bindings
Comments by macOS users have shown that, apparently, on that platform
this isn't wanted.

The functions are there for people to use,
but we need more time to figure out if and how we're going to bind
these by default.
For example, we could change these bindings depending on the OS in future.

This reverts most of commit 6af96a81a8c6ff5e632d4dda7448f5f01d7a5d35.

Fixes #10926
See #11107
2025-02-05 19:06:37 +01:00
phanium
bf91da5979
Fix twice tokenize editor_cmd
```fish
export VISUAL='nvim --cmd let\ g:flatten_wait=1'
funced -s fish_prompt
```

`editor_cmd[3]` would be `let` rather than `let g:flatten_wait=1`
2025-02-02 16:21:12 -08:00
Fabian Boehm
2f2ea729a7 completions/csvlens: Fix missing option
(cherry picked from commit bba15c6d14583778e458bfc96364ffc2f3057eb0)
2025-01-31 19:34:51 +01:00
Johannes Altmanninger
29e69bd113 Fix broken completions for "mount -ouid="
Cherry-picked from b46417c77b (Fix broken completions for "mount
-ouid=", 2024-11-21).
2025-01-29 10:33:20 +01:00
David Adam
3400844f9a completions/acpi: correct the -c option as cooling
Closes #11068.

(cherry picked from commit 2184aaf9b468c1df77a57778533a3e1368e66ed4)
2025-01-28 21:56:54 +08:00
Ilya Grigoriev
f1bb4e02fe completions/tmux: some windows and panes boolean flag completions
This documents some non-argument options for the window and panes
commands. The choice of what to document is somewhat arbitrary,
this commit is biased towards options that I find confusing or
misleading without documentation (is `-a` "all" or "after"?)
and the command that seem more useful to me.

I also didn't cover the options that would be covered by
#10855 (though this PR can be used independently). I'm not
sure how much difference this made, it might not matter at
all.

(cherry picked from commit f241187c4a47bae2016da78ef2c6b2b7b5345747)
2025-01-28 21:42:24 +08:00
Ilya Grigoriev
9385a25c22 completions/tmux: complete commands inside tmux lscm
Make `tmux lscm <tab>` work.

(cherry picked from commit 77406ddd1112df84725570b6ab1834f16d00c8e1)
2025-01-28 21:42:14 +08:00
Ilya Grigoriev
323bddcce6 completions/tmux: complete all flags when tmux lscm is available
These dynamic completions are exhaustive, but not as well-documented or
as ergonomic as the manual completions. So, any manual completions
should override them.

(cherry picked from commit 183e20cc3a60bbf93f50d9bf35a68dab665208e6)
2025-01-28 21:42:06 +08:00
Ilya Grigoriev
d29d63d930 completions/tmux: complete all subcommands when tmux lscm works
For example, `tmux shell<tab>` now completes to `if-shell` and
`run-shell`, though no additional information is provided.

(cherry picked from commit 27e5ed7456ff6faa59c747ee3cfb0f95850d6ee5)
2025-01-28 21:41:43 +08:00
Ilya Grigoriev
a62bae9e8f tmux completions: complete shell commands
(cherry picked from commit bcc69da5697d6278b032fac4f5f597946a02dbd2)
2025-01-28 21:41:32 +08:00
Fabian Boehm
fd3ed7cfa5 functions/__fish_cancel_commandline: Follow rename of bind function
See #10935
2025-01-22 17:44:28 +01:00
Johannes Altmanninger
4024d82412 Fix double expansion of tokenized command line
Commit 798527d79a (completions: fix double evaluation of tokenized
commandline, 2024-01-06) fixed some completions such as the "watchexec"
ones by adding "string escape" here:

	set argv (commandline -opc | string escape) (commandline -ct)

This fixed double evaluation when we later call `complete -C"$argv"`.

Unfortunately -- searching for "complete -C" and
"__fish_complete_subcommand" -- it seems like that commit missed some
completions such as sudo.  Fix them the same way.

Alternatively, we could defer expansion of those arguments (via
--tokens-raw), since the recursive call to completion will expand
them anyway, and we don't really need to know their value.

But there are (contrived) examples where we do want to expand first,
to correctly figure out where the subcommand starts:

	sudo {-u,someuser} make ins

By definition, the tokens returned by `commandline -opc` do not
contain the token at cursor (which we're currently completing).
So the expansion should not hurt us. There is an edge case where
cartesian product expansion would produce too many results, and we
pass on the unexpanded input. In that case the extra escaping is very
unlikely to have negative effects.

Fixes # 11041
Closes # 11067

Co-authored-by: kerty <g.kabakov@inbox.ru>
2025-01-19 19:08:38 +01:00
Daniel Fleischer
8c92ea1642 Add lazygit completions (#11019)
(cherry picked from commit 29c45100fa9ebecbab4d7a2a4532bf9c96e3a1f4)
2025-01-15 21:08:12 +08:00
Fabian Boehm
806734cc56 Make new ctrl-c behavior "clear-commandline"
Some checks are pending
make test / ubuntu (push) Waiting to run
make test / ubuntu-32bit-static-pcre2 (push) Waiting to run
make test / ubuntu-asan (push) Waiting to run
make test / macos (push) Waiting to run
Rust checks / rustfmt (push) Waiting to run
Rust checks / clippy (push) Waiting to run
And leave the old behavior under the name "cancel-commandline".

This renames "cancel-commandline-traditional" back to
"cancel-commandline", so the old name triggers the old behavior.

Fixes #10935
2025-01-14 20:00:31 +01:00
Branch Vincent
8e141070b2 completions: add fish-lsp (#11017)
(cherry picked from commit 7970ca55af5dab5d47729bc2e3fa2a646305faae)
2025-01-14 23:48:48 +08:00
Klaus Hipp
b3aa79e9aa Fix completion typos
Some checks failed
make test / ubuntu (push) Has been cancelled
make test / ubuntu-32bit-static-pcre2 (push) Has been cancelled
make test / ubuntu-asan (push) Has been cancelled
make test / macos (push) Has been cancelled
Rust checks / rustfmt (push) Has been cancelled
Rust checks / clippy (push) Has been cancelled
(cherry picked from commit 5c25d3c3b1192b7ec9e6c3874562669b2ed4aa0b)
2025-01-09 16:51:39 +01:00
phanium
fbf9ac8046 Fix missing of builtin token description
(cherry picked from commit ef7aa793c6e67744393dfdb93b2f51175c602d02)
2025-01-09 16:49:38 +01:00
César Sagaert
d6dccc3c88 DNF5 completion support (#11035)
* dnf5 completions

* address comments

(cherry picked from commit 00c7baf68cf77c84ab47a7d256c2a076de0dbc03)
2025-01-09 16:36:23 +01:00
Klaus Hipp
f36a7262db Revert "Fix typo in npm completions: isntall -> install" (#11014)
Some checks are pending
make test / ubuntu (push) Waiting to run
make test / ubuntu-32bit-static-pcre2 (push) Waiting to run
make test / ubuntu-asan (push) Waiting to run
make test / macos (push) Waiting to run
Rust checks / rustfmt (push) Waiting to run
Rust checks / clippy (push) Waiting to run
* Revert "Fix typo in npm completions: isntall -> install"

This reverts commit f4b01bb638fe0b8060403313fdcb617a52aca047.

* Add comments about typos in `npm` completions

(cherry picked from commit 4def0ac616a99398db18de54bb415bcc9eb320f1)
2025-01-08 08:53:33 +08:00
Steve Walker
52a2bed38c fix python completion #10943
(cherry picked from commit b574a5e4f6bf142fe05980e55ace8143e889922f)
2025-01-07 23:30:56 +08:00
Klaus Hipp
cbfbac2198 Fix completion typos for apt-build, htop and wget (#11016)
(cherry picked from commit ea4e4a4279106d481daafe3e9c7b6bc635a36ca7)
2025-01-07 21:48:23 +08:00
Lzu Tao
33fe575112 Add more convenient key bindings for VI mode
Some checks are pending
make test / ubuntu (push) Waiting to run
make test / ubuntu-32bit-static-pcre2 (push) Waiting to run
make test / ubuntu-asan (push) Waiting to run
make test / macos (push) Waiting to run
Rust checks / rustfmt (push) Waiting to run
Rust checks / clippy (push) Waiting to run
To make it more familiar to vi/vim users.

In all mode, ctrl-k is bind to kill-line.

In Vi visual mode:
* press v or i turn into normal or insert mode respectively.
* press I turn to insert mode and move the cursor to beginning of line.
* because fish doesn't have upcase/locase-selection, and most people reach for
  g-U rather than g-u, g-U binds to togglecase-selection temporarily.

(cherry picked from commit f9b79926f1a9aba7da9b6fb9076c764e127ae2ef)
2025-01-05 23:00:55 +08:00
cornmander
44a8344da1 Add completions for Google Cloud commands. (#11005)
Some checks are pending
make test / ubuntu (push) Waiting to run
make test / ubuntu-32bit-static-pcre2 (push) Waiting to run
make test / ubuntu-asan (push) Waiting to run
make test / macos (push) Waiting to run
Rust checks / rustfmt (push) Waiting to run
Rust checks / clippy (push) Waiting to run
The `gcloud` and `gsutil` Google Cloud commands use argcomplete, so integrating them is easy with the `__fish_argcomplete_complete` function.

(cherry picked from commit d842a6560e7333c373ea26eae7ba230814300c86)
2025-01-05 15:25:23 +08:00
Lzu Tao
046cadb53a Add completion for gem-fetch
(cherry picked from commit 7eb254f2bac0be4d2575ae085c44de0473fcb434)
2025-01-04 21:26:26 +08:00
idealseal
a5f99afa47 feat(comp): Update completions for resolvectl
(cherry picked from commit 2e12a2b6c475a690235a562166362727f6bb6032)
2025-01-04 20:42:44 +08:00
idealseal
24397c71cd feat(comp): Update completion for md5sum
(cherry picked from commit a780e4da15190ec2b9ea75e97636b3ef15cfc8c1)
2025-01-04 20:39:56 +08:00
Thayne McCombs
7ea2ab4ebb fix[completions]: Add set-timeout to bootctl
(cherry picked from commit 33dd823f456f687f2d276aebbb3870b54730c241)
2025-01-04 20:18:12 +08:00
Fabian Boehm
5845a3f7ad __fish_complete_subcommand: Just complete -C for a given commandline
Some checks are pending
make test / ubuntu (push) Waiting to run
make test / ubuntu-32bit-static-pcre2 (push) Waiting to run
make test / ubuntu-asan (push) Waiting to run
make test / macos (push) Waiting to run
Rust checks / rustfmt (push) Waiting to run
Rust checks / clippy (push) Waiting to run
Fixes #10980.

This would, if a commandline was given, still revert to checking
the *real* commandline if it was empty.

Unfortunately, in those cases, it could have found a command and tried
to complete it.

If a commandline is given, that is what needs to be completed.

(note this means this is basically useless in completions that use it
like `sudo` and could just be replaced with `complete -C"$commandline"`)

(cherry picked from commit d5efef1cc52091066f93843dad52b472738c62f7)
2025-01-03 19:35:14 +01:00
Alexei Mikhailov
ff8a879e80 completions/exercism: use generate script
Some checks are pending
make test / ubuntu (push) Waiting to run
make test / ubuntu-32bit-static-pcre2 (push) Waiting to run
make test / ubuntu-asan (push) Waiting to run
make test / macos (push) Waiting to run
Rust checks / rustfmt (push) Waiting to run
Rust checks / clippy (push) Waiting to run
Exercism ships with it's own completions and a generation script, so let's use
that one instead.

(cherry picked from commit 9b26fff278a4cbc98e14884c2449ffd16cffd256)
2025-01-02 21:57:57 +08:00
Klaus Hipp
6749a44d0f Update code completions
Some checks are pending
make test / ubuntu (push) Waiting to run
make test / ubuntu-32bit-static-pcre2 (push) Waiting to run
make test / ubuntu-asan (push) Waiting to run
make test / macos (push) Waiting to run
Rust checks / rustfmt (push) Waiting to run
Rust checks / clippy (push) Waiting to run
(cherry picked from commit 2b46d97c682e831a058fcbe4b2e70ff2531ea7e6)
2025-01-02 14:12:00 +08:00
EmilyGraceSeville7cf
550a076fa3 feat(completion) support batsh command
(cherry picked from commit 1bda6043c8cccc1d76f702f0fd2107b2fef002af)
2025-01-02 09:16:26 +08:00
EmilyGraceSeville7cf
c28659a045 feat(completion): support folderify command
(cherry picked from commit d8d5913159e3d1175c5764e924273203b28c8786)
2025-01-02 09:16:26 +08:00
Benjamin Kellermann
d2608588fc add completion for btrbk (#10752)
* add completion for btrbk

completions for btrbk https://github.com/digint/btrbk/

* change indent + spaces

(cherry picked from commit 2ac1523e54307fa7207b094e513e3167d38c92fa)
2025-01-02 09:16:26 +08:00
Ilya Grigoriev
dd333cdc82 completions/tmux: add skeleton "Windows and Panes" bindings (#10854)
Some checks are pending
make test / ubuntu (push) Waiting to run
make test / ubuntu-32bit-static-pcre2 (push) Waiting to run
make test / ubuntu-asan (push) Waiting to run
make test / macos (push) Waiting to run
Rust checks / rustfmt (push) Waiting to run
Rust checks / clippy (push) Waiting to run
These are quite mechanical, but include all the commands (as of tmux
3.5a) in the "Windows and Panes" section of `man tmux`. For these
commands, I included the target-pane/session/client/window flags and the
-F formatstring flags (but not the less generic flags specific to
individual commands).

Nice completion is implemented for those flags where the helper
functions were already implemented previously.

After this, tmux pane<tab> will hopefully be useful.

A few TODOs mention low-hanging fruit for somebody who better
understands fish's `complete` command syntax (or a future me).

Another piece of low-hanging fruit would be completion for all the
target-window flags. This PR merely lists them.

(cherry picked from commit b1064ac3a0884ea6e2e2ee3535c461b190df9fdf)
2025-01-02 09:14:37 +08:00
Dmitry Gerasimov
ea2c53ca85
completions/dnf: Fix completions for DNF5 (#9862)
Some checks failed
Rust checks / rustfmt (push) Has been cancelled
Rust checks / clippy (push) Has been cancelled
make test / ubuntu (push) Has been cancelled
make test / ubuntu-32bit-static-pcre2 (push) Has been cancelled
make test / ubuntu-asan (push) Has been cancelled
make test / macos (push) Has been cancelled
Since DNF5 there's no implicit \n in repoquery output. For DNF4 this change
leaves blank lines in the output, but they are ignored anyway.
2024-12-26 12:02:22 -08:00
phanium
06105e9207 Fix alt-e cursor position restore on Vim <= 8 (#10946)
Some checks are pending
make test / ubuntu-32bit-static-pcre2 (push) Waiting to run
make test / ubuntu (push) Waiting to run
make test / ubuntu-asan (push) Waiting to run
make test / macos (push) Waiting to run
Rust checks / rustfmt (push) Waiting to run
Rust checks / clippy (push) Waiting to run
Cherry-picked from commit 94dfe1b05304b9177f24f3daccefd272798b456c
2024-12-26 06:40:41 +01:00
Johannes Altmanninger
70ba81e5b3 Provide old implementation of cancel-commandline as fallback
__fish_cancel_commandline was unused (even before) and has some issues
on multiline commandlines. Make it use the previously active logic.

Closes #10935

Cherry-picked from 5de6f4bb3d8c3d4db1fd0b66c2ebfa59682ccc84
2024-12-23 14:43:33 +01:00
David Adam
541f8b47bf Revert "Add completions for dust"
Some checks failed
make test / ubuntu (push) Has been cancelled
Rust checks / clippy (push) Has been cancelled
make test / ubuntu-asan (push) Has been cancelled
make test / macos (push) Has been cancelled
make test / ubuntu-32bit-static-pcre2 (push) Has been cancelled
Rust checks / rustfmt (push) Has been cancelled
This reverts commit 27c7578760a4b31155b498341d8fbb11e752bed3.

dust generates its own completions (which are shipped in the wrong spot
in the Debian packages, but which are also more up-to-date).

Closes #10922.
2024-12-19 19:49:01 +08:00
metamuffin
9abec243a4
Completions for mksquashfs (#10909) 2024-12-18 10:36:30 -06:00
Ilya Grigoriev
7162822486 rclone.fish: assume a recent version if the version cannot be parsed
The version of rclone is set during compilation and could be any crazy string depending on the packager, whether it's a dev build, etc. If it cannot be parsed, let's assume a recent version.

Follows up on cc8fa0f7
2024-12-18 15:31:51 +01:00
Klaus Hipp
25534bf657 Add tex-fmt completions
Some checks are pending
make test / ubuntu (push) Waiting to run
make test / ubuntu-32bit-static-pcre2 (push) Waiting to run
make test / ubuntu-asan (push) Waiting to run
make test / macos (push) Waiting to run
Rust checks / rustfmt (push) Waiting to run
Rust checks / clippy (push) Waiting to run
2024-12-18 02:21:57 +08:00